Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4136330pxb; Mon, 27 Sep 2021 10:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+awd69WDP50n3OjlAwF8NBROYGGJeFn0xi/KsopV08wuOgrhNDHnhW6og+CFPNYaFBzw6 X-Received: by 2002:a63:e408:: with SMTP id a8mr654654pgi.184.1632762451217; Mon, 27 Sep 2021 10:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632762451; cv=none; d=google.com; s=arc-20160816; b=rf8KlzglR7HwZPDa/xFMTketIC9U4HgAGramiiwcQuZm7ZFnMoGdD5EEIEDzPQOHgv cjF3VmNJ7xhh9rKUKxA1/fz4Ta6VznoM4PF14yAaQSyOb6ZZkfXUMwUqBwxDRyrdv3o/ hRZmC6G+SIKajhxnC6ACS7kubODY5RRKxnLwzwXd6quviA4dZEVSWSqMUhtzof2vnDm3 HhEcVB/BoqcCWOEktIEuAjdllMJoverXF4fmzLchTsyiyjpS9ipgIKHfgMFo17G86zbV edbMvuUiZkzgW0n+V0dLasTSu2kt5M9wJ9yTTM968pW+BzQkwQ0sxpjPcqpqOFrx4Dei HVGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Eeu1hhG/xF1WtW6HFtTAX+O07OarXxskOor2PRAsBWI=; b=kh3jxpLpE/yBZXqad0tCYSXPAJUBs3tt3Z7XYS1kfoIjJHf6+FcYxLh6at9lVjipk6 ABtFO+WmbmfJAaOqBCYPmljY08Rji23Wc63/TLDRvuCi+qHCGOgkuzK6qkjAN24kPT4Y hvsMfEXtAOQ6R04b0b46iDPhCVplyI+oOKu8p0/MNc9GJilO9x2/TTMsgoqQ0gxmA0B5 Nt4kDJk5eBuBkiA0gFYUFPEJsOdk+/EBpqGoz1IIO4WcO8xGbUYftBo955WRDBhUje7I 5Tf9z+fS+fa5xNqUUVXPAWFq27tQHnGh+emDEVx8N5dbLDg9uIaPs97tNya5WG2dlstB 6ssQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dG9UbJzF; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si23562341pff.297.2021.09.27.10.07.18; Mon, 27 Sep 2021 10:07:31 -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=@linuxfoundation.org header.s=korg header.b=dG9UbJzF; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235728AbhI0RH4 (ORCPT + 99 others); Mon, 27 Sep 2021 13:07:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:46862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236142AbhI0RHC (ORCPT ); Mon, 27 Sep 2021 13:07:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3ECB76113A; Mon, 27 Sep 2021 17:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632762324; bh=REvzRjJZWhz3Xxzra1Ur5t28/d5/o/FIKLKkIQVFzNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dG9UbJzF7Dx6shI4QaStZ1usOqflqdoOUn+yc0+WWf2EgfXgAcgX54Fp3U+v6vJbK rdkVoz5TI6cL8y1xgyS3Sa5/kmU0Bpph4ZLgX5tzVlxbRlh/MAg96VLxehyjAuxks0 F78DoxS9q0vle5GbrRLTze/DZhrBhzvgSFYMpDVs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guenter Roeck , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 5.4 48/68] m68k: Double cast io functions to unsigned long Date: Mon, 27 Sep 2021 19:02:44 +0200 Message-Id: <20210927170221.626097303@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210927170219.901812470@linuxfoundation.org> References: <20210927170219.901812470@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guenter Roeck [ Upstream commit b1a89856fbf63fffde6a4771d8f1ac21df549e50 ] m68k builds fail widely with errors such as arch/m68k/include/asm/raw_io.h:20:19: error: cast to pointer from integer of different size arch/m68k/include/asm/raw_io.h:30:32: error: cast to pointer from integer of different size [-Werror=int-to-p On m68k, io functions are defined as macros. The problem is seen if the macro parameter variable size differs from the size of a pointer. Cast the parameter of all io macros to unsigned long before casting it to a pointer to fix the problem. Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20210907060729.2391992-1-linux@roeck-us.net Signed-off-by: Geert Uytterhoeven Signed-off-by: Sasha Levin --- arch/m68k/include/asm/raw_io.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/m68k/include/asm/raw_io.h b/arch/m68k/include/asm/raw_io.h index 8a6dc6e5a279..8ab3c350bd53 100644 --- a/arch/m68k/include/asm/raw_io.h +++ b/arch/m68k/include/asm/raw_io.h @@ -17,21 +17,21 @@ * two accesses to memory, which may be undesirable for some devices. */ #define in_8(addr) \ - ({ u8 __v = (*(__force volatile u8 *) (addr)); __v; }) + ({ u8 __v = (*(__force volatile u8 *) (unsigned long)(addr)); __v; }) #define in_be16(addr) \ - ({ u16 __v = (*(__force volatile u16 *) (addr)); __v; }) + ({ u16 __v = (*(__force volatile u16 *) (unsigned long)(addr)); __v; }) #define in_be32(addr) \ - ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; }) + ({ u32 __v = (*(__force volatile u32 *) (unsigned long)(addr)); __v; }) #define in_le16(addr) \ - ({ u16 __v = le16_to_cpu(*(__force volatile __le16 *) (addr)); __v; }) + ({ u16 __v = le16_to_cpu(*(__force volatile __le16 *) (unsigned long)(addr)); __v; }) #define in_le32(addr) \ - ({ u32 __v = le32_to_cpu(*(__force volatile __le32 *) (addr)); __v; }) + ({ u32 __v = le32_to_cpu(*(__force volatile __le32 *) (unsigned long)(addr)); __v; }) -#define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b)) -#define out_be16(addr,w) (void)((*(__force volatile u16 *) (addr)) = (w)) -#define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l)) -#define out_le16(addr,w) (void)((*(__force volatile __le16 *) (addr)) = cpu_to_le16(w)) -#define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l)) +#define out_8(addr,b) (void)((*(__force volatile u8 *) (unsigned long)(addr)) = (b)) +#define out_be16(addr,w) (void)((*(__force volatile u16 *) (unsigned long)(addr)) = (w)) +#define out_be32(addr,l) (void)((*(__force volatile u32 *) (unsigned long)(addr)) = (l)) +#define out_le16(addr,w) (void)((*(__force volatile __le16 *) (unsigned long)(addr)) = cpu_to_le16(w)) +#define out_le32(addr,l) (void)((*(__force volatile __le32 *) (unsigned long)(addr)) = cpu_to_le32(l)) #define raw_inb in_8 #define raw_inw in_be16 -- 2.33.0