Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752768AbdLMLpY (ORCPT ); Wed, 13 Dec 2017 06:45:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:45724 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752646AbdLMLpW (ORCPT ); Wed, 13 Dec 2017 06:45:22 -0500 Message-ID: <1513165248.26281.11.camel@suse.com> Subject: Re: [PATCH] USB: serial: ark3116.c: Remove unused TIOCSSERIAL case from ioctl From: Oliver Neukum To: Mikhail Zaytsev Cc: Johan Hovold , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Wed, 13 Dec 2017 12:40:48 +0100 In-Reply-To: <20171213143142.1c312b57@zaytsev.tver.pg> References: <20171213123004.4619000a@zaytsev.tver.pg> <1513160248.26281.5.camel@suse.com> <20171213143142.1c312b57@zaytsev.tver.pg> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1488 Lines: 37 Am Mittwoch, den 13.12.2017, 14:31 +0300 schrieb Mikhail Zaytsev: > On Wed, 13 Dec 2017 11:17:28 +0100 Oliver Neukum wrote: > > > > > Am Mittwoch, den 13.12.2017, 12:30 +0300 schrieb Mikhail Zaytsev: > > > > > > +#define RS232_VENDOR 0x6547 > > > +#define RS232_PRODUCT 0x0232 > > > +#define IRDA_VENDOR 0x18ec > > > +#define IRDA_PRODUCT 0x3118 > > >   > > >  /* usb timeout of 1 second */ > > >  #define ARK_TIMEOUT 1000 > > >   > > >  static const struct usb_device_id id_table[] = { > > > -       { USB_DEVICE(0x6547, 0x0232) }, > > > -       { USB_DEVICE(0x18ec, 0x3118) },         /* USB to IrDA adapter */ > > > +       { USB_DEVICE(RS232_VENDOR, RS232_PRODUCT) }, > > > +       { USB_DEVICE(IRDA_VENDOR, IRDA_PRODUCT) },  /* USB to IrDA adapter */ > > > > Hi, > > > > what is the purpose of this change? It just makes it harder to grep. > > The constants are arbitrary and they are clearly device IDs. > > The constants are using in several places. > I think the names easier to read. 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. Regards Oliver