Received: by 10.213.65.68 with SMTP id h4csp1397279imn; Wed, 21 Mar 2018 09:40:38 -0700 (PDT) X-Google-Smtp-Source: AG47ELu2IWyK+SuScRM2sSDndVNRgyQKDAmjp3A/w4VQtOXyAS33jWX/FK3/AOM1+Rnijr6PuH6n X-Received: by 2002:a17:902:8c8c:: with SMTP id t12-v6mr11042022plo.100.1521650438757; Wed, 21 Mar 2018 09:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521650438; cv=none; d=google.com; s=arc-20160816; b=lOtYEKOOzVPwCQVCwjq0L4MY9KwSxAchmsopW07D7PgL/VovdhcE6vBEJIosqfH9kO 3kuS5dGVrEe+CMjFIQsrwp8PcMil+48xgQjeTHc76Hvn6TGeoz2iqnT84eHItUeL5EFf xDBWspJdhWR5ZFTUNI/kk2V3HBB8kfeVR3pZRBD25Hj0rS1oNQupcWm4v5OeYaEmXIod Y8KhvLzYWK1Wgx+aRN4a1Gzv52HiODxZ4h5W0d1WpZi4LMpM6WUHLe83f+XG32dmB3x8 CbznPvPOUQ3BYpnZrz884kEtM0lKSJpHeV6J+zRQKdR4LRkPSxMUM7U8wsyyirCmI9Aj AiHQ== 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=zDd0dHsxvzmOzIsed0VBOVMeur4YS3i3EI50exLRTlY=; b=Kv+fj5RfKxAPJIuua9NmLL9ZBwzaeAiOReBDuo28xKqmUr+FnOxVzQpQjjqcnbMbVG gEPCTWgBzvzHXLvLipDWfC2nS/4pZ1em8OSErVNkxqBy70FjBTZnexxsVEgeAr+kr8yy iOs1Smku2jqr9lWJj4iiLd0n+nxwGdnpkcXSWISYu6YsnsA/jGhVwYX9Z1Z6EgspdJ+u W0+uEGO/YI7e3PWIBkfPTEyYlFi02v1SfM+Bs2MeTANDCn1id7M7Mdt7Zy4qOGV4FRnI M9a9+PwQ34CooNpTwYAiK3FaAnvWzk/I6wDKdxBPQoYsdfSNqsYT1dprdD8Yu4JYSGEW Ah5g== 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 p3si3149784pfh.84.2018.03.21.09.40.24; Wed, 21 Mar 2018 09:40:38 -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 S1752972AbeCUQiF (ORCPT + 99 others); Wed, 21 Mar 2018 12:38:05 -0400 Received: from ale.deltatee.com ([207.54.116.67]:56584 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752859AbeCUQhz (ORCPT ); Wed, 21 Mar 2018 12:37:55 -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 1eygkJ-0007Vy-2I; Wed, 21 Mar 2018 10:37:53 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1eygkG-0003D3-9v; Wed, 21 Mar 2018 10:37:48 -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 , Luc Van Oostenryck Date: Wed, 21 Mar 2018 10:37:36 -0600 Message-Id: <20180321163745.12286-2-logang@deltatee.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180321163745.12286-1-logang@deltatee.com> References: <20180321163745.12286-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, horia.geanta@nxp.com, logang@deltatee.com, pombredanne@nexb.com, tglx@linutronix.de, gregkh@linuxfoundation.org, kstewart@linuxfoundation.org, andy.shevchenko@gmail.com, luc.vanoostenryck@gmail.com 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=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT,T_RP_MATCHES_RCVD autolearn=no autolearn_force=no version=3.4.1 Subject: [PATCH v13 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 Cc: Philippe Ombredanne Cc: Thomas Gleixner Cc: Kate Stewart Cc: Greg Kroah-Hartman Cc: Luc Van Oostenryck --- 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