All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Mikhail Zaytsev <flashed@mail.ru>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: USB: serial: ark3116.c: Remove unused TIOCSSERIAL case from ioctl
Date: Wed, 13 Dec 2017 15:39:21 +0100	[thread overview]
Message-ID: <1513175961.26281.20.camel@suse.com> (raw)

Am Mittwoch, den 13.12.2017, 15:30 +0300 schrieb Mikhail Zaytsev:
> On Wed, 13 Dec 2017 12:40:48 +0100 Oliver Neukum <oneukum@suse.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
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Oliver Neukum <oneukum@suse.com>
To: Mikhail Zaytsev <flashed@mail.ru>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] USB: serial: ark3116.c: Remove unused TIOCSSERIAL case from ioctl
Date: Wed, 13 Dec 2017 15:39:21 +0100	[thread overview]
Message-ID: <1513175961.26281.20.camel@suse.com> (raw)
In-Reply-To: <20171213153027.7aaab62b@zaytsev.tver.pg>

Am Mittwoch, den 13.12.2017, 15:30 +0300 schrieb Mikhail Zaytsev:
> On Wed, 13 Dec 2017 12:40:48 +0100 Oliver Neukum <oneukum@suse.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

             reply	other threads:[~2017-12-13 14:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13 14:39 Oliver Neukum [this message]
2017-12-13 14:39 ` [PATCH] USB: serial: ark3116.c: Remove unused TIOCSSERIAL case from ioctl Oliver Neukum
  -- strict thread matches above, loose matches on Subject: below --
2018-01-02 15:00 [2/2] USB: serial: ark3116.c: Move TIOCGSERIAL ioctl case to function Johan Hovold
2018-01-02 15:00 ` [PATCH 2/2] " Johan Hovold
2018-01-02 14:50 [1/2] USB: serial: ark3116.c: Remove unused TIOCSSERIAL ioctl case Johan Hovold
2018-01-02 14:50 ` [PATCH 1/2] " Johan Hovold
2017-12-13 16:43 USB: serial: ark3116.c: Remove unused TIOCSSERIAL case from ioctl Mikhail Zaytsev
2017-12-13 16:43 ` [PATCH] " Mikhail Zaytsev
2017-12-13 13:45 [2/2] USB: serial: ark3116.c: Move TIOCGSERIAL ioctl case to function Mikhail Zaytsev
2017-12-13 13:45 ` [PATCH 2/2] " Mikhail Zaytsev
2017-12-13 13:44 [1/2] USB: serial: ark3116.c: Remove unused TIOCSSERIAL ioctl case Mikhail Zaytsev
2017-12-13 13:44 ` [PATCH 1/2] " Mikhail Zaytsev
2017-12-13 13:44 USB: serial: ark3116.c: Remove unused TIOCSSERIAL case from ioctl Mikhail Zaytsev
2017-12-13 13:44 ` [PATCH 0/2] USB: serial: ark3116.c: ioctl changes Mikhail Zaytsev
2017-12-13 12:30 USB: serial: ark3116.c: Remove unused TIOCSSERIAL case from ioctl Mikhail Zaytsev
2017-12-13 12:30 ` [PATCH] " Mikhail Zaytsev
2017-12-13 11:40 Oliver Neukum
2017-12-13 11:40 ` [PATCH] " Oliver Neukum
2017-12-13 11:31 Mikhail Zaytsev
2017-12-13 11:31 ` [PATCH] " Mikhail Zaytsev
2017-12-13 11:24 Johan Hovold
2017-12-13 11:24 ` [PATCH] " Johan Hovold
2017-12-13 10:17 Oliver Neukum
2017-12-13 10:17 ` [PATCH] " Oliver Neukum
2017-12-13  9:30 Mikhail Zaytsev
2017-12-13  9:30 ` [PATCH] " Mikhail Zaytsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1513175961.26281.20.camel@suse.com \
    --to=oneukum@suse.com \
    --cc=flashed@mail.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.