Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1751483pxm; Thu, 24 Feb 2022 08:42:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyn+yUmUKHR9Ty5lD23WbzP91eYf/bgDrRiyiqkMHg4i8qt0xEsaIA9C9Zv2L0lRhcool2L X-Received: by 2002:a17:90a:a087:b0:1b9:157f:4cc1 with SMTP id r7-20020a17090aa08700b001b9157f4cc1mr3647426pjp.117.1645720943054; Thu, 24 Feb 2022 08:42:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645720943; cv=none; d=google.com; s=arc-20160816; b=vgysP0X4y2UK1z7kJxy2auamidv8tqjxAT22jhG1ytOXwboKadHHwUcAm7NhhfiUYm LhZwxPE9+PeoWe5bvMubPP40kTGcpMTALUEMGfI9bS73mh00HixiHiPoad8XKBjN8dwc REgZzQVNuOTKDrIKxe7Qkrek5yQfCnLu8a/HmcVJSzW4qDWvexUxib7zncWY6He5VSuB XKcFujxCQ1GA/Q41UBIIDldsQoDxp+HAWIasusWZcPqGAcR8BDbK3dCqm8xCcfjZ1AHn oE5ZxtcB2wLkHqJL1u5vavxEPcgssqMmaRgocHvcglx0QnikcIvyPHmA0pBqFcT0G7WZ 5ZbA== 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=f6SQpRkQYdlvBlDckUaQpKsvpcusRwIcG6XNFKA69FerGdIjeUUMtyKJsEQsfqhfEa M/WXGU23xP2nutxxk0jLfiwzMMHOWnZ8H0raQfrv4eQUE4aGrXMacGxHFRLrZM5SaUpP Lnp3QCFuN2Pln/f9NDbjeYUdGU/im9p0Eou3OTYSGkpWKQygbOp9UcGKFlm15xE7yPi7 T2SSHsG/dJMMUGQT/ANwnxl+2gXx2JaWbnrXH8b8IZXieAyhJhngKpF1TeSQqRlFf0bg nRUIQKk9fKL/NdWnNvFqBseBiOvNy/1whJL9WqM4v1IMcfd8Hrtqx7SQNwYmqzLABShe cbww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NCCx4kGD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m26si3416584pgd.252.2022.02.24.08.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:42:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NCCx4kGD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1FB971768C0; Thu, 24 Feb 2022 08:22:12 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236886AbiBXP5u (ORCPT + 99 others); Thu, 24 Feb 2022 10:57:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236722AbiBXP5P (ORCPT ); Thu, 24 Feb 2022 10:57:15 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EBC912AB9 for ; Thu, 24 Feb 2022 07:56:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645718198; x=1677254198; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YLRcyqnwpgSRCqcWi/554Dc1Exapi/lSv6TTC7rFRfU=; b=NCCx4kGDZ8i5wLzY5z1y0AzOdxZ1PMxFE5Kt/Y7+QUm8osDNg15y9ZRj 2thigD4f+6W+sVwERAdXphypefivjZjL3Fk/RUS6EM4Q5DE3f2RfDB9Cy dIjjjzGLvCE6M0j3xXHY5osXSCvkjnvTr74j4ltAzy8Bpo3ylUdEkEFi7 +akf40Qc767YfPN3HMqjuwIcdr+ABlRA4cnVQP/XwFe0bC+iBNlbVNDSL MVliHyOY0i55AwxYq+QlS2y3x4vO5dy7v+9GF0G8obcSdVR2vuNBefzCz hKhf2kb0TlXiuZNcLM+tOZmWEo6swhwJ0edBW7V9/WWhseHnI6apE+qfS g==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="235773407" X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="235773407" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 07:56:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="684315440" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 24 Feb 2022 07:56:25 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id CE8A4A3F; Thu, 24 Feb 2022 17:56:34 +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, thomas.lendacky@amd.com, brijesh.singh@amd.com, x86@kernel.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv4 13/30] x86: Adjust types used in port I/O helpers Date: Thu, 24 Feb 2022 18:56:13 +0300 Message-Id: <20220224155630.52734-14-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220224155630.52734-1-kirill.shutemov@linux.intel.com> References: <20220224155630.52734-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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