diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-03 13:12:30 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-03 13:12:30 +0200 |
commit | cb1c42020e8ac70cceb52f3c573ed7256196b9ed (patch) | |
tree | fe6de4863b6ae5ae6bf97cab40732fee108d514d | |
parent | cce81eac7fd0852d96ce0ce62cbe8f2b76d227f5 (diff) | |
parent | b59fcf495df52d06ab9a6487ed944618e155f57b (diff) | |
download | patches-cb1c42020e8ac70cceb52f3c573ed7256196b9ed.tar.gz |
Merge branch 'master' of gitolite.kernel.org:/pub/scm/linux/kernel/git/gregkh/patches
-rw-r--r-- | 0001-x86-tools-relocs-add-__printf-attribute-to-die.patch | 105 | ||||
-rw-r--r-- | 0002-e1000e-use-proper-include-guard-name-in-hw.h.patch | 34 | ||||
-rw-r--r-- | series | 2 |
3 files changed, 141 insertions, 0 deletions
diff --git a/0001-x86-tools-relocs-add-__printf-attribute-to-die.patch b/0001-x86-tools-relocs-add-__printf-attribute-to-die.patch new file mode 100644 index 00000000000000..e698c44630fff0 --- /dev/null +++ b/0001-x86-tools-relocs-add-__printf-attribute-to-die.patch @@ -0,0 +1,105 @@ +From 3e842cb1d912d5a6a268563fa9d687ca1d9b9ab9 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Date: Sat, 27 Feb 2021 10:51:09 +0100 +Subject: [PATCH 1/2] x86/tools/relocs: add __printf attribute to die() + +There are a number of printf "mismatches" in the use of die() in +x86/tools/relocs.c. Fix them up and add the printf attribute to the +reloc.h header file to prevent them from ever coming back. + +Cc: Thomas Gleixner <tglx@linutronix.de> +Cc: Ingo Molnar <mingo@redhat.com> +Cc: Borislav Petkov <bp@alien8.de> +Cc: "H. Peter Anvin" <hpa@zytor.com> +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + arch/x86/tools/relocs.c | 21 +++++++++++---------- + arch/x86/tools/relocs.h | 1 + + 2 files changed, 12 insertions(+), 10 deletions(-) + +--- a/arch/x86/tools/relocs.c ++++ b/arch/x86/tools/relocs.c +@@ -389,7 +389,8 @@ static void read_ehdr(FILE *fp) + Elf_Shdr shdr; + + if (fseek(fp, ehdr.e_shoff, SEEK_SET) < 0) +- die("Seek to %d failed: %s\n", ehdr.e_shoff, strerror(errno)); ++ die("Seek to %d failed: %s\n", ++ (int)ehdr.e_shoff, strerror(errno)); + + if (fread(&shdr, sizeof(shdr), 1, fp) != 1) + die("Cannot read initial ELF section header: %s\n", strerror(errno)); +@@ -412,17 +413,17 @@ static void read_shdrs(FILE *fp) + + secs = calloc(shnum, sizeof(struct section)); + if (!secs) { +- die("Unable to allocate %d section headers\n", ++ die("Unable to allocate %ld section headers\n", + shnum); + } + if (fseek(fp, ehdr.e_shoff, SEEK_SET) < 0) { + die("Seek to %d failed: %s\n", +- ehdr.e_shoff, strerror(errno)); ++ (int)ehdr.e_shoff, strerror(errno)); + } + for (i = 0; i < shnum; i++) { + struct section *sec = &secs[i]; + if (fread(&shdr, sizeof(shdr), 1, fp) != 1) +- die("Cannot read ELF section headers %d/%d: %s\n", ++ die("Cannot read ELF section headers %d/%ld: %s\n", + i, shnum, strerror(errno)); + sec->shdr.sh_name = elf_word_to_cpu(shdr.sh_name); + sec->shdr.sh_type = elf_word_to_cpu(shdr.sh_type); +@@ -451,11 +452,11 @@ static void read_strtabs(FILE *fp) + sec->strtab = malloc(sec->shdr.sh_size); + if (!sec->strtab) { + die("malloc of %d bytes for strtab failed\n", +- sec->shdr.sh_size); ++ (int)sec->shdr.sh_size); + } + if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) { + die("Seek to %d failed: %s\n", +- sec->shdr.sh_offset, strerror(errno)); ++ (int)sec->shdr.sh_offset, strerror(errno)); + } + if (fread(sec->strtab, 1, sec->shdr.sh_size, fp) + != sec->shdr.sh_size) { +@@ -476,11 +477,11 @@ static void read_symtabs(FILE *fp) + sec->symtab = malloc(sec->shdr.sh_size); + if (!sec->symtab) { + die("malloc of %d bytes for symtab failed\n", +- sec->shdr.sh_size); ++ (int)sec->shdr.sh_size); + } + if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) { + die("Seek to %d failed: %s\n", +- sec->shdr.sh_offset, strerror(errno)); ++ (int)sec->shdr.sh_offset, strerror(errno)); + } + if (fread(sec->symtab, 1, sec->shdr.sh_size, fp) + != sec->shdr.sh_size) { +@@ -509,11 +510,11 @@ static void read_relocs(FILE *fp) + sec->reltab = malloc(sec->shdr.sh_size); + if (!sec->reltab) { + die("malloc of %d bytes for relocs failed\n", +- sec->shdr.sh_size); ++ (int)sec->shdr.sh_size); + } + if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) { + die("Seek to %d failed: %s\n", +- sec->shdr.sh_offset, strerror(errno)); ++ (int)sec->shdr.sh_offset, strerror(errno)); + } + if (fread(sec->reltab, 1, sec->shdr.sh_size, fp) + != sec->shdr.sh_size) { +--- a/arch/x86/tools/relocs.h ++++ b/arch/x86/tools/relocs.h +@@ -17,6 +17,7 @@ + #include <regex.h> + #include <tools/le_byteshift.h> + ++__attribute__((__format__(printf, 1, 2))) + void die(char *fmt, ...) __attribute__((noreturn)); + + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/0002-e1000e-use-proper-include-guard-name-in-hw.h.patch b/0002-e1000e-use-proper-include-guard-name-in-hw.h.patch new file mode 100644 index 00000000000000..057c31176ca981 --- /dev/null +++ b/0002-e1000e-use-proper-include-guard-name-in-hw.h.patch @@ -0,0 +1,34 @@ +From 21ea2795fc39e6f07df72616edc03d4d2caee1fc Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Date: Sat, 27 Feb 2021 10:55:47 +0100 +Subject: [PATCH 2/2] e1000e: use proper #include guard name in hw.h + +The include guard for the e1000e and e1000 hw.h files are the same, so +add the proper "E" term to the hw.h file for the e1000e driver. + +This resolves some static analyzer warnings, like the one found by the +"lgtm.com" tool. + +Cc: Jesse Brandeburg <jesse.brandeburg@intel.com> +Cc: Tony Nguyen <anthony.l.nguyen@intel.com> +Cc: "David S. Miller" <davem@davemloft.net> +Cc: Jakub Kicinski <kuba@kernel.org> +Cc: intel-wired-lan@lists.osuosl.org +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/net/ethernet/intel/e1000e/hw.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/hw.h ++++ b/drivers/net/ethernet/intel/e1000e/hw.h +@@ -1,8 +1,8 @@ + /* SPDX-License-Identifier: GPL-2.0 */ + /* Copyright(c) 1999 - 2018 Intel Corporation. */ + +-#ifndef _E1000_HW_H_ +-#define _E1000_HW_H_ ++#ifndef _E1000E_HW_H_ ++#define _E1000E_HW_H_ + + #include "regs.h" + #include "defines.h" @@ -1,4 +1,6 @@ # +0001-x86-tools-relocs-add-__printf-attribute-to-die.patch +0002-e1000e-use-proper-include-guard-name-in-hw.h.patch 0001-driver-core-aux-test-code.patch copying.patch 0001-readfile-implement-readfile-syscall.patch |