Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp50684ybt; Fri, 12 Jun 2020 19:26:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3SKKCFkaliqFQs2up3JYo0Xib4LzacqEOKi9WlMEpM+10Y++0/ZErX04zAOV+7krm6Xig X-Received: by 2002:aa7:d6c1:: with SMTP id x1mr14085105edr.154.1592015212684; Fri, 12 Jun 2020 19:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592015212; cv=none; d=google.com; s=arc-20160816; b=SeS7/CVy3xChieyO7Ki4ckT96nhFBpSY/Evpp50dZsQvRDNvP4pmDvsIcTsLNApKdp O4JYNBTeTcI/BcY4uR6GY7l5ZrYwEa1SiC8obbRIFtdFRlvqx+qH98C1WceqkFvc5HZf oZ2q05bBhc5V4hPl6tK8ackk03Q6ZtVTPo6pAB4jnR5MKQw3tdlEEeBZdLrZ7iptL6rJ ++oSJu4NuD5c0GciDfMwKQbL2q8skeBgnPLkDXqL2hIE9emT9vILZNkwftUYj8Bk/k8K xlM5nczgaQxpHcl/mkBtF2WZwFRTfvovBF7be+Dfud2EiarAAsSD+faEy/TL5QcebzId D+jw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=/Rgt9QfdJyY153ymsbOwJD82ieRVyN2aCeuAjsXRq/8=; b=o23m0D1nRomUm5ha/Ii0ftTtWJNAd0PjOtq4DWcRBJ27rJTXUjgfVWGuF1/SPiCbGc iHf/kYpC41uOtvwfgSvSFbvKWrr0P44/aqFj0J8dD+C2LXynU/bh8SMv1K5NHqamu3Zq mvXYEITTMcMktg44sKuILOtH9OwM2u5ur9t916OX+8AjVtQpTgz/IxTSbXIailAMUB8J svqVR2Bzy8EqGgoYsJozN7VV4m7/TLHyqjeuoQ81yIeFsx6DERMi3CENvPg23ViItvmm scF8Y0m6+8k9JFkGj7v2qQfiWIUFAWlvJvt0/QN33mQ1PX3hEZsMc90lC6UcPqFRrkPo ucQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dv21si5151925ejb.220.2020.06.12.19.26.30; Fri, 12 Jun 2020 19:26:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726474AbgFMCTy (ORCPT + 99 others); Fri, 12 Jun 2020 22:19:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:48906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbgFMCTy (ORCPT ); Fri, 12 Jun 2020 22:19:54 -0400 Received: from [10.44.0.192] (unknown [103.48.210.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B9AC8206F5; Sat, 13 Jun 2020 02:19:50 +0000 (UTC) Subject: Re: drivers/net/can/kvaser_pciefd.c:801:17: sparse: sparse: cast removes address space '' of expression To: Luc Van Oostenryck Cc: Marc Kleine-Budde , kernel test robot , Henning Colliander , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Jimmy Assarsson , Christer Beskow References: <202006121356.lKucoVPo%lkp@intel.com> <9b599221-3c15-909c-168a-766c554827d9@linux-m68k.org> <20200612163509.6ieqxm4peqcfgd7o@ltop.local> From: Greg Ungerer Message-ID: <27273ebc-1240-8615-798e-b68878b80494@linux-m68k.org> Date: Sat, 13 Jun 2020 12:19:47 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200612163509.6ieqxm4peqcfgd7o@ltop.local> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/6/20 2:35 am, Luc Van Oostenryck wrote: > On Sat, Jun 13, 2020 at 01:33:16AM +1000, Greg Ungerer wrote: >> On 12/6/20 5:48 pm, Marc Kleine-Budde wrote: >> I think this one is due to not forcing the volatile cast in __raw_write(). >> So this change will fix that: >> >> diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h >> index 0498192e1d98..1bc739f1f1ad 100644 >> --- a/arch/m68k/include/asm/io_no.h >> +++ b/arch/m68k/include/asm/io_no.h >> @@ -14,15 +14,15 @@ >> * that behavior here first before we include asm-generic/io.h. >> */ >> #define __raw_readb(addr) \ >> - ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; }) >> + ({ u8 __v = (*(__force volatile u8 *) (addr)); __v; }) >> #define __raw_readw(addr) \ >> - ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; }) >> + ({ u16 __v = (*(__force volatile u16 *) (addr)); __v; }) >> #define __raw_readl(addr) \ >> - ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; }) >> + ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; }) >> -#define __raw_writeb(b, addr) (void)((*(volatile unsigned char *) (addr)) = (b)) >> -#define __raw_writew(b, addr) (void)((*(volatile unsigned short *) (addr)) = (b)) >> -#define __raw_writel(b, addr) (void)((*(volatile unsigned int *) (addr)) = (b)) >> +#define __raw_writeb(b, addr) (void)((*(__force volatile u8 *) (addr)) = (b)) >> +#define __raw_writew(b, addr) (void)((*(__force volatile u16 *) (addr)) = (b)) >> +#define __raw_writel(b, addr) (void)((*(__force volatile u32 *) (addr)) = (b)) > > Look good to me but isn't easier to leave them undefined and include > asm-generic/io.h? Not so simple at the moment. Although juggling a few things around within io_no.h will let you use the asm-generic functions it will now throw up a _lot_ of warnings in many of the architecture files that pass int constant addresses to the raw_* functions. That is on my todo list. Regards Greg