Received: by 10.213.65.68 with SMTP id h4csp971329imn; Sun, 18 Mar 2018 09:15:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELsGjzFAQ0KPAT82epYhY9RE+YyBCD/SOGjYSZf/luMzT6rD7m8IujYSddH04WLm8dIbNigG X-Received: by 10.101.73.74 with SMTP id q10mr6465230pgs.323.1521389713672; Sun, 18 Mar 2018 09:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521389713; cv=none; d=google.com; s=arc-20160816; b=D9wQ0oNvbYQghAZVQHyq6ibtg2mRmAHyFIO3fzJMQM9J/DQH84lvSYXYSmqjST1BtH nmE3QGZzpxOjMIBBLWKqPfbImR5yM5LQYbsVzZBqs43C+v+8xj1VppRWO6bAvwBnH0hM ZHAxYRxGmkMfwF4gvsQqhVo0mI++yfHM1KExIbgAdwUiBd14bN0Ojlm95bmkmFPJ+pWv tDZtdbITRHoSZ9Uw5wZ1XELlGJrx7ql2hRjt1OuruXfo1JDzeFaURn9EMSgOjTmdB2PN YDPzbY4O/+oD6tfwV+5nuOZzIqiZwapwIZ932SU2jtLaoS4pPIri4pbxQnjiIcEeoZWN 1qqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=gXtqpedl4O3FChNYVf1kt7CAyyy5SD5kDx72yosEDrA=; b=vA2CyAVsDu7ql4AP1xxm0d5MhHVRt2W2CdTrpW/iF4hkJJxZRt+ZR2xuKFvmQuQiJj wS4WjJFwsIQertoKXpq5VA4VHS3pvUwkM4U5z0e6m7ZIC1wt5Ys2ilVWRnAjuNibbyls zWv8J7PeFd9nzgy/EffIowmfYv15j0WdzATWEZf2ZFowI+0Fvo3xpRRahjNq+rIGJCQV vAPlzcV82jPa+NdQYaj2WohV1jTkw6eERdrZiEbAh/oMZP9Q1BqX8sbLFAvZ1Pf/nfQb 9DfmfeUigh8S1XzL2UcnhLF5CHUW3UlDFof6zl0XT8fPZyx9Sqg7UjJYB2Aym3+2oM8T 0jUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IEH4XJor; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si10528652plj.247.2018.03.18.09.14.59; Sun, 18 Mar 2018 09:15:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IEH4XJor; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1754818AbeCRQNk (ORCPT + 99 others); Sun, 18 Mar 2018 12:13:40 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36403 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754127AbeCRQNc (ORCPT ); Sun, 18 Mar 2018 12:13:32 -0400 Received: by mail-wm0-f65.google.com with SMTP id n3so11243638wmd.1; Sun, 18 Mar 2018 09:13:31 -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:user-agent; bh=gXtqpedl4O3FChNYVf1kt7CAyyy5SD5kDx72yosEDrA=; b=IEH4XJoraLNwSaMqt24gDB1urOFDXecFnto7kLht/BLJEkuAM6gzJIrsapxhqUQcYg R9tGdBuoDVTGXy5AqnohmeASj3V335JlgOi3Nigfp/6Lk16pANyOkfRDofCxhfnKz0NJ 2v3nLQWDJ6xQbppW3UfZnVqnp1Ind4INqfNmuPorgzCh5Nde2enbf3HMfdzHywdscJ6o a63btpHMV23VDCCNqv2akov10XYOThldObXP1WvPp0BzefEMrI0GsdnOZtepVNuM0GTE kxfZioEqbiWWKg7IyBA02w8OOcuf3mBm9aIN106qCnvNoDe/pPETvaC4o5BviVfud+bR 8AIQ== 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:user-agent; bh=gXtqpedl4O3FChNYVf1kt7CAyyy5SD5kDx72yosEDrA=; b=W4YVsR1/N2hq58aC+Z2GiyjLSVpUWizIBems425PlLMdw3bSWoiwo1cNCyEWjVtH9e ZifHBvbmCml/pjkezQdT4zqR4J7+dcZR+B7OUPd8C7a78oRwE3Y1ZSnrYMr2N+2IARts Gu39Vlmk3uFiIBKQpzbBUNtZtEAsE060HWm3LrA1aa/zAub2gdc+ADTYmiamWqwCyLAZ Qgoeks+fWkBUTe7OmCcVEr9k1HUYruV+wOT2Ik3E/YkIUacst4H1Na+OuDyCt/gMUW0F GjLNLFlRhPxzq+hu6Ex8gng3lRXJDY0BL7nf9lff0pHsls9uOaDbQPJX/h+/4VxWmL1l fQvg== X-Gm-Message-State: AElRT7EisVfkIJBk4d1RxDNGZ8eolslbgjlKiuuuSrxgCCjSz1V5p3JV RMTmTWKQlYge/EhWQz8sgq8= X-Received: by 10.80.144.120 with SMTP id z53mr6734997edz.163.1521389610972; Sun, 18 Mar 2018 09:13:30 -0700 (PDT) Received: from ltop.local ([109.132.86.237]) by smtp.gmail.com with ESMTPSA id r2sm6427484edm.82.2018.03.18.09.13.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Mar 2018 09:13:30 -0700 (PDT) Date: Sun, 18 Mar 2018 17:13:27 +0100 From: Luc Van Oostenryck To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-ntb@googlegroups.com, linux-crypto@vger.kernel.org, Greg Kroah-Hartman , Arnd Bergmann , Andy Shevchenko , Horia =?utf-8?Q?Geant=C4=83?= , Thomas Gleixner , Philippe Ombredanne , Kate Stewart Subject: Re: [PATCH v12 1/9] iomap: Fix sparse endian check warnings Message-ID: <20180317190311.tdmx2vlcjttsjs5j@ltop.local> References: <20180316154852.13206-1-logang@deltatee.com> <20180316154852.13206-2-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180316154852.13206-2-logang@deltatee.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 16, 2018 at 09:48:44AM -0600, Logan Gunthorpe wrote: > Warnings of the form: > > lib/iomap.c:84:9: warning: cast to restricted __be16 > > Are found when running sparse checker with: > > make C=2 CF=-D__CHECK_ENDIAN__ > > This patch casts them with __force to suppress the warnings. Hi, it looks correct but if you should explain why the warning is not a valid one. Once done, you can then explain what problem you have fixed instead of saying you suppressed a warning. > Also, it looks like the wrong conversion function was used in I would suggest to split the patch in two since it does two different things which should have their own explanation. > diff --git a/lib/iomap.c b/lib/iomap.c > index 541d926da95e..a05d9fa21794 100644 > --- a/lib/iomap.c > +++ b/lib/iomap.c > @@ -106,8 +106,10 @@ EXPORT_SYMBOL(ioread32be); > #endif > > #ifndef mmio_write16be > -#define mmio_write16be(val,port) __raw_writew(be16_to_cpu(val),port) > -#define mmio_write32be(val,port) __raw_writel(be32_to_cpu(val),port) > +#define mmio_write16be(val, port) \ > + __raw_writew((u16 __force)cpu_to_be16(val), port) > +#define mmio_write32be(val, port) \ > + __raw_writel((u32 __force)cpu_to_be32(val), port) > #endif I think that in this sort of replacement, it's better to not split the lines (even if larger than 80, that's it). -- Luc Van Oostenryck