From patchwork Thu Nov 17 03:59:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Joseph, Jithu" X-Patchwork-Id: 13046087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBB17C4332F for ; Thu, 17 Nov 2022 04:01:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239031AbiKQEBE (ORCPT ); Wed, 16 Nov 2022 23:01:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234166AbiKQEA6 (ORCPT ); Wed, 16 Nov 2022 23:00:58 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5ECD4B9B4; Wed, 16 Nov 2022 20:00:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668657657; x=1700193657; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1Q7q9SYTSkxYvurKzNkkvKbiCwfQrCh38SJ8ljQixJM=; b=iCCuZlZBslgl1lFualFwTk2vGLec9DxTTJgVD6TXzUewdXh15OwB50sL royCDr8sKXJpqE94QIjeLK/BGiJDM86rbbyq9Bl3wQJDVXXVx3+oYSWs7 Zw0dqzeGdOC6wydZLOpFGDHCvgwuOopRTEnFy+jsleP6tYj2LQiWCxg91 Hia/9e5yfDQEDzkhVjFRr6aa9JdB7OXRfanQPKN69LAW0Nu/ombvbJw5I LkqFCNSLbSCrzt0KRFldMDTXYx1p1RAC8jQHT/f7fTeG6FbUovosisxHt v3D53W29FHwk7VqePaTQlEsGWrec/kA40TKYThGN54wUMKrrgn4YQL/a7 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="292455963" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="292455963" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 20:00:57 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="590462683" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="590462683" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 20:00:57 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 06/16] x86/microcode/intel: Use appropriate type in microcode_sanity_check() Date: Wed, 16 Nov 2022 19:59:25 -0800 Message-Id: <20221117035935.4136738-7-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221117035935.4136738-1-jithu.joseph@intel.com> References: <20221107225323.2733518-1-jithu.joseph@intel.com> <20221117035935.4136738-1-jithu.joseph@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org The data type of print_err parameter used by microcode_sanity_check() is int. In preparation for exporting this function, to be used by the IFS driver, convert it to a more appropriate bool type for readability. No functional change intended. Reviewed-by: Tony Luck Reviewed-by: Ashok Raj Reviewed-by: Sohil Mehta Suggested-by: Tony Luck Signed-off-by: Jithu Joseph --- arch/x86/kernel/cpu/microcode/intel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index 4e611a708718..234b163806ea 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -135,7 +135,7 @@ static void save_microcode_patch(struct ucode_cpu_info *uci, void *data, unsigne intel_ucode_patch = p->data; } -static int microcode_sanity_check(void *mc, int print_err) +static int microcode_sanity_check(void *mc, bool print_err) { unsigned long total_size, data_size, ext_table_size; struct microcode_header_intel *mc_header = mc; @@ -253,7 +253,7 @@ scan_microcode(void *data, size_t size, struct ucode_cpu_info *uci, bool save) mc_size = get_totalsize(mc_header); if (!mc_size || mc_size > size || - microcode_sanity_check(data, 0) < 0) + microcode_sanity_check(data, false) < 0) break; size -= mc_size; @@ -792,7 +792,7 @@ static enum ucode_state generic_load_microcode(int cpu, struct iov_iter *iter) memcpy(mc, &mc_header, sizeof(mc_header)); data = mc + sizeof(mc_header); if (!copy_from_iter_full(data, data_size, iter) || - microcode_sanity_check(mc, 1) < 0) { + microcode_sanity_check(mc, true) < 0) { break; }