From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932401AbdJJQiU (ORCPT ); Tue, 10 Oct 2017 12:38:20 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:36528 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932237AbdJJQiS (ORCPT ); Tue, 10 Oct 2017 12:38:18 -0400 X-IronPort-AV: E=Sophos;i="5.43,505,1503331200"; d="scan'208";a="159788842" From: Bart Van Assche To: "mst@redhat.com" CC: "hch@lst.de" , "linux-kernel@vger.kernel.org" , "torvalds@linux-foundation.org" Subject: Re: [PATCH] linux/types.h: Restore the ability to disable sparse endianness checks Thread-Topic: [PATCH] linux/types.h: Restore the ability to disable sparse endianness checks Thread-Index: AQHTPsfpNidr/j8ehUyvQHGzmN9zsKLbhcaAgAAdXoCAACtPAIABgFIA Date: Tue, 10 Oct 2017 16:38:16 +0000 Message-ID: <1507653494.2815.27.camel@wdc.com> References: <20171006172353.16758-1-bart.vanassche@wdc.com> <20171009162008-mutt-send-email-mst@kernel.org> <1507561661.2674.3.camel@wdc.com> <20171009204139-mutt-send-email-mst@kernel.org> In-Reply-To: <20171009204139-mutt-send-email-mst@kernel.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bart.VanAssche@wdc.com; x-originating-ip: [63.163.107.100] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY1PR0401MB1536;20:O75P4yjrymFde+PiM5FDe52nk0PTw1rFpkCMWbxx3KNx3WQJXJXxJBIUm+EfQYeAkYoz/Uz7T4cVmJY1wUeFR6m1gE5LTMH5iLHrWp8v9JUfXpV0+H4y7c1frICnLxHJyqD3ivqoNpO7UNWDaVrz/b9a535wIz+E3hvSdEx/AUQ= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: e94d2e88-09e4-4af8-385d-08d50ffd4ec8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:CY1PR0401MB1536; x-ms-traffictypediagnostic: CY1PR0401MB1536: wdcipoutbound: EOP-TRUE x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR0401MB1536;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR0401MB1536; x-forefront-prvs: 04569283F9 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(376002)(346002)(39860400002)(377424004)(199003)(51444003)(24454002)(189002)(54356999)(103116003)(99286003)(6512007)(305945005)(7736002)(316002)(478600001)(54906003)(14454004)(93886005)(72206003)(3280700002)(8936002)(53936002)(2501003)(2906002)(6916009)(8676002)(25786009)(101416001)(2950100002)(189998001)(66066001)(68736007)(86362001)(3660700001)(6436002)(6506006)(105586002)(33646002)(36756003)(4326008)(5660300001)(102836003)(81156014)(81166006)(50986999)(6486002)(106356001)(5640700003)(76176999)(6246003)(97736004)(1730700003)(6116002)(77096006)(3846002)(2900100001)(2351001)(229853002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0401MB1536;H:CY1PR0401MB1536.namprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2017 16:38:16.3961 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1536 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v9AGcS8s024950 On Mon, 2017-10-09 at 20:42 +0300, Michael S. Tsirkin wrote: > On Mon, Oct 09, 2017 at 03:07:42PM +0000, Bart Van Assche wrote: > > On Mon, 2017-10-09 at 16:22 +0300, Michael S. Tsirkin wrote: > > > On Fri, Oct 06, 2017 at 10:23:53AM -0700, Bart Van Assche wrote: > > > > The purpose of patch "linux/types.h: enable endian checks for all > > > > sparse builds" was to encourage driver authors to annotate > > > > endianness correctly in their drivers. However, since that patch > > > > went upstream no endianness annotations in drivers have been fixed. > > > > I think that this shows that the followed approach does not work, > > > > probably because several driver authors do not use sparse. Restore > > > > the ability to disable sparse endianness checks such that it > > > > becomes again easy to review other sparse diagnostics for people > > > > who want to analyze drivers they are not the author of. > > > > > > > > References: commit 05de97003c77 ("linux/types.h: enable endian checks for all sparse builds") > > > > Signed-off-by: Bart Van Assche > > > > Cc: Christoph Hellwig > > > > Cc: Linus Torvalds > > > > > > I still think the new default is good. You probably want ability to > > > disable these checks selectively for the specific drivers though. Makes > > > it easier to spot what needs to be fixed. > > > > I agree with what you wrote. And what you described is what my patch implements > > - keep endianness checking enabled by default and make it possible to disable it > > selectively. Does that mean that you agree with the patch I posted? > > I just mean I'd expect a patchset setting the flag for the broken > drivers. Presumably this will help trigger some action. Hello MST, If I would add something like ccflags-y += -D__CHECK_ENDIAN__=0 to the Makefile of drivers that are not endianness clean then that would make it easier for driver authors to ignore endianness warnings reported by sparse. I prefer that they have to add CF=-D__CHECK_ENDIAN__=0 to the command line when verifying a driver with sparse to get rid of the sparse endianness warnings. Do you agree with this? Thanks, Bart.