Received: by 10.213.65.68 with SMTP id h4csp1538976imn; Thu, 15 Mar 2018 02:33:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELt/lxy1tsiJiKzKVo7043dEhM4v3t19GjHt4bN2B6q560sDiXb39KRlWhXtPGBLkie3kcPV X-Received: by 10.99.62.193 with SMTP id l184mr6066181pga.87.1521106420341; Thu, 15 Mar 2018 02:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521106420; cv=none; d=google.com; s=arc-20160816; b=MDqPqquIxd+dnCtIXJ3la0vc/IYS+J5tXkf1hF8Gwh2kc8f55O1qCvy33uLavqiyLH sDP+iFwLxqmyiTk57BE2LhgQff8qkCM1V1TKv6kKRf76fxp0n+WLV0Y9+YA413d9QsN9 OvY9adCEIXO03vdpxf52vqr7Qjbg7E1J96D4i1a9+ERLC/0ygTsQeEntAm8Nr9qQ1gvr pQV2ujof7Jp+tPDTOpep5bPQkaRZP/0auq5ustFiUHJ+orN1TIFfU+u6dlmAf06AmQ3u cN3sUso2amd+8Dilcgvj96cmlNIqoyZx7m57WxloQwKSopcNlpzXLrBxOS0MM36x0Va3 Fn4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=rwZFKBVfbXCKXG4+PihRiojiomad4J+LorIqPOqiAeg=; b=YqqH5RtouFf/NKxUZMoxPU7TUw9Cgee9Nd9dK+eUtazzaQX9w2vtb9/W1WgLjgVMPH 8wp7vO4vkmaCZuBgJNAK1dRUtVgELTTYIVmSWT0TdicmryJmqyuN8SJyYYoJzUPav8L3 jKOmGd+czu0kLKct7h0X83vLi5GkyFZ2a9VBb3OUXxNKgZpfCmtumHqJh42cgzX+7epO y31ZTA96+/bUUALd7zT6TSlIGIAt3y7Lw1K3snU888mqmAXJDvAFmDymDNjf0Jy9X44K Kg8FClLwkjWY0pfsAagmdhM06ZGdseYRq0NZRYqZqzLHWc5KwGzffrmzUBV4DNRmQjuy mBCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10-v6si3633290plx.355.2018.03.15.02.33.25; Thu, 15 Mar 2018 02:33:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751694AbeCOJcf (ORCPT + 99 others); Thu, 15 Mar 2018 05:32:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:49045 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbeCOJce (ORCPT ); Thu, 15 Mar 2018 05:32:34 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B168CAF36; Thu, 15 Mar 2018 09:32:32 +0000 (UTC) Message-ID: <1521105992.18237.2.camel@suse.com> Subject: Re: [PATCH 2/3] usb: host: pci: introduce PCI vendor ID for Netlogic From: Oliver Neukum To: Richard Leitner , Richard Leitner , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-usb@vger.kernel.org Cc: bhelgaas@google.com, mathias.nyman@intel.com, gregkh@linuxfoundation.org Date: Thu, 15 Mar 2018 10:26:32 +0100 In-Reply-To: <377fb9d5-1cc9-7ab8-c965-2fb0a4dc20f3@skidata.com> References: <20180314102933.21367-1-dev@g0hl1n.net> <20180314102933.21367-3-dev@g0hl1n.net> <1521029854.4511.12.camel@suse.com> <1521041253.4511.16.camel@suse.com> <377fb9d5-1cc9-7ab8-c965-2fb0a4dc20f3@skidata.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, den 14.03.2018, 16:44 +0100 schrieb Richard Leitner: > On 03/14/2018 04:27 PM, Oliver Neukum wrote: > > Am Mittwoch, den 14.03.2018, 14:31 +0100 schrieb Richard Leitner: > > > > > Well, but it does not. Removing a redundant definition is a clear > > benefit. But you are not removing a definition. You are introducing > > a preprocessor constant. Why? > > What is its benefit? > > AFAIK pci_ids.h collects PCI vendor and device IDs in one single > point. As the PCI vendor ID of Netlogic is used in multiple files > IMHO it would be a good idea to add it to pci_ids.h and furthermore > remove it from arch/mips/include/asm/netlogic/xlp-hal/iomap.h (where > it's currently defined). > > Or am I getting things wrong? I think so, yes. We are giving names to constants as a form of comment or to change them at multiple places at once and consistently. So #define XYZ_NETDEV_RESET_RETRIES 2 makes clearly sense. So does #define XYZ_MAGIC_VALUE1 0xab4e because it tells you that you have a magic value. But you will never redefine a PCI vendor ID. In fact you must not. And if you have a comparison like dev->vID == 0x1234 if you change this to dev->vID == SOME_VENDOR_ID what good does this to you? You already knew it was a vendor ID. Now you can name it at a glance. So what? If you have a device you will have to check whether you have some OEM version. You will always go and check the raw number. And if you have a log and need to check whether the check will be true, you will have a number. Using a constant there is nothing but trouble. Yet one more grep. Regards Oliver