Received: by 10.223.185.116 with SMTP id b49csp3885876wrg; Tue, 13 Feb 2018 09:11:39 -0800 (PST) X-Google-Smtp-Source: AH8x226VTHWk00t7Wi/4Qs9WlNfzNIG4hqJHx44tWCNNx9juFtBJLnaESho5ADvGVAFdSCgUZnZu X-Received: by 2002:a17:902:aa95:: with SMTP id d21-v6mr1775842plr.16.1518541899718; Tue, 13 Feb 2018 09:11:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518541899; cv=none; d=google.com; s=arc-20160816; b=DbKh3R53sKoIdCxwjXQhsQVJxPqV/xaVOvq9/1o7PtR5QEV+wfZhzukO71CPqwqRcN WVqnBD9TXi/ZFVet2iNxZn7bal10EPOHf1tkwBOa+SsPUrrJZgCZcqO8DFQepXzH52Zp dGD9IzVBYFeroAGcpWkWMO9tihDkABxOJNnuZpx3olZntspH/VoF0H7jrVrpgaNHzIUr erMYkajSzgR1BXNL6ZzgJGqykriJB5+HfgWvLeqMOhxsnmZXcqadcvpJi9/7Ns3wwdiM BmGLjT+RtLRE+dIuoMTUQX+KU2+TDbV1RxL0oI2khiphKHh8lZcTWPuSVtTA+rMFaux8 UlnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=4DfvJLK9aJ/l0moitiPdmC0q/hsqTVq/uIBGK7r0nH0=; b=n5DOUk2AdJpX3te0Il2OxQkBPAXJ+qhAAK7Zpml3GFga5mEnOZBAvcTZkm9hAGrt8O jokM/iZe6ujvhXKgGVOf78fi/yBGWLQwFOiHgLOhF2pvYnNDrX46NV7EEzJHQWKWN8UO HWRY7pU38ifVmGMFzEnS3cLPcffKIKwUEjmk/hl050F4y1mKJrPkNtGqDfUYp/iooWXi CJ6Mq8mDH/UKd/ZoDJ3Olr/qkgG/6Jb0W0fvncrsJL4gYc8ltby7H/gc84MGZ29mSRxA cajH1M/s4NR4PLJZ0jNClWppB4Jecsc8m4ZkbacILg9TvFgJ7vRfg+8n+0E2C74HCs2j HSmg== 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 z100-v6si2338409plh.129.2018.02.13.09.11.24; Tue, 13 Feb 2018 09:11:39 -0800 (PST) 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 S935001AbeBMRJd (ORCPT + 99 others); Tue, 13 Feb 2018 12:09:33 -0500 Received: from terminus.zytor.com ([198.137.202.136]:42691 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934657AbeBMRJb (ORCPT ); Tue, 13 Feb 2018 12:09:31 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1DGw6rX005950; Tue, 13 Feb 2018 08:58:06 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1DGw3Hx005946; Tue, 13 Feb 2018 08:58:03 -0800 Date: Tue, 13 Feb 2018 08:58:03 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Andy Shevchenko Message-ID: Cc: andriy.shevchenko@linux.intel.com, peterz@infradead.org, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, lkp@intel.com, sohil.mehta@intel.com, mitake@dcl.info.waseda.ac.jp Reply-To: andriy.shevchenko@linux.intel.com, hpa@zytor.com, peterz@infradead.org, tglx@linutronix.de, mingo@kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, lkp@intel.com, sohil.mehta@intel.com, mitake@dcl.info.waseda.ac.jp In-Reply-To: <20180119143322.16555-1-andriy.shevchenko@linux.intel.com> References: <20180119143322.16555-1-andriy.shevchenko@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/io: Define readq()/writeq() to use 64-bit type Git-Commit-ID: 0fc8483b698620ea3d8cc6635b54eccc613c23a3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0fc8483b698620ea3d8cc6635b54eccc613c23a3 Gitweb: https://git.kernel.org/tip/0fc8483b698620ea3d8cc6635b54eccc613c23a3 Author: Andy Shevchenko AuthorDate: Fri, 19 Jan 2018 16:33:22 +0200 Committer: Ingo Molnar CommitDate: Tue, 13 Feb 2018 17:14:41 +0100 x86/io: Define readq()/writeq() to use 64-bit type Since non atomic readq() and writeq() were added some of the drivers would like to use it in a manner of: #include ... pr_debug("Debug value of some register: %016llx\n", readq(addr)); However, lo_hi_readq() always returns __u64 data, while readq() on x86_64 defines it as unsigned long. and thus compiler warns about type mismatch, although they are both 64-bit on x86_64. Convert readq() and writeq() on x86 to operate on deterministic 64-bit type. The most of architectures in the kernel already are using either unsigned long long, or u64 type for readq() / writeq(). This change propagates consistency in that sense. While this is not an issue per se, though if someone wants to address it, the anchor could be the commit 797a796a13df ("asm-generic: architecture independent readq/writeq for 32bit environment") where non-atomic variants had been introduced. Note, there are only few users of above pattern and they will not be affected because they do cast returned value. The actual warning has been issued on not-yet-upstreamed code. Potentially we might get a new warnings if some 64-bit only code assigns returned value to unsigned long type of variable. This is assumed to be addressed on case-by-case basis. Reported-by: lkp Tested-by: Sohil Mehta Signed-off-by: Andy Shevchenko Cc: Hitoshi Mitake Cc: Linus Torvalds Cc: Mehta, Sohil Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180119143322.16555-1-andriy.shevchenko@linux.intel.com Signed-off-by: Ingo Molnar --- arch/x86/include/asm/io.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 95e9486..365f5ba 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -94,10 +94,10 @@ build_mmio_write(__writel, "l", unsigned int, "r", ) #ifdef CONFIG_X86_64 -build_mmio_read(readq, "q", unsigned long, "=r", :"memory") -build_mmio_read(__readq, "q", unsigned long, "=r", ) -build_mmio_write(writeq, "q", unsigned long, "r", :"memory") -build_mmio_write(__writeq, "q", unsigned long, "r", ) +build_mmio_read(readq, "q", unsigned long long, "=r", :"memory") +build_mmio_read(__readq, "q", unsigned long long, "=r", ) +build_mmio_write(writeq, "q", unsigned long long, "r", :"memory") +build_mmio_write(__writeq, "q", unsigned long long, "r", ) #define readq_relaxed(a) __readq(a) #define writeq_relaxed(v, a) __writeq(v, a)