backported build fixes
Subsystems (6)
cover backported build fixes
Hi Greg,
I've gone through one more set of patches, starting out with Olof's last build report and looking at the configurations that failed in 3.18.51.
I could reproduce most of the warnings on my box, and found a couple of extra ones (one from using newer binutils, and probably one or two from using a newer gcc). With the set of 13 patches, those all seem to be fixed for me now.
The first half are new patches that I did to fix warnings for code that was removed or rewritten between 3.18 and 4.4, or patches that did not apply cleanly but that I managed to backport anyway. The rest are backports of upstream patches that I didn't see you apply yet. If you already have any of those, just ignore them.
The series also addresses some of the warnings that we saw on the kernelci bot, but some others still remain.
Arnd
PATCH 1/13 ARM: cns3xxx: shut up frame size warning
This shuts up a warning in the 3.18-stable series that has been fixed in newer kernels with commit 498a92d42596 ("ARM: cns3xxx: pci: avoid potential stack overflow"):
arch/arm/mach-cns3xxx/pcie.c: In function 'cns3xxx_pcie_hw_init':arch/arm/mach-cns3xxx/pcie.c:313:1: error: the frame size of 1080 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
The fix that went into v4.4 is known to be buggy and was later fixed again with commit 88e9da9a2a70 ("CNS3xxx: Fix PCI cns3xxx_write_config()"). While we could backport both to 3.18, they are fairly invasive and the warning is definitely harmless here as the call chain is known to not overflow the stack of the init task.
This simply adds a Makefile flag to extend the limit for this one file.
---
We do want 88e9da9a2a70 ("CNS3xxx: Fix PCI cns3xxx_write_config()") backported into v4.4 though.
--- arch/arm/mach-cns3xxx/Makefile | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-cns3xxx/Makefile +1 -0
@@ -2,4 +2,5 @@ obj-$(CONFIG_ARCH_CNS3XXX) += cns3xxx.o cns3xxx-y += core.o pm.o cns3xxx-$(CONFIG_ATAGS) += devices.o cns3xxx-$(CONFIG_PCI) += pcie.o +CFLAGS_pcie.o += -Wframe-larger-than=1536 # override default 1024, this is safe here cns3xxx-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o
Signature · 1 line
2.9.0
Greg KH
maintainerRe: [PATCH 01/13] [3.18-stable] ARM: cns3xxx: shut up frame size warning
Quoted 14 lines · Arnd Bergmann
This shuts up a warning in the 3.18-stable series that has been fixed in newer kernels with commit
498a92d42596("ARM: cns3xxx: pci: avoid potential stack overflow"):
arch/arm/mach-cns3xxx/pcie.c: In function 'cns3xxx_pcie_hw_init':arch/arm/mach-cns3xxx/pcie.c:313:1: error: the frame size of 1080 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]The fix that went into v4.4 is known to be buggy and was later fixed again with commit
88e9da9a2a70("CNS3xxx: Fix PCIcns3xxx_write_config()"). While we could backport both to 3.18, they are fairly invasive and the warning is definitely harmless here as the call chain is known to not overflow the stack of the init task.
Quoted 7 lines
This simply adds a
Makefileflag to extend the limit for this one file.Signed-off-by Arnd Bergmann <[email protected]>---
We do want88e9da9a2a70("CNS3xxx: Fix PCIcns3xxx_write_config()") backported into v4.4 though.
That's already there, thanks.
greg k-h
Patch "ARM: cns3xxx: shut up frame size warning" has been added to the 3.18-stable tree
In reply to Arnd BergmannThis is a note to let you know that I've just added the patch titled
ARM: cns3xxx: shut up frame size warning
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
arm-cns3xxx-shut-up-frame-size-warning.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Thu May 4 15:27:13 2017
From: Arnd Bergmann <[email protected]>
Date: Thu, 4 May 2017 22:51:57 +0200
Subject: ARM: cns3xxx: shut up frame size warning
To: [email protected]
Cc: [email protected], Arnd Bergmann <[email protected]>
Message-ID: <[email protected]>
From: Arnd Bergmann <[email protected]>
This shuts up a warning in the 3.18-stable series that has been fixed in newer kernels with commit 498a92d42596 ("ARM: cns3xxx: pci: avoid potential stack overflow"):
arch/arm/mach-cns3xxx/pcie.c: In function 'cns3xxx_pcie_hw_init':arch/arm/mach-cns3xxx/pcie.c:313:1: error: the frame size of 1080 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
The fix that went into v4.4 is known to be buggy and was later fixed again with commit 88e9da9a2a70 ("CNS3xxx: Fix PCI cns3xxx_write_config()"). While we could backport both to 3.18, they are fairly invasive and the warning is definitely harmless here as the call chain is known to not overflow the stack of the init task.
This simply adds a Makefile flag to extend the limit for this one file.
---
We do want 88e9da9a2a70 ("CNS3xxx: Fix PCI cns3xxx_write_config()") backported into v4.4 though.
--- arch/arm/mach-cns3xxx/Makefile | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-cns3xxx/Makefile +1 -0
@@ -2,4 +2,5 @@ obj-$(CONFIG_ARCH_CNS3XXX) += cns3xxx.o cns3xxx-y += core.o pm.o cns3xxx-$(CONFIG_ATAGS) += devices.o cns3xxx-$(CONFIG_PCI) += pcie.o +CFLAGS_pcie.o += -Wframe-larger-than=1536 # override default 1024, this is safe here cns3xxx-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o
Patches currently in stable-queue which might be from [email protected] are
queue-3.18/ib-iser-fix-sparse-warnings.patch queue-3.18/cred-userns-define-current_user_ns-as-a-function.patch queue-3.18/pci-xilinx-fix-harmless-format-string-warning.patch queue-3.18/arm64-build-vdso-without-libgcov.patch queue-3.18/arm64-provide-a-namespace-to-ncaps.patch queue-3.18/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch queue-3.18/net-tg3-avoid-uninitialized-variable-warning.patch queue-3.18/tty-isicom-fix-big-endian-compile-warning.patch queue-3.18/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch queue-3.18/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch queue-3.18/ips-remove-pointless-warning.patch queue-3.18/powerpc-ptrace-fix-out-of-bounds-array-access-warning.patch queue-3.18/staging-imx-drm-fix-indentation-warning.patch queue-3.18/mlx5-avoid-build-warnings-on-32-bit.patch queue-3.18/mm-cma-silence-warnings-due-to-max-usage.patch queue-3.18/misdn-avoid-arch-specific-__builtin_return_address-call.patch queue-3.18/staging-bcm-add-32-bit-host-dependency.patch queue-3.18/staging-vt6655-fix-overly-large-stack-usage.patch queue-3.18/drbd-avoid-redefinition-of-bits_per_page.patch queue-3.18/infiniband-mlx5-avoid-a-compile-time-warning.patch queue-3.18/arm-cns3xxx-shut-up-frame-size-warning.patch queue-3.18/ib-ehca-fix-maybe-uninitialized-warnings.patch
PATCH 2/13 arm64: Provide a namespace to NCAPS
In reply to Arnd BergmannFrom: Fabio Estevam <[email protected]>
Commit 06f9eb884be81431d54d7d37390043e3b5b7f14a upstream.
Building arm64.allmodconfig leads to the following warning:
usb/gadget/function/f_ncm.c:203:0: warning: "NCAPS" redefined
#define NCAPS (USB_CDC_NCM_NCAP_ETH_FILTER | USB_CDC_NCM_NCAP_CRC_MODE) ^
In file included from /home/build/work/batch/arch/arm64/include/asm/io.h:32:0,
from /home/build/work/batch/include/linux/clocksource.h:19,
from /home/build/work/batch/include/clocksource/arm_arch_timer.h:19,
from /home/build/work/batch/arch/arm64/include/asm/arch_timer.h:27,
from /home/build/work/batch/arch/arm64/include/asm/timex.h:19,
from /home/build/work/batch/include/linux/timex.h:65,
from /home/build/work/batch/include/linux/sched.h:19,
from /home/build/work/batch/arch/arm64/include/asm/compat.h:25,
from /home/build/work/batch/arch/arm64/include/asm/stat.h:23,
from /home/build/work/batch/include/linux/stat.h:5,
from /home/build/work/batch/include/linux/module.h:10,
from /home/build/work/batch/drivers/usb/gadget/function/f_ncm.c:19:arch/arm64/include/asm/cpufeature.h:27:0: note: this is the location of the previous definition
#define NCAPS 2
So add a ARM64 prefix to avoid such problem.
---
Slightly adapted for context changes
--- arch/arm64/include/asm/cpufeature.h | 10 +++++----- arch/arm64/kernel/setup.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
arch/arm64/include/asm/cpufeature.h +5 -5
@@ -25,11 +25,11 @@#define ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE 1#define ARM64_WORKAROUND_845719 2 -#define NCAPS 3 +#define ARM64_NCAPS 3#ifndef __ASSEMBLY__ -extern DECLARE_BITMAP(cpu_hwcaps, NCAPS); +extern DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS);static inline bool cpu_have_feature (unsigned int num) {
@@ -38,16 +38,16 @@ static inline bool cpu_have_feature(unsigned int num)static inline bool cpus_have_cap (unsigned int num) { -if (num >=NCAPS ) +if (num >=ARM64_NCAPS )return false;return test_bit (num, cpu_hwcaps); }static inline void cpus_set_cap (unsigned int num) { -if (num >=NCAPS ) +if (num >=ARM64_NCAPS )pr_warn ("Attempt to set an illegal CPU capability (%d >= %d)\n" , - num,NCAPS ); + num,ARM64_NCAPS );else __set_bit (num, cpu_hwcaps); }
arch/arm64/kernel/setup.c +1 -1
@@ -80,7 +80,7 @@ unsigned int compat_elf_hwcap __read_mostly = COMPAT_ELF_HWCAP_DEFAULT;unsigned int compat_elf_hwcap2__read_mostly ;#endif -DECLARE_BITMAP (cpu_hwcaps,NCAPS ); +DECLARE_BITMAP (cpu_hwcaps,ARM64_NCAPS );static const char *cpu_name;phys_addr_t __fdt_pointer__initdata ;
Signature · 1 line
2.9.0
PATCH 3/13 staging: vt6655: fix overly large stack usage
In reply to Arnd BergmannWe get a warning for the large stack usage in some configurations:
drivers/staging/vt6655/device_main.c: In function 'device_ioctl':drivers/staging/vt6655/device_main.c:2974:1: warning: the frame size of 1304 bytes is larger than 1024 bytes [-Wframe-larger-than=]
This is addressed in linux-3.19 with commit 67013f2c0e58 ("staging: vt6655:
mac80211 conversion add main mac80211 functions"), which obsoletes the device_ioctl() function, but as that does not apply to stable kernels, this picks an easier way out by using dynamic allocation.
The driver was merged in 2.6.31, and the fix applies to all versions before 3.19.
--- drivers/staging/vt6655/device_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/vt6655/device_main.c +6 -4
@@ -2818,11 +2818,13 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)pr_debug (" SIOCSIWSENS\n" ); rc = -EOPNOTSUPP ;break ; -case SIOCGIWAPLIST : { -char buffer[IW_MAX_AP * (sizeof (struct sockaddr ) +sizeof (struct iw_quality ))]; +char *buffer =kzalloc (IW_MAX_AP * (sizeof (struct sockaddr ) + +sizeof (struct iw_quality )),GFP_KERNEL ); -if (wrq->u.data.pointer) { +if (!buffer) { + rc = -ENOMEM ; + }else if (wrq->u.data.pointer) { rc =iwctl_giwaplist (dev,NULL , &(wrq->u.data), buffer);if (rc ==0 ) { if (copy_to_user(wrq->u.data.pointer,
@@ -2832,6 +2834,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) rc = -EFAULT ; } } +kfree (buffer); }break ;
@@ -2878,7 +2881,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)pr_debug (" SIOCGIWGENIE\n" ); rc =iwctl_giwgenie (dev,NULL , &(wrq->u.data), wrq->u.data.pointer);break ; -case SIOCSIWENCODEEXT : {char extra[sizeof (struct iw_encode_ext )+MAX_KEY_LEN +1 ];
Signature · 1 line
2.9.0
Patch "staging: vt6655: fix overly large stack usage" has been added to the 3.18-stable tree
This is a note to let you know that I've just added the patch titled
staging: vt6655: fix overly large stack usage
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
staging-vt6655-fix-overly-large-stack-usage.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Thu May 4 15:28:39 2017
From: Arnd Bergmann <[email protected]>
Date: Thu, 4 May 2017 22:51:59 +0200
Subject: staging: vt6655: fix overly large stack usage
To: [email protected]
Cc: [email protected], Arnd Bergmann <[email protected]>
Message-ID: <[email protected]>
From: Arnd Bergmann <[email protected]>
We get a warning for the large stack usage in some configurations:
drivers/staging/vt6655/device_main.c: In function 'device_ioctl':drivers/staging/vt6655/device_main.c:2974:1: warning: the frame size of 1304 bytes is larger than 1024 bytes [-Wframe-larger-than=]
This is addressed in linux-3.19 with commit 67013f2c0e58 ("staging: vt6655:
mac80211 conversion add main mac80211 functions"), which obsoletes the device_ioctl() function, but as that does not apply to stable kernels, this picks an easier way out by using dynamic allocation.
The driver was merged in 2.6.31, and the fix applies to all versions before 3.19.
--- drivers/staging/vt6655/device_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/vt6655/device_main.c +6 -4
@@ -2818,11 +2818,13 @@ static int device_ioctl(struct net_devipr_debug (" SIOCSIWSENS\n" ); rc = -EOPNOTSUPP ;break ; -case SIOCGIWAPLIST : { -char buffer[IW_MAX_AP * (sizeof (struct sockaddr ) +sizeof (struct iw_quality ))]; +char *buffer =kzalloc (IW_MAX_AP * (sizeof (struct sockaddr ) + +sizeof (struct iw_quality )),GFP_KERNEL ); -if (wrq->u.data.pointer) { +if (!buffer) { + rc = -ENOMEM ; + }else if (wrq->u.data.pointer) { rc =iwctl_giwaplist (dev,NULL , &(wrq->u.data), buffer);if (rc ==0 ) { if (copy_to_user(wrq->u.data.pointer,
@@ -2832,6 +2834,7 @@ static int device_ioctl(struct net_devi rc = -EFAULT ; } } +kfree (buffer); }break ;
@@ -2878,7 +2881,6 @@ static int device_ioctl(struct net_devipr_debug (" SIOCGIWGENIE\n" ); rc =iwctl_giwgenie (dev,NULL , &(wrq->u.data), wrq->u.data.pointer);break ; -case SIOCSIWENCODEEXT : {char extra[sizeof (struct iw_encode_ext )+MAX_KEY_LEN +1 ];
Patches currently in stable-queue which might be from [email protected] are
queue-3.18/ib-iser-fix-sparse-warnings.patch queue-3.18/cred-userns-define-current_user_ns-as-a-function.patch queue-3.18/pci-xilinx-fix-harmless-format-string-warning.patch queue-3.18/arm64-build-vdso-without-libgcov.patch queue-3.18/arm64-provide-a-namespace-to-ncaps.patch queue-3.18/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch queue-3.18/net-tg3-avoid-uninitialized-variable-warning.patch queue-3.18/tty-isicom-fix-big-endian-compile-warning.patch queue-3.18/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch queue-3.18/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch queue-3.18/ips-remove-pointless-warning.patch queue-3.18/powerpc-ptrace-fix-out-of-bounds-array-access-warning.patch queue-3.18/staging-imx-drm-fix-indentation-warning.patch queue-3.18/mlx5-avoid-build-warnings-on-32-bit.patch queue-3.18/mm-cma-silence-warnings-due-to-max-usage.patch queue-3.18/misdn-avoid-arch-specific-__builtin_return_address-call.patch queue-3.18/staging-bcm-add-32-bit-host-dependency.patch queue-3.18/staging-vt6655-fix-overly-large-stack-usage.patch queue-3.18/drbd-avoid-redefinition-of-bits_per_page.patch queue-3.18/infiniband-mlx5-avoid-a-compile-time-warning.patch queue-3.18/arm-cns3xxx-shut-up-frame-size-warning.patch queue-3.18/ib-ehca-fix-maybe-uninitialized-warnings.patch
PATCH 4/13 staging: imx-drm: fix indentation warning
In reply to Arnd Bergmanngcc-6 produces a harmless warning:
drivers/staging/imx-drm/imx-hdmi.c: In function 'hdmi_config_AVI':drivers/staging/imx-drm/imx-hdmi.c:967:2: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
Commit d083c312cba2 ("drm: bridge/dw_hdmi: simplify hdmi_config_AVI() a little") in linux-4.3 fixes this with a larger rewrite that is not applicable here. After that rewrite, the variable that gets assigned here no longer exists.
The assignment is rather pointless here, as we just set a variable to zero that is later added into another variable using a bitwise or operator, and that has no effect, so I'm just changing the indentation here to shut up the warning.
The driver was originally merged in linux-3.13, and the fix applies to all versions between that and 4.2.
--- drivers/staging/imx-drm/imx-hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/imx-drm/imx-hdmi.c +1 -1
@@ -967,7 +967,7 @@ static void hdmi_config_AVI(struct imx_hdmi *hdmi)else pix_fmt =HDMI_FC_AVICONF0_PIX_FMT_RGB ; - under_scan =HDMI_FC_AVICONF0_SCAN_INFO_NODATA ; + under_scan =HDMI_FC_AVICONF0_SCAN_INFO_NODATA ;/* * Active format identification data is present in the AVI InfoFrame.
Signature · 1 line
2.9.0
Patch "staging: imx-drm: fix indentation warning" has been added to the 3.18-stable tree
This is a note to let you know that I've just added the patch titled
staging: imx-drm: fix indentation warning
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
staging-imx-drm-fix-indentation-warning.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Thu May 4 15:29:03 2017
From: Arnd Bergmann <[email protected]>
Date: Thu, 4 May 2017 22:52:00 +0200
Subject: staging: imx-drm: fix indentation warning
To: [email protected]
Cc: [email protected], Arnd Bergmann <[email protected]>
Message-ID: <[email protected]>
From: Arnd Bergmann <[email protected]>
gcc-6 produces a harmless warning:
drivers/staging/imx-drm/imx-hdmi.c: In function 'hdmi_config_AVI':drivers/staging/imx-drm/imx-hdmi.c:967:2: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
Commit d083c312cba2 ("drm: bridge/dw_hdmi: simplify hdmi_config_AVI() a little") in linux-4.3 fixes this with a larger rewrite that is not applicable here. After that rewrite, the variable that gets assigned here no longer exists.
The assignment is rather pointless here, as we just set a variable to zero that is later added into another variable using a bitwise or operator, and that has no effect, so I'm just changing the indentation here to shut up the warning.
The driver was originally merged in linux-3.13, and the fix applies to all versions between that and 4.2.
--- drivers/staging/imx-drm/imx-hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/imx-drm/imx-hdmi.c +1 -1
@@ -967,7 +967,7 @@ static void hdmi_config_AVI(struct imx_helse pix_fmt =HDMI_FC_AVICONF0_PIX_FMT_RGB ; - under_scan =HDMI_FC_AVICONF0_SCAN_INFO_NODATA ; + under_scan =HDMI_FC_AVICONF0_SCAN_INFO_NODATA ;/* * Active format identification data is present in the AVI InfoFrame.
Patches currently in stable-queue which might be from [email protected] are
queue-3.18/ib-iser-fix-sparse-warnings.patch queue-3.18/cred-userns-define-current_user_ns-as-a-function.patch queue-3.18/pci-xilinx-fix-harmless-format-string-warning.patch queue-3.18/arm64-build-vdso-without-libgcov.patch queue-3.18/arm64-provide-a-namespace-to-ncaps.patch queue-3.18/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch queue-3.18/net-tg3-avoid-uninitialized-variable-warning.patch queue-3.18/tty-isicom-fix-big-endian-compile-warning.patch queue-3.18/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch queue-3.18/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch queue-3.18/ips-remove-pointless-warning.patch queue-3.18/powerpc-ptrace-fix-out-of-bounds-array-access-warning.patch queue-3.18/staging-imx-drm-fix-indentation-warning.patch queue-3.18/mlx5-avoid-build-warnings-on-32-bit.patch queue-3.18/mm-cma-silence-warnings-due-to-max-usage.patch queue-3.18/misdn-avoid-arch-specific-__builtin_return_address-call.patch queue-3.18/staging-bcm-add-32-bit-host-dependency.patch queue-3.18/staging-vt6655-fix-overly-large-stack-usage.patch queue-3.18/drbd-avoid-redefinition-of-bits_per_page.patch queue-3.18/infiniband-mlx5-avoid-a-compile-time-warning.patch queue-3.18/arm-cns3xxx-shut-up-frame-size-warning.patch queue-3.18/ib-ehca-fix-maybe-uninitialized-warnings.patch
PATCH 5/13 staging: bcm: add 32-bit host dependency
In reply to Arnd BergmannThe driver uses a 32-bit variable to store a pointer, causing a couple of warnings:
../drivers/staging/bcm/CmHost.c: In function 'StoreCmControlResponseMessage':../drivers/staging/bcm/CmHost.c:1503:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(struct bcm_connect_mgr_params *) ntohl(
^../drivers/staging/bcm/CmHost.c:1546:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(struct bcm_connect_mgr_params *) ntohl(
^../drivers/staging/bcm/CmHost.c:1564:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(struct bcm_connect_mgr_params *) ntohl(
I fixed other warnings in an earlier commit 9f1c75ac2dba ("staging/bcm: fix most build warnings"), but couldn't figure out what was the intended behavior on 64-bit machines here.
The driver was removed in linux-3.19, commit d09e9b160fc1 ("staging: bcm: remove driver") which explains that it never worked on 64-bit machines. This adds a Kconfig dependency instead to prevent it from being built in the known broken configuration. This workaround applies to v2.6.37 or higher.
--- drivers/staging/bcm/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/staging/bcm/Kconfig +1 -0
@@ -1,6 +1,7 @@ config BCM_WIMAX tristate "Beceem BCS200/BCS220-3 and BCSM250 wimax support" depends on USB && NET + depends on !64BIT help This is an experimental driver for the Beceem WIMAX chipset used by Sprint 4G.
Signature · 1 line
2.9.0
Patch "staging: bcm: add 32-bit host dependency" has been added to the 3.18-stable tree
This is a note to let you know that I've just added the patch titled
staging: bcm: add 32-bit host dependency
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
staging-bcm-add-32-bit-host-dependency.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Thu May 4 15:29:20 2017
From: Arnd Bergmann <[email protected]>
Date: Thu, 4 May 2017 22:52:01 +0200
Subject: staging: bcm: add 32-bit host dependency
To: [email protected]
Cc: [email protected], Arnd Bergmann <[email protected]>
Message-ID: <[email protected]>
From: Arnd Bergmann <[email protected]>
The driver uses a 32-bit variable to store a pointer, causing a couple of warnings:
../drivers/staging/bcm/CmHost.c: In function 'StoreCmControlResponseMessage':../drivers/staging/bcm/CmHost.c:1503:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(struct bcm_connect_mgr_params *) ntohl(
^../drivers/staging/bcm/CmHost.c:1546:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(struct bcm_connect_mgr_params *) ntohl(
^../drivers/staging/bcm/CmHost.c:1564:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
(struct bcm_connect_mgr_params *) ntohl(
I fixed other warnings in an earlier commit 9f1c75ac2dba ("staging/bcm: fix most build warnings"), but couldn't figure out what was the intended behavior on 64-bit machines here.
The driver was removed in linux-3.19, commit d09e9b160fc1 ("staging: bcm: remove driver") which explains that it never worked on 64-bit machines. This adds a Kconfig dependency instead to prevent it from being built in the known broken configuration. This workaround applies to v2.6.37 or higher.
--- drivers/staging/bcm/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/staging/bcm/Kconfig +1 -0
@@ -1,6 +1,7 @@ config BCM_WIMAX tristate "Beceem BCS200/BCS220-3 and BCSM250 wimax support" depends on USB && NET + depends on !64BIT help This is an experimental driver for the Beceem WIMAX chipset used by Sprint 4G.
Patches currently in stable-queue which might be from [email protected] are
queue-3.18/ib-iser-fix-sparse-warnings.patch queue-3.18/cred-userns-define-current_user_ns-as-a-function.patch queue-3.18/pci-xilinx-fix-harmless-format-string-warning.patch queue-3.18/arm64-build-vdso-without-libgcov.patch queue-3.18/arm64-provide-a-namespace-to-ncaps.patch queue-3.18/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch queue-3.18/net-tg3-avoid-uninitialized-variable-warning.patch queue-3.18/tty-isicom-fix-big-endian-compile-warning.patch queue-3.18/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch queue-3.18/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch queue-3.18/ips-remove-pointless-warning.patch queue-3.18/powerpc-ptrace-fix-out-of-bounds-array-access-warning.patch queue-3.18/staging-imx-drm-fix-indentation-warning.patch queue-3.18/mlx5-avoid-build-warnings-on-32-bit.patch queue-3.18/mm-cma-silence-warnings-due-to-max-usage.patch queue-3.18/misdn-avoid-arch-specific-__builtin_return_address-call.patch queue-3.18/staging-bcm-add-32-bit-host-dependency.patch queue-3.18/staging-vt6655-fix-overly-large-stack-usage.patch queue-3.18/drbd-avoid-redefinition-of-bits_per_page.patch queue-3.18/infiniband-mlx5-avoid-a-compile-time-warning.patch queue-3.18/arm-cns3xxx-shut-up-frame-size-warning.patch queue-3.18/ib-ehca-fix-maybe-uninitialized-warnings.patch
PATCH 6/13 IB/qib: rename BITS_PER_PAGE to RVT_BITS_PER_PAGE
In reply to Arnd BergmannWe get this build warning on arm64
drivers/infiniband/hw/qib/qib_qp.c:44:0: error: "BITS_PER_PAGE" redefined [-Werror]
#define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE)
This is fixed upstream in commit 898fa52b4ac3 ("IB/qib: Remove qpn, qp tables and related variables from qib"), which does a lot of other things as well.
Instead, I just backport the rename of the local BITS_PER_PAGE definition to RVT_BITS_PER_PAGE.
The driver first showed up in linux-2.6.35, and the fixup should still apply to that. The upstream fix went into v4.6, so we could apply this workaround to both 3.18 and 4.4.
--- drivers/infiniband/hw/qib/qib_qp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/infiniband/hw/qib/qib_qp.c +9 -9
@@ -41,13 +41,13 @@#include "qib.h" -#define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) -#define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1) +#define RVT_BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) +#define RVT_BITS_PER_PAGE_MASK (RVT_BITS_PER_PAGE-1)static inline unsigned mk_qpn (struct qib_qpn_table *qpt,struct qpn_map *map,unsigned off) { -return (map - qpt->map) *BITS_PER_PAGE + off; +return (map - qpt->map) *RVT_BITS_PER_PAGE + off; } static inline unsigned find_next_offset(struct qib_qpn_table *qpt,
@@ -59,7 +59,7 @@ static inline unsigned find_next_offset(struct qib_qpn_table *qpt,if (((off & qpt->mask) >>1 ) >= n) off = (off | qpt->mask) +2 ; }else - off =find_next_zero_bit (map->page,BITS_PER_PAGE , off); + off =find_next_zero_bit (map->page,RVT_BITS_PER_PAGE , off);return off; }
@@ -147,8 +147,8 @@ static int alloc_qpn(struct qib_devdata *dd, struct qib_qpn_table *qpt, qpn =2 ;if (qpt->mask && ((qpn & qpt->mask) >>1 ) >= dd->n_krcv_queues) qpn = (qpn | qpt->mask) +2 ; - offset = qpn &BITS_PER_PAGE_MASK ; - map = &qpt->map[qpn /BITS_PER_PAGE ]; + offset = qpn &RVT_BITS_PER_PAGE_MASK ; + map = &qpt->map[qpn /RVT_BITS_PER_PAGE ]; max_scan = qpt->nmaps - !offset;for (i =0 ;;) {if (unlikely (!map->page)) {
@@ -173,7 +173,7 @@ static int alloc_qpn(struct qib_devdata *dd, struct qib_qpn_table *qpt,* We just need to be sure we don't loop * forever. */ - }while (offset <BITS_PER_PAGE && qpn <QPN_MAX ); + }while (offset <RVT_BITS_PER_PAGE && qpn <QPN_MAX );/* * In order to keep the number of pages allocated to a * minimum, we scan the all existing pages before increasing
@@ -204,9 +204,9 @@ static void free_qpn(struct qib_qpn_table *qpt, u32 qpn) {struct qpn_map *map; - map = qpt->map + qpn /BITS_PER_PAGE ; + map = qpt->map + qpn /RVT_BITS_PER_PAGE ;if (map->page) -clear_bit (qpn &BITS_PER_PAGE_MASK , map->page); +clear_bit (qpn &RVT_BITS_PER_PAGE_MASK , map->page); }static inline unsigned qpn_hash (struct qib_ibdev *dev,u32 qpn)
Signature · 1 line
2.9.0
Patch "IB/qib: rename BITS_PER_PAGE to RVT_BITS_PER_PAGE" has been added to the 3.18-stable tree
This is a note to let you know that I've just added the patch titled
IB/qib: rename BITS_PER_PAGE to RVT_BITS_PER_PAGE
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Thu May 4 15:29:57 2017
From: Arnd Bergmann <[email protected]>
Date: Thu, 4 May 2017 22:52:02 +0200
Subject: IB/qib: rename BITS_PER_PAGE to RVT_BITS_PER_PAGE
To: [email protected]
Cc: [email protected], Arnd Bergmann <[email protected]>
Message-ID: <[email protected]>
From: Arnd Bergmann <[email protected]>
We get this build warning on arm64
drivers/infiniband/hw/qib/qib_qp.c:44:0: error: "BITS_PER_PAGE" redefined [-Werror]
#define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE)
This is fixed upstream in commit 898fa52b4ac3 ("IB/qib: Remove qpn, qp tables and related variables from qib"), which does a lot of other things as well.
Instead, I just backport the rename of the local BITS_PER_PAGE definition to RVT_BITS_PER_PAGE.
The driver first showed up in linux-2.6.35, and the fixup should still apply to that. The upstream fix went into v4.6, so we could apply this workaround to both 3.18 and 4.4.
--- drivers/infiniband/hw/qib/qib_qp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/infiniband/hw/qib/qib_qp.c +9 -9
@@ -41,13 +41,13 @@#include "qib.h" -#define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) -#define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1) +#define RVT_BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) +#define RVT_BITS_PER_PAGE_MASK (RVT_BITS_PER_PAGE-1)static inline unsigned mk_qpn (struct qib_qpn_table *qpt,struct qpn_map *map,unsigned off) { -return (map - qpt->map) *BITS_PER_PAGE + off; +return (map - qpt->map) *RVT_BITS_PER_PAGE + off; } static inline unsigned find_next_offset(struct qib_qpn_table *qpt,
@@ -59,7 +59,7 @@ static inline unsigned find_next_offset(if (((off & qpt->mask) >>1 ) >= n) off = (off | qpt->mask) +2 ; }else - off =find_next_zero_bit (map->page,BITS_PER_PAGE , off); + off =find_next_zero_bit (map->page,RVT_BITS_PER_PAGE , off);return off; }
@@ -147,8 +147,8 @@ static int alloc_qpn(struct qib_devdata qpn =2 ;if (qpt->mask && ((qpn & qpt->mask) >>1 ) >= dd->n_krcv_queues) qpn = (qpn | qpt->mask) +2 ; - offset = qpn &BITS_PER_PAGE_MASK ; - map = &qpt->map[qpn /BITS_PER_PAGE ]; + offset = qpn &RVT_BITS_PER_PAGE_MASK ; + map = &qpt->map[qpn /RVT_BITS_PER_PAGE ]; max_scan = qpt->nmaps - !offset;for (i =0 ;;) {if (unlikely (!map->page)) {
@@ -173,7 +173,7 @@ static int alloc_qpn(struct qib_devdata* We just need to be sure we don't loop * forever. */ - }while (offset <BITS_PER_PAGE && qpn <QPN_MAX ); + }while (offset <RVT_BITS_PER_PAGE && qpn <QPN_MAX );/* * In order to keep the number of pages allocated to a * minimum, we scan the all existing pages before increasing
@@ -204,9 +204,9 @@ static void free_qpn(struct qib_qpn_tabl {struct qpn_map *map; - map = qpt->map + qpn /BITS_PER_PAGE ; + map = qpt->map + qpn /RVT_BITS_PER_PAGE ;if (map->page) -clear_bit (qpn &BITS_PER_PAGE_MASK , map->page); +clear_bit (qpn &RVT_BITS_PER_PAGE_MASK , map->page); }static inline unsigned qpn_hash (struct qib_ibdev *dev,u32 qpn)
Patches currently in stable-queue which might be from [email protected] are
queue-3.18/ib-iser-fix-sparse-warnings.patch queue-3.18/cred-userns-define-current_user_ns-as-a-function.patch queue-3.18/pci-xilinx-fix-harmless-format-string-warning.patch queue-3.18/arm64-build-vdso-without-libgcov.patch queue-3.18/arm64-provide-a-namespace-to-ncaps.patch queue-3.18/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch queue-3.18/net-tg3-avoid-uninitialized-variable-warning.patch queue-3.18/tty-isicom-fix-big-endian-compile-warning.patch queue-3.18/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch queue-3.18/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch queue-3.18/ips-remove-pointless-warning.patch queue-3.18/powerpc-ptrace-fix-out-of-bounds-array-access-warning.patch queue-3.18/staging-imx-drm-fix-indentation-warning.patch queue-3.18/mlx5-avoid-build-warnings-on-32-bit.patch queue-3.18/mm-cma-silence-warnings-due-to-max-usage.patch queue-3.18/misdn-avoid-arch-specific-__builtin_return_address-call.patch queue-3.18/staging-bcm-add-32-bit-host-dependency.patch queue-3.18/staging-vt6655-fix-overly-large-stack-usage.patch queue-3.18/drbd-avoid-redefinition-of-bits_per_page.patch queue-3.18/infiniband-mlx5-avoid-a-compile-time-warning.patch queue-3.18/arm-cns3xxx-shut-up-frame-size-warning.patch queue-3.18/ib-ehca-fix-maybe-uninitialized-warnings.patch
Patch "IB/qib: rename BITS_PER_PAGE to RVT_BITS_PER_PAGE" has been added to the 4.4-stable tree
In reply to Arnd BergmannThis is a note to let you know that I've just added the patch titled
IB/qib: rename BITS_PER_PAGE to RVT_BITS_PER_PAGE
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Thu May 4 15:29:57 2017
From: Arnd Bergmann <[email protected]>
Date: Thu, 4 May 2017 22:52:02 +0200
Subject: IB/qib: rename BITS_PER_PAGE to RVT_BITS_PER_PAGE
To: [email protected]
Cc: [email protected], Arnd Bergmann <[email protected]>
Message-ID: <[email protected]>
From: Arnd Bergmann <[email protected]>
We get this build warning on arm64
drivers/infiniband/hw/qib/qib_qp.c:44:0: error: "BITS_PER_PAGE" redefined [-Werror]
#define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE)
This is fixed upstream in commit 898fa52b4ac3 ("IB/qib: Remove qpn, qp tables and related variables from qib"), which does a lot of other things as well.
Instead, I just backport the rename of the local BITS_PER_PAGE definition to RVT_BITS_PER_PAGE.
The driver first showed up in linux-2.6.35, and the fixup should still apply to that. The upstream fix went into v4.6, so we could apply this workaround to both 3.18 and 4.4.
--- drivers/infiniband/hw/qib/qib_qp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/infiniband/hw/qib/qib_qp.c +9 -9
@@ -41,13 +41,13 @@#include "qib.h" -#define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) -#define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1) +#define RVT_BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) +#define RVT_BITS_PER_PAGE_MASK (RVT_BITS_PER_PAGE-1)static inline unsigned mk_qpn (struct qib_qpn_table *qpt,struct qpn_map *map,unsigned off) { -return (map - qpt->map) *BITS_PER_PAGE + off; +return (map - qpt->map) *RVT_BITS_PER_PAGE + off; } static inline unsigned find_next_offset(struct qib_qpn_table *qpt,
@@ -59,7 +59,7 @@ static inline unsigned find_next_offset(if (((off & qpt->mask) >>1 ) >= n) off = (off | qpt->mask) +2 ; }else - off =find_next_zero_bit (map->page,BITS_PER_PAGE , off); + off =find_next_zero_bit (map->page,RVT_BITS_PER_PAGE , off);return off; }
@@ -147,8 +147,8 @@ static int alloc_qpn(struct qib_devdata qpn =2 ;if (qpt->mask && ((qpn & qpt->mask) >>1 ) >= dd->n_krcv_queues) qpn = (qpn | qpt->mask) +2 ; - offset = qpn &BITS_PER_PAGE_MASK ; - map = &qpt->map[qpn /BITS_PER_PAGE ]; + offset = qpn &RVT_BITS_PER_PAGE_MASK ; + map = &qpt->map[qpn /RVT_BITS_PER_PAGE ]; max_scan = qpt->nmaps - !offset;for (i =0 ;;) {if (unlikely (!map->page)) {
@@ -173,7 +173,7 @@ static int alloc_qpn(struct qib_devdata* We just need to be sure we don't loop * forever. */ - }while (offset <BITS_PER_PAGE && qpn <QPN_MAX ); + }while (offset <RVT_BITS_PER_PAGE && qpn <QPN_MAX );/* * In order to keep the number of pages allocated to a * minimum, we scan the all existing pages before increasing
@@ -204,9 +204,9 @@ static void free_qpn(struct qib_qpn_tabl {struct qpn_map *map; - map = qpt->map + qpn /BITS_PER_PAGE ; + map = qpt->map + qpn /RVT_BITS_PER_PAGE ;if (map->page) -clear_bit (qpn &BITS_PER_PAGE_MASK , map->page); +clear_bit (qpn &RVT_BITS_PER_PAGE_MASK , map->page); }static inline unsigned qpn_hash (struct qib_ibdev *dev,u32 qpn)
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch queue-4.4/net-tg3-avoid-uninitialized-variable-warning.patch queue-4.4/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch queue-4.4/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch queue-4.4/drbd-avoid-redefinition-of-bits_per_page.patch queue-4.4/ib-ehca-fix-maybe-uninitialized-warnings.patch
PATCH 7/13 IB/ehca: fix maybe-uninitialized warnings
In reply to Arnd BergmannThe driver causes two warnings about possibly uninitialized variables:
drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_set_pagebuf':drivers/infiniband/hw/ehca/ehca_mrmw.c:1908:4: warning: 'prev_pgaddr' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/infiniband/hw/ehca/ehca_mrmw.c:1924:14: note: 'prev_pgaddr' was declared here drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_reg_mr':drivers/infiniband/hw/ehca/ehca_mrmw.c:2430:5: warning: 'hret' may be used uninitialized in this function [-Wmaybe-uninitialized]
The first one is definitely a false positive, the second one may or may not be one. In both cases, adding an intialization is the safe and easy workaround.
The driver was removed in mainline in commit e581d111dad3 ("staging/rdma: remove deprecated ehca driver"), in linux-4.6. In 4.4, the file is located in drivers/staging/rdma/ehca/ehca_mrmw.c, and the fix still applies.
--- drivers/infiniband/hw/ehca/ehca_mrmw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/ehca/ehca_mrmw.c +2 -1
@@ -1921,7 +1921,7 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo, u64 *kpage) {int ret =0 ; -u64 pgaddr, prev_pgaddr; +u64 pgaddr, prev_pgaddr =0 ;u32 j =0 ;int kpages_per_hwpage = pginfo->hwpage_size /PAGE_SIZE ;int nr_kpages = kpages_per_hwpage;
@@ -2417,6 +2417,7 @@ static int ehca_reg_bmap_mr_rpages(struct ehca_shca *shca,ehca_err (&shca->ib_device,"kpage alloc failed" );return -ENOMEM ; } + hret =H_SUCCESS ;for (top =0 ; top <EHCA_MAP_ENTRIES ; top++) {if (!ehca_bmap_valid (ehca_bmap->top[top]))continue ;
Signature · 1 line
2.9.0
Patch "IB/ehca: fix maybe-uninitialized warnings" has been added to the 3.18-stable tree
This is a note to let you know that I've just added the patch titled
IB/ehca: fix maybe-uninitialized warnings
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ib-ehca-fix-maybe-uninitialized-warnings.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Thu May 4 15:31:46 2017
From: Arnd Bergmann <[email protected]>
Date: Thu, 4 May 2017 22:52:03 +0200
Subject: IB/ehca: fix maybe-uninitialized warnings
To: [email protected]
Cc: [email protected], Arnd Bergmann <[email protected]>
Message-ID: <[email protected]>
From: Arnd Bergmann <[email protected]>
The driver causes two warnings about possibly uninitialized variables:
drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_set_pagebuf':drivers/infiniband/hw/ehca/ehca_mrmw.c:1908:4: warning: 'prev_pgaddr' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/infiniband/hw/ehca/ehca_mrmw.c:1924:14: note: 'prev_pgaddr' was declared here drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_reg_mr':drivers/infiniband/hw/ehca/ehca_mrmw.c:2430:5: warning: 'hret' may be used uninitialized in this function [-Wmaybe-uninitialized]
The first one is definitely a false positive, the second one may or may not be one. In both cases, adding an intialization is the safe and easy workaround.
The driver was removed in mainline in commit e581d111dad3 ("staging/rdma: remove deprecated ehca driver"), in linux-4.6. In 4.4, the file is located in drivers/staging/rdma/ehca/ehca_mrmw.c, and the fix still applies.
--- drivers/infiniband/hw/ehca/ehca_mrmw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/ehca/ehca_mrmw.c +2 -1
@@ -1921,7 +1921,7 @@ static int ehca_set_pagebuf_user2(struct u64 *kpage) {int ret =0 ; -u64 pgaddr, prev_pgaddr; +u64 pgaddr, prev_pgaddr =0 ;u32 j =0 ;int kpages_per_hwpage = pginfo->hwpage_size /PAGE_SIZE ;int nr_kpages = kpages_per_hwpage;
@@ -2417,6 +2417,7 @@ static int ehca_reg_bmap_mr_rpages(strucehca_err (&shca->ib_device,"kpage alloc failed" );return -ENOMEM ; } + hret =H_SUCCESS ;for (top =0 ; top <EHCA_MAP_ENTRIES ; top++) {if (!ehca_bmap_valid (ehca_bmap->top[top]))continue ;
Patches currently in stable-queue which might be from [email protected] are
queue-3.18/ib-iser-fix-sparse-warnings.patch queue-3.18/cred-userns-define-current_user_ns-as-a-function.patch queue-3.18/pci-xilinx-fix-harmless-format-string-warning.patch queue-3.18/arm64-build-vdso-without-libgcov.patch queue-3.18/arm64-provide-a-namespace-to-ncaps.patch queue-3.18/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch queue-3.18/net-tg3-avoid-uninitialized-variable-warning.patch queue-3.18/tty-isicom-fix-big-endian-compile-warning.patch queue-3.18/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch queue-3.18/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch queue-3.18/ips-remove-pointless-warning.patch queue-3.18/powerpc-ptrace-fix-out-of-bounds-array-access-warning.patch queue-3.18/staging-imx-drm-fix-indentation-warning.patch queue-3.18/mlx5-avoid-build-warnings-on-32-bit.patch queue-3.18/mm-cma-silence-warnings-due-to-max-usage.patch queue-3.18/misdn-avoid-arch-specific-__builtin_return_address-call.patch queue-3.18/staging-bcm-add-32-bit-host-dependency.patch queue-3.18/staging-vt6655-fix-overly-large-stack-usage.patch queue-3.18/drbd-avoid-redefinition-of-bits_per_page.patch queue-3.18/infiniband-mlx5-avoid-a-compile-time-warning.patch queue-3.18/arm-cns3xxx-shut-up-frame-size-warning.patch queue-3.18/ib-ehca-fix-maybe-uninitialized-warnings.patch
Patch "IB/ehca: fix maybe-uninitialized warnings" has been added to the 4.4-stable tree
In reply to Arnd BergmannThis is a note to let you know that I've just added the patch titled
IB/ehca: fix maybe-uninitialized warnings
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ib-ehca-fix-maybe-uninitialized-warnings.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From [email protected] Thu May 4 15:31:46 2017
From: Arnd Bergmann <[email protected]>
Date: Thu, 4 May 2017 22:52:03 +0200
Subject: IB/ehca: fix maybe-uninitialized warnings
To: [email protected]
Cc: [email protected], Arnd Bergmann <[email protected]>
Message-ID: <[email protected]>
From: Arnd Bergmann <[email protected]>
The driver causes two warnings about possibly uninitialized variables:
drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_set_pagebuf':drivers/infiniband/hw/ehca/ehca_mrmw.c:1908:4: warning: 'prev_pgaddr' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/infiniband/hw/ehca/ehca_mrmw.c:1924:14: note: 'prev_pgaddr' was declared here drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_reg_mr':drivers/infiniband/hw/ehca/ehca_mrmw.c:2430:5: warning: 'hret' may be used uninitialized in this function [-Wmaybe-uninitialized]
The first one is definitely a false positive, the second one may or may not be one. In both cases, adding an intialization is the safe and easy workaround.
The driver was removed in mainline in commit e581d111dad3 ("staging/rdma: remove deprecated ehca driver"), in linux-4.6. In 4.4, the file is located in drivers/staging/rdma/ehca/ehca_mrmw.c, and the fix still applies.
--- drivers/staging/rdma/ehca/ehca_mrmw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rdma/ehca/ehca_mrmw.c +2 -1
@@ -1921,7 +1921,7 @@ static int ehca_set_pagebuf_user2(struct u64 *kpage) {int ret =0 ; -u64 pgaddr, prev_pgaddr; +u64 pgaddr, prev_pgaddr =0 ;u32 j =0 ;int kpages_per_hwpage = pginfo->hwpage_size /PAGE_SIZE ;int nr_kpages = kpages_per_hwpage;
@@ -2417,6 +2417,7 @@ static int ehca_reg_bmap_mr_rpages(strucehca_err (&shca->ib_device,"kpage alloc failed" );return -ENOMEM ; } + hret =H_SUCCESS ;for (top =0 ; top <EHCA_MAP_ENTRIES ; top++) {if (!ehca_bmap_valid (ehca_bmap->top[top]))continue ;
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch queue-4.4/net-tg3-avoid-uninitialized-variable-warning.patch queue-4.4/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch queue-4.4/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch queue-4.4/drbd-avoid-redefinition-of-bits_per_page.patch queue-4.4/ib-ehca-fix-maybe-uninitialized-warnings.patch
PATCH 8/13 tty/isicom: fix big-endian compile warning
In reply to Arnd BergmannCommit f3e2d56dce47dbd0bb3f69f84741b439542fef37 upstream.
Building an arm allmodconfig kernel triggers a lengthy but harmless warning in the isicom driver:
drvers/tty/isicom.c: In function 'isicom_send_break':uapi/linux/swab.h:13:15: warning: integer overflow in expression [-Woverflow]
(((__u16)(x) & (__u16)0x00ffU) << 8) | \
^uapi/linux/swab.h:107:2: note: in expansion of macro '___constant_swab16'
___constant_swab16(x) : \
^uapi/linux/byteorder/big_endian.h:34:43: note: in expansion of macro '__swab16'
#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
^
linux/byteorder/generic.h:89:21: note: in expansion of macro '__cpu_to_le16'
#define cpu_to_le16 __cpu_to_le16
^
include/asm/io.h:270:6: note: in expansion of macro 'cpu_to_le16'
cpu_to_le16(v),__io(p)); })
^drivers/tty/isicom.c:1058:2: note: in expansion of macro 'outw'
outw((length & 0xff00), base);
^
Apparently, the problem is related to the fact that the value 0xff00, when used as a 16-bit number, is negative and passed into bitwise operands of the generic byte swapping code.
Marking the input argument as unsigned in both technically correct and avoids the warning.
--- drivers/tty/isicom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/isicom.c +1 -1
@@ -1055,7 +1055,7 @@ static int isicom_send_break(struct tty_struct *tty, int length)outw (0x8000 | ((port->channel) << (card->shift_count)) |0x3 , base);outw ((length &0xff ) <<8 |0x00 , base); -outw ((length &0xff00 ), base); +outw ((length &0xff00u ), base);InterruptTheCard (base);unlock_card (card);
Signature · 1 line
2.9.0
PATCH 9/13 infiniband: mlx5: avoid a compile-time warning
In reply to Arnd BergmannCommit 7835bfb5261501590a508b3de3379e2231cb4853 upstream.
The return type of find_first_bit() is architecture specific, on ARM it is 'unsigned int', while the asm-generic code used on x86 and a lot of other architectures returns 'unsigned long'.
When building the mlx5 driver on ARM, we get a warning about this:
infiniband/hw/mlx5/mem.c: In function 'mlx5_ib_cont_pages':infiniband/hw/mlx5/mem.c:84:143: warning: comparison of distinct pointer types lacks a cast
m = min(m, find_first_bit(&tmp, sizeof(tmp)));
This patch changes the driver to use min_t to make it behave the same way on all architectures.
--- drivers/infiniband/hw/mlx5/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/mem.c +1 -1
@@ -69,7 +69,7 @@ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, int *count, int *shift,for (k =0 ; k < len; k++) {if (!(i & mask)) { tmp = (unsigned long )pfn; - m =min (m,find_first_bit (&tmp,sizeof (tmp))); + m = min_t(unsigned long, m, find_first_bit(&tmp, sizeof(tmp))); skip =1 << m; mask = skip -1 ; base = pfn;
Signature · 1 line
2.9.0
PATCH 10/13 ips: remove pointless #warning
In reply to Arnd BergmannFrom: James Bottomley <[email protected]>
Commit e03c2da6574223081b786960e39c1e5ecf5d492d upstream.
non-x86 builds want the #warning in the IPS code about compiling on the wrong architecture removed because it keeps triggering on their platforms build farms. Transform from a compile time warning into a runtime one with taint to preserve the original intent of the authors.
--- drivers/scsi/ips.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/scsi/ips.c +5 -4
@@ -206,10 +206,6 @@ module_param(ips, charp, 0);#define IPS_VERSION_HIGH IPS_VER_MAJOR_STRING "." IPS_VER_MINOR_STRING#define IPS_VERSION_LOW "." IPS_VER_BUILD_STRING " " -#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) -#warning "This driver has only been tested on the x86/ia64/x86_64 platforms" -#endif -#define IPS_DMA_DIR (scb) ((!scb->scsi_cmd || ips_is_passthru(scb->scsi_cmd) || \ DMA_NONE == scb->scsi_cmd->sc_data_direction) ? \ PCI_DMA_BIDIRECTIONAL : \
@@ -6789,6 +6785,11 @@ ips_remove_device(struct pci_dev *pci_dev)static int __init ips_module_init (void ) { +#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) +printk (KERN_ERR "ips: This driver has only been tested on the x86/ia64/x86_64 platforms\n" ); +add_taint (TAINT_CPU_OUT_OF_SPEC ,LOCKDEP_STILL_OK ); +#endif +if (pci_register_driver (&ips_pci_driver) <0 )return -ENODEV ; ips_driver_template.module =THIS_MODULE ;
Signature · 1 line
2.9.0
PATCH 11/13 mISDN: avoid arch specific __builtin_return_address call
In reply to Arnd BergmannCommit 3e7a8716e20b759eec0ad88145255bb33174f0c8 upstream.
Not all architectures are able to call __builtin_return_address(). On ARM, the mISDN code produces this warning:
hardware/mISDN/w6692.c: In function 'w6692_dctrl':hardware/mISDN/w6692.c:1181:75: warning: unsupported argument to '__builtin_return_address'
pr_debug("%s: %s dev(%d) open from %p\n", card->name, __func__,
^
hardware/mISDN/mISDNipac.c: In function 'open_dchannel':
hardware/mISDN/mISDNipac.c:759:75: warning: unsupported argument to '__builtin_return_address'
pr_debug("%s: %s dev(%d) open from %p\n", isac->name, __func__,
^In a lot of cases, this is relatively easy to work around by passing the value of __builtin_return_address(0) from the callers into the functions that want it. One exception is the indirect 'open' function call in struct isac_hw. While it would be possible to fix this as well, this patch only addresses the other callers properly and lets this one return the direct parent function, which should be good enough.
--- drivers/isdn/hardware/mISDN/mISDNipac.c | 12 +++++++++--- drivers/isdn/hardware/mISDN/w6692.c | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-)
drivers/isdn/hardware/mISDN/mISDNipac.c +9 -3
@@ -754,10 +754,10 @@ dbusy_timer_handler(struct isac_hw *isac) }static int -open_dchannel (struct isac_hw *isac,struct channel_req *rq) +open_dchannel_caller (struct isac_hw *isac,struct channel_req *rq,void *caller) {pr_debug ("%s: %s dev(%d) open from %p\n" , isac->name, __func__, - isac->dch.dev.id,__builtin_return_address (1 )); + isac->dch.dev.id, caller);if (rq->protocol !=ISDN_P_TE_S0 )return -EINVAL ;if (rq->adr.channel ==1 )
@@ -771,6 +771,12 @@ open_dchannel(struct isac_hw *isac, struct channel_req *rq)return 0 ; } +static int +open_dchannel (struct isac_hw *isac,struct channel_req *rq) +{ +return open_dchannel_caller (isac, rq,__builtin_return_address (0 )); +} +static const char *ISACVer[] = {"2086/2186 V1.1" ,"2085 B1" ,"2085 B2" ,"2085 V2.3" };
@@ -1548,7 +1554,7 @@ ipac_dctrl(struct mISDNchannel *ch, u32 cmd, void *arg)case OPEN_CHANNEL : rq = arg;if (rq->protocol ==ISDN_P_TE_S0 ) - err =open_dchannel (isac, rq); + err =open_dchannel_caller (isac, rq,__builtin_return_address (0 ));else err =open_bchannel (ipac, rq);if (err)
drivers/isdn/hardware/mISDN/w6692.c +3 -3
@@ -1176,10 +1176,10 @@ w6692_l1callback(struct dchannel *dch, u32 cmd) }static int -open_dchannel (struct w6692_hw *card,struct channel_req *rq) +open_dchannel (struct w6692_hw *card,struct channel_req *rq,void *caller) {pr_debug ("%s: %s dev(%d) open from %p\n" , card->name, __func__, - card->dch.dev.id,__builtin_return_address (1 )); + card->dch.dev.id, caller);if (rq->protocol !=ISDN_P_TE_S0 )return -EINVAL ;if (rq->adr.channel ==1 )
@@ -1207,7 +1207,7 @@ w6692_dctrl(struct mISDNchannel *ch, u32 cmd, void *arg)case OPEN_CHANNEL : rq = arg;if (rq->protocol ==ISDN_P_TE_S0 ) - err =open_dchannel (card, rq); + err =open_dchannel (card, rq,__builtin_return_address (0 ));else err =open_bchannel (card, rq);if (err)
Signature · 1 line
2.9.0
PATCH 12/13 arm64: build vdso without libgcov
In reply to Arnd BergmannCommit 543097843ca7c9ac3758d0b5879ea2a6f44089de upstream.
On a cross-toolchain without glibc support, libgcov may not be available, and attempting to build an arm64 kernel with GCOV enabled then results in a build error:
/home/arnd/cross-gcc/lib/gcc/aarch64-linux/5.2.1/../../../../aarch64-linux/bin/ld: cannot find -lgcov
We don't really want to link libgcov into the vdso anyway, so this patch just disables GCOV in the vdso directory, just as we do for most other architectures.
--- arch/arm64/kernel/vdso/Makefile | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/kernel/vdso/Makefile +3 -0
@@ -15,6 +15,9 @@ ccflags-y := -shared -fno-common -fno-builtin ccflags-y += -nostdlib -Wl,-soname=linux-vdso.so.1 \ $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) +# Disable gcov profiling for VDSO code +GCOV_PROFILE := n + # Workaround for bare-metal (ELF) toolchains that neglect to pass -shared # down to collect2, resulting in silent corruption of the vDSO image. ccflags-y += -Wl,-shared
Signature · 1 line
2.9.0
PATCH 13/13 mm/cma: silence warnings due to max() usage
In reply to Arnd BergmannFrom: Stephen Rothwell <[email protected]>
Commit badbda53e505089062e194c614e6f23450bc98b2 upstream.
pageblock_order can be (at least) an unsigned int or an unsigned long depending on the kernel config and architecture, so use max_t(unsigned long, ...) when comparing it.
fixes these warnings:
In file included from include/asm-generic/bug.h:13:0,
from arch/powerpc/include/asm/bug.h:127,
from include/linux/bug.h:4,
from include/linux/mmdebug.h:4,
from include/linux/mm.h:8,
from include/linux/memblock.h:18,
from mm/cma.c:28:mm/cma.c: In function 'cma_init_reserved_mem':include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
(void) (&_max1 == &_max2); ^mm/cma.c:186:27: note: in expansion of macro 'max'
alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);
^mm/cma.c: In function 'cma_declare_contiguous':include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
(void) (&_max1 == &_max2); ^include/linux/kernel.h:747:9: note: in definition of macro 'max'
typeof(y) _max2 = (y); ^mm/cma.c:270:29: note: in expansion of macro 'max'
(phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order));
^include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
(void) (&_max1 == &_max2); ^include/linux/kernel.h:747:21: note: in definition of macro 'max'
typeof(y) _max2 = (y); ^mm/cma.c:270:29: note: in expansion of macro 'max'
(phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order));
^--- mm/cma.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
mm/cma.c +4 -3
@@ -168,7 +168,8 @@ int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size,return -EINVAL ;/* ensure minimal alignment requied by mm core */ - alignment =PAGE_SIZE <<max (MAX_ORDER -1 , pageblock_order); + alignment =PAGE_SIZE << + max_t(unsigned long, MAX_ORDER - 1, pageblock_order);/* alignment should be aligned with order_per_bit */ if (!IS_ALIGNED (alignment >>PAGE_SHIFT ,1 << order_per_bit))
@@ -250,8 +251,8 @@ int __init cma_declare_contiguous(phys_addr_t base,* migratetype page by page allocator's buddy algorithm. In the case, * you couldn't get a contiguous memory, which is not what we want. */ - alignment =max (alignment, - (phys_addr_t )PAGE_SIZE <<max (MAX_ORDER -1 , pageblock_order)); + alignment =max (alignment, (phys_addr_t )PAGE_SIZE << + max_t(unsigned long, MAX_ORDER - 1, pageblock_order)); base =ALIGN (base, alignment); size =ALIGN (size, alignment); limit &= ~(alignment -1 );
Signature · 1 line
2.9.0
Greg KH
maintainerQuoted 11 lines · Arnd Bergmann
Hi Greg,
I've gone through one more set of patches, starting out with Olof's last build report and looking at the configurations that failed in 3.18.51.
I could reproduce most of the warnings on my box, and found a couple of extra ones (one from using newer binutils, and probably one or two from using a newer gcc). With the set of 13 patches, those all seem to be fixed for me now.
Quoted 8 lines
The first half are new patches that I did to fix warnings for code that was removed or rewritten between 3.18 and 4.4, or patches that did not apply cleanly but that I managed to backport anyway. The rest are backports of upstream patches that I didn't see you apply yet. If you already have any of those, just ignore them.
The series also addresses some of the warnings that we saw on the kernelci bot, but some others still remain.
Many thanks for all of these, now all applied.
greg k-h