Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1546227pxb; Fri, 18 Feb 2022 09:58:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLJ2XzDpn4fPvnG9ThQNDs1G2ITkb8QU3nF4wNW3htv1wp58fh6SaWBCur+Sqs9jhKz0AK X-Received: by 2002:a50:e081:0:b0:401:8823:c9a8 with SMTP id f1-20020a50e081000000b004018823c9a8mr9377901edl.401.1645207088579; Fri, 18 Feb 2022 09:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645207088; cv=none; d=google.com; s=arc-20160816; b=VXtNPmCI54OLWX4iMM47/ENOujDdftCod26RxDkvi8AqhtSWYA45FAEjfuJPOplwsI TFw5qqwcJ8oWkkpmhGl5enPbBQe8PX2lDDL7IjQixlyVY7dcIjWlfqt7a31lrZvgKR1j 2QsGYWzGqNXDti0j3sPqjqyRUbppIu6BlYyQvRMjQwKf9UAHxXjEftIwENxMfmRg385y 96y7wsWp+moB7yP/RQkOYz5200ESSKrPrh+fgShv41vtTh6II0cqEr1xYztrPWLo+QxZ qGVvb5FNZC1/uXKkzwCgWmDog0Xa0SIv2s6ooND+EOiE7x0LM11huszecL2buw7p1M1p ANpw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hiy1hYE+AqBW6PUH3y/yLRLWfbtN2K0i2d+348hntk4=; b=gczgQf2Vf2PbZP2if4Bj+rPeJsjCPUv1uaDOwquj+MTQsfTz9Y4gI5+08li8H/54TS kbtn1J+fxQRz9V7yaL+9hp/iUt0F0fHLQ7QBDmSfe/ihMGjnf3rkeapdhTxMOwwLKKy6 nStahPgxt/qhtqIchZC7BHe7AQ0U/NYn3OVAsfYKZv9kOodSiqBlfWgwVoDduzOReIGT S+HAya2k1QO01FErg1HeUQO5QY0oiLRqbjZoa8oGbc5LDmQwXaumA45iIntQ0QTs2tAj gzrUVqbBE6DTrGcHHs6EPo3Yz968ypgRTcYPofOSrTY9TitR/KBH6HC5FT6UGqKMrXCo Ibjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dHEnAqda; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hj1si5493582ejc.934.2022.02.18.09.57.44; Fri, 18 Feb 2022 09:58:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dHEnAqda; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237778AbiBRQST (ORCPT + 99 others); Fri, 18 Feb 2022 11:18:19 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237582AbiBRQRk (ORCPT ); Fri, 18 Feb 2022 11:17:40 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D95C02AE32 for ; Fri, 18 Feb 2022 08:17:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645201040; x=1676737040; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YLRcyqnwpgSRCqcWi/554Dc1Exapi/lSv6TTC7rFRfU=; b=dHEnAqdapHgtH0W1wZMGipY/ezP32/ZI+jZahZdP+mTHi6ZTN8FsE0Zi PjSj2GHy0tM4wmv+HLF0QK1BS1nKrJPDceQGtN1KNfRMdPuzcXuzls4Nf OwTX56g4VA6e6tPj6lW6R8pue5gqYt7PWkb2FsekVEZZyFcBrE3ucpAj5 HPACfEtsIATjcchi7NIe04Yw5Gihcm/GkGLABgKJeKKqyEYkq6DIGo387 HsYezYY1TGLIHIpp6crlSvYQbfS3E8sYD8jWAYNsc24WgmWtjbliXMEpd QxW3rO5k3wBuMNQt2rQNg+exqF0vab/2QWRagiJCy5ZiukDCL3kzYEWTs A==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="238559698" X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="238559698" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2022 08:17:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="626675640" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 18 Feb 2022 08:17:13 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id B11ACA30; Fri, 18 Feb 2022 18:17:22 +0200 (EET) From: "Kirill A. Shutemov" To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@intel.com, luto@kernel.org, peterz@infradead.org Cc: sathyanarayanan.kuppuswamy@linux.intel.com, aarcange@redhat.com, ak@linux.intel.com, dan.j.williams@intel.com, david@redhat.com, hpa@zytor.com, jgross@suse.com, jmattson@google.com, joro@8bytes.org, jpoimboe@redhat.com, knsathya@kernel.org, pbonzini@redhat.com, sdeep@vmware.com, seanjc@google.com, tony.luck@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, x86@kernel.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv3 14/32] x86: Adjust types used in port I/O helpers Date: Fri, 18 Feb 2022 19:17:00 +0300 Message-Id: <20220218161718.67148-15-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220218161718.67148-1-kirill.shutemov@linux.intel.com> References: <20220218161718.67148-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change port I/O helpers to use u8/u16/u32 instead of unsigned char/short/int for values. Use u16 instead of int for port number. It aligns the helpers with implementation in boot stub in preparation for consolidation. Signed-off-by: Kirill A. Shutemov --- arch/x86/include/asm/io.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index f6d91ecb8026..638c1a2a82e0 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -258,37 +258,37 @@ static inline void slow_down_io(void) #endif #define BUILDIO(bwl, bw, type) \ -static inline void out##bwl(unsigned type value, int port) \ +static inline void out##bwl(type value, u16 port) \ { \ asm volatile("out" #bwl " %" #bw "0, %w1" \ : : "a"(value), "Nd"(port)); \ } \ \ -static inline unsigned type in##bwl(int port) \ +static inline type in##bwl(u16 port) \ { \ - unsigned type value; \ + type value; \ asm volatile("in" #bwl " %w1, %" #bw "0" \ : "=a"(value) : "Nd"(port)); \ return value; \ } \ \ -static inline void out##bwl##_p(unsigned type value, int port) \ +static inline void out##bwl##_p(type value, u16 port) \ { \ out##bwl(value, port); \ slow_down_io(); \ } \ \ -static inline unsigned type in##bwl##_p(int port) \ +static inline type in##bwl##_p(u16 port) \ { \ - unsigned type value = in##bwl(port); \ + type value = in##bwl(port); \ slow_down_io(); \ return value; \ } \ \ -static inline void outs##bwl(int port, const void *addr, unsigned long count) \ +static inline void outs##bwl(u16 port, const void *addr, unsigned long count) \ { \ if (cc_platform_has(CC_ATTR_GUEST_UNROLL_STRING_IO)) { \ - unsigned type *value = (unsigned type *)addr; \ + type *value = (type *)addr; \ while (count) { \ out##bwl(*value, port); \ value++; \ @@ -301,10 +301,10 @@ static inline void outs##bwl(int port, const void *addr, unsigned long count) \ } \ } \ \ -static inline void ins##bwl(int port, void *addr, unsigned long count) \ +static inline void ins##bwl(u16 port, void *addr, unsigned long count) \ { \ if (cc_platform_has(CC_ATTR_GUEST_UNROLL_STRING_IO)) { \ - unsigned type *value = (unsigned type *)addr; \ + type *value = (type *)addr; \ while (count) { \ *value = in##bwl(port); \ value++; \ @@ -317,9 +317,9 @@ static inline void ins##bwl(int port, void *addr, unsigned long count) \ } \ } -BUILDIO(b, b, char) -BUILDIO(w, w, short) -BUILDIO(l, , int) +BUILDIO(b, b, u8) +BUILDIO(w, w, u16) +BUILDIO(l, , u32) #define inb inb #define inw inw -- 2.34.1