Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp603905ybg; Fri, 12 Jun 2020 09:40:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYYTdjioKrEup1c5SQKsF3zZkrFkDAqPAquihKyl0Dpx/e06h9lrbkr17rVjfcFSyT4lSe X-Received: by 2002:a05:6402:148d:: with SMTP id e13mr12860203edv.200.1591980052901; Fri, 12 Jun 2020 09:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591980052; cv=none; d=google.com; s=arc-20160816; b=KKNAEet4C0+RVIFxaEG5BCFt8EgS+Wu63Mg6LGKuc88J/owfD/E3tMfHYhX3cOlR8p GIy+DIH6VdK2LLZe0afTU2N0gmck1Y0TpHIuhS9p/JzJyVl27wWra5k9ESxvi/Nu0VG9 DEA1Nv7GZQA2e+BODXQHj0o5NnKobvrv4tPvr4pPqxE6t8BZRun2ZEbkQCiJ+/iVwI+a tlFpTCFg4EoyUfqYjSWg7t+hV6jXHnck4bk/fd/vZ4MfSiTbskuKgdt+FhdT7F/L0zc0 Igm0Yqg+mh4OWsSWxlVn6OqIjaIBmHKM1JSCqRQVTiGnrCI8vspMEUxqScJR0MvY1ViN FpOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0yVNHTAW1XJdHmtR0a1FJNXlEuEIG0Mtgdk/0DC6Vuc=; b=OAEC9fYQwtm/MpOwD6WE3cIp/l93R+nzr0fvqj8QV8nHENtU6qSbDQECw4hi9yCkeR HMADqJf8KvhwpAYMoCBfrjXcDftw//MmteCHJB2/iqcYoHEfbF7XAhPAdV9H5f08mUNZ Hdol4nUIFsNhuYmF8UIZexbiE7UOfpHHCQCag/cFc2916hOqyDzbZBvC4yD1P7sAqwmY 71ymTkMklZVBAchLdgCpOj+yK2Fyhd7Ieh9j9qfExzGx0KcTksxrvfHTRfUYPkpW3DLn d+zjCfbfMio/h7jFRzoE2O31kmua8TWNvu1gpWrb4IqdfwoXg01BOqcweN4pKLb+cowa 8ftg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aZBz7bXB; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds18si4905364ejc.609.2020.06.12.09.40.29; Fri, 12 Jun 2020 09:40: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aZBz7bXB; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726398AbgFLQfO (ORCPT + 99 others); Fri, 12 Jun 2020 12:35:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbgFLQfN (ORCPT ); Fri, 12 Jun 2020 12:35:13 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69C46C03E96F for ; Fri, 12 Jun 2020 09:35:13 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id t21so6855278edr.12 for ; Fri, 12 Jun 2020 09:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0yVNHTAW1XJdHmtR0a1FJNXlEuEIG0Mtgdk/0DC6Vuc=; b=aZBz7bXB0OSgiOS5qyjbOW7Vx612Zl0oSmCA4hK1BT3lmeJ7LLBJWNU+POU/09YNh1 j/lK2JfDJqhRHhc1A1KkKGonuB+BRc2o1ujrU7/h43XG1GUnNsSLxZT5PoSY1PC4tn07 CcI+VSPVjGfz5gigqiDyQI7uDcinagrKGi6ckxl/cQaqPEmo6QPmbzWFOVg82z7STdKa LRo4PssmtQNwXVLUAwhuZdd399UCA2Qw1ZcATFxQLuC9+IjbMq8VzdeM9WifkYF9efNQ xXDKs4UqPz/mAQVis0fXV+tkDAVu0Ix4MQLrp7Gy65drUfZchR3qqrBIymlr6heDhQRd cnNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0yVNHTAW1XJdHmtR0a1FJNXlEuEIG0Mtgdk/0DC6Vuc=; b=REPR+Dg0I9RncWGAEFTbB0CELn4BnFjmaQeUMGd+c0eWYKRpNHkS2N0d3S0LHXUTDr xzzadVhmWE1XTZh14ymfqIDH5Ysa1gc41MLdy0KT1GyONTwax7rVpcRB5B/zBAS66DZI /nTjl9kGNGZ+JNP1hhEuweDkvi+VcS9oO3EhBsfTWf232riMwKlyJYu2hf2NMrcuPZUr 6bIgHaS4HyB+7vDxgHbVM4lc3m8IkOmGa05swKKCYFMvWCI/HFjFxz34mPBMPquU/ssj wfG9pz18KZhoUFkcG7l2IExGnhVS/0VuchuRwKHbs+5qwOi11wZ2BaTZ7K195MFmDo12 zRtw== X-Gm-Message-State: AOAM533FnpYW4Etm9B+QJZ83+E0IDMg9hKdcUcu5Srs7vU1mQhKplL6Q KQfRL/26nc5xEKI+8neAW5LMx3WK X-Received: by 2002:a05:6402:22e4:: with SMTP id dn4mr12647031edb.288.1591979711743; Fri, 12 Jun 2020 09:35:11 -0700 (PDT) Received: from ltop.local ([2a02:a03f:b7f9:7600:1143:792f:f1d8:ffcf]) by smtp.gmail.com with ESMTPSA id kt10sm3816790ejb.54.2020.06.12.09.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2020 09:35:10 -0700 (PDT) Date: Fri, 12 Jun 2020 18:35:09 +0200 From: Luc Van Oostenryck To: Greg Ungerer Cc: Marc Kleine-Budde , kernel test robot , Henning Colliander , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Jimmy Assarsson , Christer Beskow Subject: Re: drivers/net/can/kvaser_pciefd.c:801:17: sparse: sparse: cast removes address space '' of expression Message-ID: <20200612163509.6ieqxm4peqcfgd7o@ltop.local> References: <202006121356.lKucoVPo%lkp@intel.com> <9b599221-3c15-909c-168a-766c554827d9@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9b599221-3c15-909c-168a-766c554827d9@linux-m68k.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 13, 2020 at 01:33:16AM +1000, Greg Ungerer wrote: > Hi Marc, > > On 12/6/20 5:48 pm, Marc Kleine-Budde wrote: > > the k-build robot found this sparse problem, triggered by building a CAN driver > > for m68k. Is this a problem in our CAN driver or in the m68k headers? > > I suspect a problem with the m68k (specifically non-mmu) headers. Indeed. > 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? > > > arch/m68k/include/asm/io_no.h:78:16: sparse: sparse: cast to restricted __le32 > > This one I am not sure about yet. > Still investigating. swab32(__raw_readl(addr)) ? Keeping __le32_to_cpu() will only force you to use ugly casts for no benefits and the comment above explain clearly the situation about the endianness. Best regards, -- Luc