Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1554547rwb; Wed, 16 Nov 2022 20:53:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf67RXoDdiJbcfxsJIBcr9lswFJ+zO3cCyLHBXQqa2mUktDnVjWqCY5Cvm6W6Qh/l3zbGrRB X-Received: by 2002:a17:907:3117:b0:7ae:6746:f26b with SMTP id wl23-20020a170907311700b007ae6746f26bmr772117ejb.171.1668660815762; Wed, 16 Nov 2022 20:53:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668660815; cv=none; d=google.com; s=arc-20160816; b=gXC5U4oA2ZfwxOmdyqdr784rrE0+5a3Mx3t6JaVMv9FWGKGiFVmk+loFIQfOpBVaYb yCq2sggDyqSG5HNtYYkYxa/GchoaWAzSsxu/TWptDM60DWrPdfP+aZ6R4yhsxNQQj3cJ ybAhgJCWe76d7Jv37U7xlgPBbc4EcpYx9PvpoEc5fuT6UxfL1FoFX4mPBebN8uc0EFpK 62gYT7NkjNU2FpzPreZtVAnErKegmWBHbUnuxetq0me2YnCzUEBxZ7RiKmGf6xCXW4UF VLeOwXJqVJ3/NiAFGIDKRkEJgtKfN33gv5+6k83wPdOC+MWQXBuT2K1gzV7/0ikFDhQB hsPg== 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=A1MHwicPxTeVfsK9+/Vobf+UEGpsG2ztDPOxuotNPTg=; b=mNIww8fYbuiRmKpEe89q4XxSc5sX7GWrc7/8BoCZOkKssMKGNQ7nZ4dayhBJ4tfd9g DgDnY2nxlrvSeGS0tUmpEWZkkbKzUXGDKJbiXToQxSGMzkSeiQrhOPvnMDn+hrtB2JFh Lmo0te+5AAHIriQjBio95X9PemDvAujbWZbN42IhbrBdIxdhXiJA1Cneg8w/AGqSMYL7 Yd8dz9pj5C5tfBo4V0m5wbU4kVE7YKIc/tldaMMqbPkKZz34zPkbNPOadefHd1YbiCs2 ZBSdBtYGA4rWdkVZXUsNsB73l9xsf4wFx6AIx2MPJ1mNqe1SlvviNabI2hyX8tY8faob h+kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iCCuZlZB; 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 q28-20020a056402249c00b00463f8aad371si49498eda.239.2022.11.16.20.53.12; Wed, 16 Nov 2022 20:53:35 -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=iCCuZlZB; 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 S233502AbiKQEBk (ORCPT + 90 others); Wed, 16 Nov 2022 23:01:40 -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 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_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE 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 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