lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 13 Dec 2017 15:39:21 +0100
From:   Oliver Neukum <oneukum@...e.com>
To:     Mikhail Zaytsev <flashed@...l.ru>
Cc:     linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH] USB: serial: ark3116.c: Remove unused TIOCSSERIAL case
 from ioctl

Am Mittwoch, den 13.12.2017, 15:30 +0300 schrieb Mikhail Zaytsev:
> On Wed, 13 Dec 2017 12:40:48 +0100 Oliver Neukum <oneukum@...e.com> wrote:
> 
> > 
> > They give you nothing. If you are looking at a vendor ID nothing but the
> > bare number makes sense. You are just making peoples' life harder when
> > they have to look up that definition. A symbolic name is fine if it gives
> > meaning. Even if the information you give is that the value is magic
> > and therefore not understood. But a vendor ID is an arbitrary yet
> > meaningful number. There is no point in hiding it.
> 
> Thanks. I hear you, Oliver. What about:
> 
> -		serstruct.baud_base = 460800;
> 
> Is it a magic number? I think yes.
> 

Hi,

yes sure. That is a candidate for a symbolic name. Though if you use
it once, I see no benefit, but it does not hurt either. The member
is named and that is the important thing.

A line like

if (rate > 38400) return -EINVAL;

is not so good

if (rate > MAX_BAUD) return -EINVAL;

better

But:

device->maxbaudrate = 38400

is better than

device->maxbaudrate = MAX_BAUD

You see the point?

	Regards
		Oliver

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ