Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2447087pxa; Mon, 3 Aug 2020 16:47:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAkymbfIG5aQmBXcwZ1TtEE8ygwHWg0bUQr31EjGHx8OQIgxSIZGolwaeN3uxH+sXHMRcy X-Received: by 2002:a17:906:ae12:: with SMTP id le18mr4962628ejb.38.1596498469417; Mon, 03 Aug 2020 16:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596498469; cv=none; d=google.com; s=arc-20160816; b=vzgDjuPgCbLY6fotGQOZrm1uIBHtOs9CerbF0MFA6QKQ9f49k/mvaGGGBIJXL0TZOg JBLemm4IF2awgUibVzZKOpuBFvEV4pTo07qHQ+9Vlq0fKaYAJWIajbAW2MxKSPkFtOuW xzmGqQ5l39R7eJqTqAmtcydh9MszmB5bK4WGddkEGY5ff75j8Y2qJG7bJh2CjxXWHMnd psMSGlk+GbKLLYiqNu0wK9K3C9eyBJGanZfGrAPHXa+AelwLNXkzswkXw//E9j+fKs7N aPJox1YbWXOez+MN5AfFvxqTSaGkHIOoLMpEZbMtBOtq8N++PgmAbuBvNrv8IMircdDR fq0w== 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=ZyIOGyXvGoWyVgpe6lMSEU3Lh4L4f7rUlyfG7uAF2bs=; b=s4pLI58nZkNGLND8nw83tULNCCjj+RQDM49Inh6LU/gR6C9nfn0hPolIVquLrd1ekw UcVDt2FWPbUZLd61+7oA3UnMfXV4Rr0clj5Rc6Pum/Hl0DtE47ShUzEyUj41vfVEGlnD gcCzPH9JMioZzLbgPhv//X3q43N+Lx9TAqdG9f+j/tfuDBq0yZK5Z7wjBHC6WRIprWIy Hcv2mMloVpx/KcW/D0W5BtBsaePp0HGA8bLhbimzRKxCOjQD3xVITx3k6vu1mSldXEYn AcB5of9D/Max2MJ/abKUiGfpJwr858pscckuVnHo5B/kwrS57Xv5j3EqsWOybnxJw0vC K7Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tCVXV5dD; 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 l3si11626648ejd.17.2020.08.03.16.47.26; Mon, 03 Aug 2020 16:47:49 -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=tCVXV5dD; 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 S1728419AbgHCXrS (ORCPT + 99 others); Mon, 3 Aug 2020 19:47:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbgHCXrR (ORCPT ); Mon, 3 Aug 2020 19:47:17 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B13A5C06174A; Mon, 3 Aug 2020 16:47:17 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id c6so1001227pje.1; Mon, 03 Aug 2020 16:47:17 -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=ZyIOGyXvGoWyVgpe6lMSEU3Lh4L4f7rUlyfG7uAF2bs=; b=tCVXV5dDP0sDqcuGj8j01E2XwxH+3jXttYLUYybxXmz/9/ncIQTDG2VF2Lrkm0Ul23 VEalCLWgIVUjsbD52jx5UjTDoTFfuRXWnS6xTprlUKYAza/D68A39ouPFnV7lwCCv+Ph eQ1MMg1rIiJCacr4SXEi+FRdqsbAADoyM7L0WnRFByF2YQ3VKhJ5/1IVLCSQD4evkJJE ae6Py5Dgjo4WgIrix1tbGPkijWrS4Ku9gaX5OZm9uyZz9Aq7trjEOJr4rZNxOxPxVWy5 B4fpnOHv8LXKXwvh6M9Z3Bs1+YW3H72oo/d3y8+DwPwJHepmtUGpxG3XjMJQap0srI82 DJ2g== 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=ZyIOGyXvGoWyVgpe6lMSEU3Lh4L4f7rUlyfG7uAF2bs=; b=NGhtpK+LtvGQm3xnM3D5k4Ut22cYxp5ufhy3ADv2tALLgGkXw9qitA0IT1BFK8upc9 VwoqpO0H+O0GTqtdulOyYgNoBfn0NhZfziAG4va+Iu2WSsG4bs0A15RQ3y/B/NpkWqxV 55chistKr9+M91J7AUyipPXtVc2uQIdoHFGwvMudEN11BZPW2HWSuFMBdF/pplNFR+1r vq+JCAZ+9qEgrfgKY57t5FskiT1dnbn5/g0zhhMTe8bqFaosqJk9k276aVPDQEy8jTBr oyl+P+nXwEb8HGd0C3Dde0VAcNwm49vZaCX02XLi+cmoZW6ePP+KU/NR/4xa9Z6v+rxo 9LbA== X-Gm-Message-State: AOAM530IWkCqk3qRzo2zga0ESVCbiCivnkMw5UE7+ZV/5t3bENxMAAFB RVvILOfpRBK5t00kaQJRq+mqelcH X-Received: by 2002:a17:90a:d904:: with SMTP id c4mr1581963pjv.145.1596498437278; Mon, 03 Aug 2020 16:47:17 -0700 (PDT) Received: from localhost (g223.115-65-55.ppp.wakwak.ne.jp. [115.65.55.223]) by smtp.gmail.com with ESMTPSA id o16sm22034123pfu.188.2020.08.03.16.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 16:47:16 -0700 (PDT) Date: Tue, 4 Aug 2020 08:47:14 +0900 From: Stafford Horne To: Arnd Bergmann Cc: LKML , linux-arch Subject: Re: [PATCH] asm-generic/io.h: Fix sparse warnings on big-endian architectures Message-ID: <20200803234714.GL80756@lianli.shorne-pla.net> References: <20200803151134.3740544-1-shorne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 03, 2020 at 09:50:59PM +0200, Arnd Bergmann wrote: > On Mon, Aug 3, 2020 at 5:11 PM Stafford Horne wrote: > > > > On big-endian architectures like OpenRISC, sparse outputs below warnings on > > asm-generic/io.h. This is due to io statements like: > > > > __raw_writel(cpu_to_le32(value), PCI_IOBASE + addr); > > > > The __raw_writel() function expects native endianness, however > > cpu_to_le32() returns __le32. On little-endian machines these match up > > and there is no issue. However, on big-endian we get warnings, for IO > > that is defined as little-endian the mismatch is expected. > > > > The fix I propose is to __force to native endian. > > > > Warnings: > > > > ./include/asm-generic/io.h:166:15: warning: cast to restricted __le16 > > ./include/asm-generic/io.h:166:15: warning: cast to restricted __le16 > > ./include/asm-generic/io.h:166:15: warning: cast to restricted __le16 > > ./include/asm-generic/io.h:166:15: warning: cast to restricted __le16 > > ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32 > > ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32 > > ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32 > > ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32 > > ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32 > > ./include/asm-generic/io.h:179:15: warning: cast to restricted __le32 > > ./include/asm-generic/io.h:215:22: warning: incorrect type in argument 1 (different base types) > > ./include/asm-generic/io.h:215:22: expected unsigned short [usertype] value > > ./include/asm-generic/io.h:215:22: got restricted __le16 [usertype] > > ./include/asm-generic/io.h:225:22: warning: incorrect type in argument 1 (different base types) > > ./include/asm-generic/io.h:225:22: expected unsigned int [usertype] value > > ./include/asm-generic/io.h:225:22: got restricted __le32 [usertype] > > > > Signed-off-by: Stafford Horne > > Looks good to me. > > Acked-by: Arnd Bergmann > > Can you just merge that through your openrisc tree? I don't have > any other asm-generic changes for this merge window. That's fine with me. Thank you. -Stafford