]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/microcode/intel: Use appropriate type in microcode_sanity_check()
authorJithu Joseph <jithu.joseph@intel.com>
Thu, 17 Nov 2022 03:59:25 +0000 (19:59 -0800)
committerBorislav Petkov <bp@suse.de>
Fri, 18 Nov 2022 20:51:56 +0000 (21:51 +0100)
The data type of the @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.

Suggested-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>
Link: https://lore.kernel.org/r/20221117035935.4136738-7-jithu.joseph@intel.com
arch/x86/kernel/cpu/microcode/intel.c

index c77ec1ba6844de2fb8b1831b88c844966b43c1c5..e48f05ec15aad356f50c689f0f496539bfaf201b 100644 (file)
@@ -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;
                }