From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51E6EC433DF for ; Thu, 20 Aug 2020 00:07:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DADD207FB for ; Thu, 20 Aug 2020 00:07:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597882038; bh=XIIXTbt/QIRGAo/NW8dnaqnoj6NT/0V7mQ4/PLFvF3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ysP6c/HdE7AdVjb0NSngz0L3VIN9TS/iah1pkfscab0AcYIBywc2t4qdt+KqTsbub Z6hjumtPisdaZ48xApZZ01qwYIOG07F64t5BkXJlPO11hwzrcaqRa4IiuPLqjyOG0Q sKcH7RGkh++kUSte4nmJunXymx1mfAaGyuDmbaGM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728415AbgHTAHQ (ORCPT ); Wed, 19 Aug 2020 20:07:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:33080 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728270AbgHTAD0 (ORCPT ); Wed, 19 Aug 2020 20:03:26 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B2C14221E2; Thu, 20 Aug 2020 00:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597881806; bh=XIIXTbt/QIRGAo/NW8dnaqnoj6NT/0V7mQ4/PLFvF3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ffBVLl3VbPxa/lCViNfIaTnrM48WeIdoV2D0K3M1n1dN7ByPc+oZDnvvUU2Rb2nep BxyvuoWd7dLfVa2Etu1SamTk5xQkSqwzSZDDVtXWlxC+5wLDqw1YCmH0Ti1Z3wbiWW 0iDQrI17BqQuBVl201TGLF9cv4KH90NL4fHro6Vo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luc Van Oostenryck , kernel test robot , Andrew Morton , Richard Henderson , Ivan Kokshaysky , Matt Turner , Stephen Boyd , Arnd Bergmann , Linus Torvalds , Sasha Levin , linux-alpha@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 17/18] alpha: fix annotation of io{read,write}{16,32}be() Date: Wed, 19 Aug 2020 20:03:00 -0400 Message-Id: <20200820000302.215560-17-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200820000302.215560-1-sashal@kernel.org> References: <20200820000302.215560-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luc Van Oostenryck [ Upstream commit bd72866b8da499e60633ff28f8a4f6e09ca78efe ] These accessors must be used to read/write a big-endian bus. The value returned or written is native-endian. However, these accessors are defined using be{16,32}_to_cpu() or cpu_to_be{16,32}() to make the endian conversion but these expect a __be{16,32} when none is present. Keeping them would need a force cast that would solve nothing at all. So, do the conversion using swab{16,32}, like done in asm-generic for similar situations. Reported-by: kernel test robot Signed-off-by: Luc Van Oostenryck Signed-off-by: Andrew Morton Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Stephen Boyd Cc: Arnd Bergmann Link: http://lkml.kernel.org/r/20200622114232.80039-1-luc.vanoostenryck@gmail.com Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- arch/alpha/include/asm/io.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index eb09d5aee9106..0bba9e991189d 100644 --- a/arch/alpha/include/asm/io.h +++ b/arch/alpha/include/asm/io.h @@ -507,10 +507,10 @@ extern inline void writeq(u64 b, volatile void __iomem *addr) } #endif -#define ioread16be(p) be16_to_cpu(ioread16(p)) -#define ioread32be(p) be32_to_cpu(ioread32(p)) -#define iowrite16be(v,p) iowrite16(cpu_to_be16(v), (p)) -#define iowrite32be(v,p) iowrite32(cpu_to_be32(v), (p)) +#define ioread16be(p) swab16(ioread16(p)) +#define ioread32be(p) swab32(ioread32(p)) +#define iowrite16be(v,p) iowrite16(swab16(v), (p)) +#define iowrite32be(v,p) iowrite32(swab32(v), (p)) #define inb_p inb #define inw_p inw -- 2.25.1