Received: by 10.213.65.68 with SMTP id h4csp869877imn; Thu, 22 Mar 2018 10:20:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELs033ROoNWIdFrH6mxCPjfVu6Z/yZAB+kFr928t4WfDt1c6aLs4wuu8vktw39o8+jPBxulf X-Received: by 10.99.96.79 with SMTP id u76mr17856620pgb.199.1521739205674; Thu, 22 Mar 2018 10:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521739205; cv=none; d=google.com; s=arc-20160816; b=08fdy1twBxCpQrmtcj9AUs2Hy6jaDoOc2pwqORHqwgrSSgZSaMII/SijAYr0uTeHZr hbltwoO3J+fpL/OK8FPj1TyUWcDNrKEybmOs3P6LW2qIBZwMhPdqimkZrRJqr+0GE8rZ dqdO3I3YFHmRHi9b5MHdLTdaDGKN66n0FcQQV8t9+DiP/gK5rirNM2N8Onb41Q534iy+ L5Mr0WC0JgkNwfAo91ZOBiNf/vCNWHvK6AYSXI8dDHYi5XF/brcAFMqsv/8vrWXjYCa3 RKrzNsDP5YLvuvnRr97qdvg0UWwZgv7OUj9r2/xLKigtlgSX1ij7JfKw0Ag6v9+IgtqD 68Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=MpUIUUYzk3Gx2lrMkQ5H44tPcxcFgXxyzvaVC6cQa0A=; b=wvpvfVB2pHjfohH0vy4MXZdro4Hfw+IqI+XhB6tYXBNqVOrZjsHe6kZVIh8ORrCjBo EqNO024/Gul4TKS+2aawqUNZaZ0Zx5uoQooJ908BbiNPTcD1U+m+HcprkzwM9khWAHEm VhNuIHmSEoAW40axsAcOezfzgFhDeehObdkuH9eQj5v1vJjNwvlS+K8pPQlRodafkYm7 OvwLjpHC57wUMF/evXWRAswyN6TrUAJK/WCxUZ9B7cGR1rvuFrjqiJ1R5PacqmCRPpcR Kv9rSCsmtAjjZ2Sq9J309OibiGXcTElgYI01CTOIK6DkeVaTp6sWef9Br8V6K+mKRmoj adeA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a90-v6si6570792plc.329.2018.03.22.10.19.50; Thu, 22 Mar 2018 10:20:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752346AbeCVRR0 (ORCPT + 99 others); Thu, 22 Mar 2018 13:17:26 -0400 Received: from ale.deltatee.com ([207.54.116.67]:35190 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751875AbeCVRRO (ORCPT ); Thu, 22 Mar 2018 13:17:14 -0400 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ez3ps-00073F-54; Thu, 22 Mar 2018 11:17:13 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1ez3pq-00018F-Ea; Thu, 22 Mar 2018 11:17:06 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-ntb@googlegroups.com, linux-crypto@vger.kernel.org, Greg Kroah-Hartman Cc: Arnd Bergmann , Andy Shevchenko , =?UTF-8?q?Horia=20Geant=C4=83?= , Logan Gunthorpe , Philippe Ombredanne , Thomas Gleixner , Kate Stewart Date: Thu, 22 Mar 2018 11:16:54 -0600 Message-Id: <20180322171703.4300-2-logang@deltatee.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180322171703.4300-1-logang@deltatee.com> References: <20180322171703.4300-1-logang@deltatee.com> X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-crypto@vger.kernel.org, arnd@arndb.de, andy.shevchenko@gmail.com, horia.geanta@nxp.com, logang@deltatee.com, pombredanne@nexb.com, tglx@linutronix.de, gregkh@linuxfoundation.org, kstewart@linuxfoundation.org X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_NO_TEXT,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 Subject: [PATCH v14 01/10] iomap: Use correct endian conversion function in mmio_writeXXbe X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The semantics of the iowriteXXbe() functions are to write a value in CPU endianess to an IO register that is known by the caller to be in Big Endian. The mmio_writeXXbe() macro, which is called by iowriteXXbe(), should therefore use cpu_to_beXX() instead of beXX_to_cpu(). Seeing both beXX_to_cpu() and cpu_to_beXX() are both functionally implemented as either null operations or swabXX operations there was no noticable bug here. But it is confusing for both developers and code analysis tools alike. Signed-off-by: Logan Gunthorpe Reviewed-by: Luc Van Oostenryck Reviewed-by: Andy Shevchenko Cc: Philippe Ombredanne Cc: Thomas Gleixner Cc: Kate Stewart Cc: Greg Kroah-Hartman --- lib/iomap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/iomap.c b/lib/iomap.c index 541d926da95e..be120c13d6cc 100644 --- a/lib/iomap.c +++ b/lib/iomap.c @@ -106,8 +106,8 @@ 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(cpu_to_be16(val),port) +#define mmio_write32be(val,port) __raw_writel(cpu_to_be32(val),port) #endif void iowrite8(u8 val, void __iomem *addr) -- 2.11.0