From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 294FAC2D0A3 for ; Thu, 12 Nov 2020 08:28:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8938C20870 for ; Thu, 12 Nov 2020 08:28:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="F/ecXgOv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8938C20870 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7Y0no4W8FRC8O/Uz1N2DeHWW6nAipC5kQfQNyHyH5E4=; b=F/ecXgOvpWi/h1l+VTC12LW2b 9wgq3iE7nD+lTLFmsHcIIwh9W/O39qGXcpcds0qLURudSns5wRlsltEKOTEqBeM0ur7vfVX/XJeaC qwFpSzPFL6nAXPLrZ1H3QO01BZOmpGLvKxCzofEGdXtsbkeETglHcta/0SW/zVclh/3I1RQSilJEP RxOFI81QVynGTyD44KoIhwME1BNtVH6oxEkE0zAF/kj8Uo1YJwAn2P46qjfSMlBFj8CzmRbZrOwtJ bnFm+r+0clJSmPsvUDJ3/aJmadc6ypRRK06OpI6I0GwwrcZQs+sZBKYD3uvVPvTQ9cmmMwackgiiQ UnvobyWBw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kd7x1-0005VU-IZ; Thu, 12 Nov 2020 08:27:27 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kd7wx-0005UM-QD for linux-mtd@lists.infradead.org; Thu, 12 Nov 2020 08:27:25 +0000 X-Originating-IP: 91.224.148.103 Received: from xps13 (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id C3B37FF812; Thu, 12 Nov 2020 08:27:16 +0000 (UTC) Date: Thu, 12 Nov 2020 09:27:15 +0100 From: Miquel Raynal To: Serge Semin Subject: Re: drivers/mtd/maps/physmap-bt1-rom.c:78:18: sparse: sparse: cast removes address space '__iomem' of expression Message-ID: <20201112092715.7e466405@xps13> In-Reply-To: <20201111192259.ovdyjcuue7fx2bqa@mobilestation> References: <202011021254.XC70BaQT-lkp@intel.com> <20201110113827.hl5i27cpl6exo3md@mobilestation> <20201110163556.3e3423f6@xps13> <20201111192259.ovdyjcuue7fx2bqa@mobilestation> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_032724_038212_ED6EC28D X-CRM114-Status: GOOD ( 15.40 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mtd@lists.infradead.org, kbuild-all@lists.01.org, kernel test robot , Serge Semin , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org SGkgU2VyZ2V5LAoKU2VyZ2UgU2VtaW4gPFNlcmdleS5TZW1pbkBiYWlrYWxlbGVjdHJvbmljcy5y dT4gd3JvdGUgb24gV2VkLCAxMSBOb3YKMjAyMCAyMjoyMjo1OSArMDMwMDoKCj4gT24gVHVlLCBO b3YgMTAsIDIwMjAgYXQgMDQ6MzU6NTZQTSArMDEwMCwgTWlxdWVsIFJheW5hbCB3cm90ZToKPiA+ IEhpIFNlcmdlLAo+ID4gCj4gPiBTZXJnZSBTZW1pbiA8U2VyZ2V5LlNlbWluQGJhaWthbGVsZWN0 cm9uaWNzLnJ1PiB3cm90ZSBvbiBUdWUsIDEwIE5vdgo+ID4gMjAyMCAxNDozODoyNyArMDMwMDoK PiA+ICAgCj4gPiA+IEhlbGxvIE1pcXVlbCwKPiA+ID4gCj4gPiA+IEEgc2l0dWF0aW9uIG5vdGVk IGJ5IHRoZSB3YXJuaW5nIGJlbG93IHdvbid0IGNhdXNlIGFueSBwcm9ibGVtIGJlY2F1c2UKPiA+ ID4gdGhlIGNhc3RpbmcgaXMgZG9uZSB0byBhIG5vbi1kZXJlZmVyZW5jZWQgdmFyaWFibGUuIEl0 IGlzIHV0aWxpemVkCj4gPiA+IGFzIGEgcG9pbnRlciBiaWFzIGxhdGVyIGluIHRoYXQgZnVuY3Rp b24uIFNoYWxsIHdlIGp1c3QgaWdub3JlIHRoZQo+ID4gPiB3YXJuaW5nIG9yIHN0aWxsIGZpeCBp dCBzb21laG93PyAgCj4gPiAgIAo+IAo+ID4gRG8geW91IHRoaW5rIHRoZSBjYXN0IHRvIGEgIV9f aW9tZW0gdmFsdWUgaXMgbWFuZGF0b3J5IGhlcmU/ICAKPiAKPiBJdCdzIG5vdCBtYW5kYXRvcnkg dG8gaGF2ZSB0aGUgY2FzdGluZyB3aXRoIG5vIF9faW9tZW0sIGJ1dCB3b3VsZG4ndAo+IGRvaW5n IGxpa2UgdGhpczoKPiArIAlzaGlmdCA9IChzc2l6ZV90IF9faW9tZW0pc3JjICYgMHgzOwo+IGJl IGxvb2tpbmcgd2VpcmQ/IFJlYWxseSwgaXMgdGhlcmUgYSBnb29kIHdheSB0byBzb21laG93IGV4 dHJhY3QgdGhlIGZpcnN0Cj4gdHdvIGJpdHMgb2YgYSBfX2lvbWVtIHBvaW50ZXIgd2l0aG91dCBn ZXR0aW5nIHRoZSBzcGFyc2Ugd2FybmluZz8KCkkgYXNrZWQgYXJvdW5kIG1lLCB3aGF0IGFib3V0 IHRyeWluZyB1aW50cHRyX3Q/CgpUaGFua3MsCk1pcXXDqGwKCl9fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpMaW51eCBNVEQgZGlzY3Vzc2lvbiBt YWlsaW5nIGxpc3QKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9s aW51eC1tdGQvCg== From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7493821801663881297==" MIME-Version: 1.0 From: Miquel Raynal To: kbuild-all@lists.01.org Subject: Re: drivers/mtd/maps/physmap-bt1-rom.c:78:18: sparse: sparse: cast removes address space '__iomem' of expression Date: Thu, 12 Nov 2020 09:27:15 +0100 Message-ID: <20201112092715.7e466405@xps13> In-Reply-To: <20201111192259.ovdyjcuue7fx2bqa@mobilestation> List-Id: --===============7493821801663881297== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Sergey, Serge Semin wrote on Wed, 11 Nov 2020 22:22:59 +0300: > On Tue, Nov 10, 2020 at 04:35:56PM +0100, Miquel Raynal wrote: > > Hi Serge, > > = > > Serge Semin wrote on Tue, 10 Nov > > 2020 14:38:27 +0300: > > = > > > Hello Miquel, > > > = > > > A situation noted by the warning below won't cause any problem because > > > the casting is done to a non-dereferenced variable. It is utilized > > > as a pointer bias later in that function. Shall we just ignore the > > > warning or still fix it somehow? = > > = > = > > Do you think the cast to a !__iomem value is mandatory here? = > = > It's not mandatory to have the casting with no __iomem, but wouldn't > doing like this: > + shift =3D (ssize_t __iomem)src & 0x3; > be looking weird? Really, is there a good way to somehow extract the first > two bits of a __iomem pointer without getting the sparse warning? I asked around me, what about trying uintptr_t? Thanks, Miqu=C3=A8l --===============7493821801663881297==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7DECC2D0A3 for ; Thu, 12 Nov 2020 08:27:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CDFD20870 for ; Thu, 12 Nov 2020 08:27:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726766AbgKLI1W convert rfc822-to-8bit (ORCPT ); Thu, 12 Nov 2020 03:27:22 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:38055 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbgKLI1W (ORCPT ); Thu, 12 Nov 2020 03:27:22 -0500 X-Originating-IP: 91.224.148.103 Received: from xps13 (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id C3B37FF812; Thu, 12 Nov 2020 08:27:16 +0000 (UTC) Date: Thu, 12 Nov 2020 09:27:15 +0100 From: Miquel Raynal To: Serge Semin Cc: Serge Semin , kernel test robot , , , Subject: Re: drivers/mtd/maps/physmap-bt1-rom.c:78:18: sparse: sparse: cast removes address space '__iomem' of expression Message-ID: <20201112092715.7e466405@xps13> In-Reply-To: <20201111192259.ovdyjcuue7fx2bqa@mobilestation> References: <202011021254.XC70BaQT-lkp@intel.com> <20201110113827.hl5i27cpl6exo3md@mobilestation> <20201110163556.3e3423f6@xps13> <20201111192259.ovdyjcuue7fx2bqa@mobilestation> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sergey, Serge Semin wrote on Wed, 11 Nov 2020 22:22:59 +0300: > On Tue, Nov 10, 2020 at 04:35:56PM +0100, Miquel Raynal wrote: > > Hi Serge, > > > > Serge Semin wrote on Tue, 10 Nov > > 2020 14:38:27 +0300: > > > > > Hello Miquel, > > > > > > A situation noted by the warning below won't cause any problem because > > > the casting is done to a non-dereferenced variable. It is utilized > > > as a pointer bias later in that function. Shall we just ignore the > > > warning or still fix it somehow? > > > > > Do you think the cast to a !__iomem value is mandatory here? > > It's not mandatory to have the casting with no __iomem, but wouldn't > doing like this: > + shift = (ssize_t __iomem)src & 0x3; > be looking weird? Really, is there a good way to somehow extract the first > two bits of a __iomem pointer without getting the sparse warning? I asked around me, what about trying uintptr_t? Thanks, Miquèl