Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp363886imm; Wed, 17 Oct 2018 01:09:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV61g2LTYcfa9odscJaoKkGL3eXLu4Vqys3kvYl2E0Mkb05eQgE5tbzYeiwUD1nvDRRF2U403 X-Received: by 2002:a62:9951:: with SMTP id d78-v6mr25107140pfe.239.1539763773886; Wed, 17 Oct 2018 01:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539763773; cv=none; d=google.com; s=arc-20160816; b=roHW2UPmd+CKoAoRhdnVv0VeLlgsYLOPGcPQp76dhy1vAkE6Ptjrpokrrh4XjUaAaB hkYbePsZyIV6y0JBTRf+5NIV9jdcn8vghX+gnzaAmF/yM8Dc++Q0OxcwV1HzOshxYt6P XTZ0tvlA3oVS2N1+NAlqu++5kQGK8U//sNzoTf908midLWzpYry2h6N6UHLhlNqZ1l/A u0cXcydhaRNUa3cCG5f8eOJVKcUFM+YyV/7+T8pyrHN7/KtLQ5+uu4ygYZ+kppleWHH6 KNQqp09vUbQ+QFF3FnzWAz7Kj3gm2O5p0Mbcg6GvDhM37UwGYQaiINl36K0zsRGnEY3C AnNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jzYlRwHwg9bxqQsoY9qpvMVgXBxodh6duTLqLab96Ds=; b=iuMc5/pDZflKdYyDA5+/eZJuXWvIbys+C2avkHxCoc9wVZvxxbY715leF9U2OeL29t Ffxe4JvQkMzPdyQ8ZuA9ElJhKSkY24qCzNcRVrwkP3IhTSZR8QnELebp6JmJfkbQa0G5 4fPrMMESUk36tOZlf+iKTmuB14sTbbMRh1uDcFYgTpykU0yChVoHOynBY5yKB76kZbUU i3TtvUDHkDbfSh88pLndr0Fbs5HMIvSA5Wc5X4Iqigc3VT5vTY0euJappG0DquKHxf4b w+3sia11uNq3t/FXJAA1wkj+LNz4EpJUXDJv6Q6X0KVIhtnNrqHiVTLjTZ+Cg14Sp1bY Xt8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=sQxDaA2s; 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 m23-v6si16759835pgk.424.2018.10.17.01.09.17; Wed, 17 Oct 2018 01:09:33 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=sQxDaA2s; 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 S1727280AbeJQQD1 (ORCPT + 99 others); Wed, 17 Oct 2018 12:03:27 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:33022 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726967AbeJQQD1 (ORCPT ); Wed, 17 Oct 2018 12:03:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jzYlRwHwg9bxqQsoY9qpvMVgXBxodh6duTLqLab96Ds=; b=sQxDaA2svfX10ouTelbgFrRl2 cXVGLhY6cOkG/VGGDlA+WGpmINdE8IZ83q/h6iuipDA9NzcsetSa2tV8MYaDJhLQ1huR13pSXm6NK Daq8fpMACfdM/+JuEo16tPQjOsCSwjpH/FnufbK6KCksNEceZPwD58huOMnNDcHUsxVwttuoteCZ1 YVk2HpLnKe5PQAjWx59yypKoYA5jSxjRIrsxXrqdvDjXDIWgUYe/mOvB56TCbr+4ttuQJWngkjd+h V7yPV/ggU7YZr7kldUnx3yRGwhMLv/qVHsK8rFCdubOI//Jg8cWEdAGzoNgiNqaktY0vu9I2uz8rZ 77E1Gcrfg==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCgsw-0006SG-DH; Wed, 17 Oct 2018 08:08:54 +0000 Date: Wed, 17 Oct 2018 01:08:54 -0700 From: Christoph Hellwig To: Finn Thain Cc: Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" , Michael Schmitz , linux-scsi@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/6] esp_scsi: De-duplicate PIO routines Message-ID: <20181017080854.GB24540@infradead.org> References: <35ac9f31-7068-ab93-4629-363ee0bb4c70@suse.de> <2b48c925-73f0-0ca0-2f3c-3c35d90010ba@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 16, 2018 at 10:52:26AM +1100, Finn Thain wrote: > True enough. We agree that this #ifdef is undesirable. And yet when I > tried it, I found an unexpected readability benefit to your suggestion: > > #ifdef CONFIG_SCSI_ESP_PIO > u8 __iomem *fifo_reg; > int send_cmd_error; > u32 send_cmd_residual; > #endif > > This grouping does help convey the purpose of these struct members, even > though the #ifdef is meant for the compiler not for the human reader. > > So maybe it makes sense to group these definitions (they are all the same > size): > > /* These are used by esp_scsi_send_pio_cmd() */ > u8 __iomem *fifo_reg; > int send_cmd_error; > u32 send_cmd_residual; I like the grouping, and in fact the ifdef sounds fine to me as well. > Do static checkers really complain about this? I think the validity of an > extern can't be known until the final linkage is done. None that I know of does, and as said before this patterns is very common all over the kernel.