Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753318AbdLMOn6 (ORCPT ); Wed, 13 Dec 2017 09:43:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:60845 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753291AbdLMOnz (ORCPT ); Wed, 13 Dec 2017 09:43:55 -0500 Message-ID: <1513175961.26281.20.camel@suse.com> Subject: Re: [PATCH] USB: serial: ark3116.c: Remove unused TIOCSSERIAL case from ioctl From: Oliver Neukum To: Mikhail Zaytsev Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Wed, 13 Dec 2017 15:39:21 +0100 In-Reply-To: <20171213153027.7aaab62b@zaytsev.tver.pg> References: <20171213123004.4619000a@zaytsev.tver.pg> <1513160248.26281.5.camel@suse.com> <20171213143142.1c312b57@zaytsev.tver.pg> <1513165248.26281.11.camel@suse.com> <20171213153027.7aaab62b@zaytsev.tver.pg> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1121 Lines: 46 Am Mittwoch, den 13.12.2017, 15:30 +0300 schrieb Mikhail Zaytsev: > On Wed, 13 Dec 2017 12:40:48 +0100 Oliver Neukum 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