From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C0F517D8 for ; Thu, 17 Nov 2022 04:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668657663; x=1700193663; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1Q7q9SYTSkxYvurKzNkkvKbiCwfQrCh38SJ8ljQixJM=; b=jDDyKIheRDrJB2I17p06JkgH42RP++pOI5n7veTGCedG/ZZ/t2nrlzMK h44K+ha/qL9f8Hrb0H/S2nFLHnbU8Vy3q8ROG0/bmcW9Hzp3t1QDnBtSW C680P7OHrx2Y88VfVscKD1F692Dg/y7wB5NJbWUMnAyfaZxGtOqnykX96 sU/2vCZr/sbpdjfHlTl/gA1S1sTQusmIRbZv30H3w3rsjllOpB6s79Lrh qhMWsdX18vP0yxS7JC3mFzLSW/we/SBAiskylrQaPXMRoKzmlex7xDEja R53AM4SmZgjlIKq3oxICSt3WC+eM5WjfuxhNyg70lmPwoTyQzyxyCwNYE A==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="399038894" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="399038894" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.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> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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; } -- 2.25.1