Patch "cpumask: Add helper cpumask_available()" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
cpumask: Add helper cpumask_available()
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:
cpumask-add-helper-cpumask_available.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
f7e30f01a9e221067bb4b579e3cfc25cd2617467Mon Sep 17 00:00:00 2001
From: Matthias Kaehlcke <[email protected]>
Date: Wed, 12 Apr 2017 11:20:29 -0700
Subject: cpumask: Add helper cpumask_available()
From: Matthias Kaehlcke <[email protected]>
commit f7e30f01a9e221067bb4b579e3cfc25cd2617467 upstream.
With CONFIG_CPUMASK_OFFSTACK=y cpumask_var_t is a struct cpumask pointer, otherwise a struct cpumask array with a single element.
Some code dealing with cpumasks needs to validate that a cpumask_var_t is not a NULL pointer when CONFIG_CPUMASK_OFFSTACK=y. This is typically done by performing the check always, regardless of the underlying type of cpumask_var_t. This works in both cases, however clang raises a warning like this when CONFIG_CPUMASK_OFFSTACK=n:
kernel/irq/manage.c:839:28: error: address of array 'desc->irq_common_data.affinity' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
Add the inline helper cpumask_available() which only performs the pointer check if CONFIG_CPUMASK_OFFSTACK=y.
--- include/linux/cpumask.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
include/linux/cpumask.h +10 -0
@@ -661,6 +661,11 @@ void alloc_bootmem_cpumask_var(cpumask_vvoid free_cpumask_var (cpumask_var_t mask);void free_bootmem_cpumask_var (cpumask_var_t mask); +static inline bool cpumask_available (cpumask_var_t mask) +{ +return mask !=NULL ; +} +#else typedef struct cpumask cpumask_var_t [1 ];
@@ -701,6 +706,11 @@ static inline void free_cpumask_var(cpumstatic inline void free_bootmem_cpumask_var (cpumask_var_t mask) { } + +static inline bool cpumask_available (cpumask_var_t mask) +{ +return true; +}#endif /* CONFIG_CPUMASK_OFFSTACK */ /* It's common to want to use cpu_all_mask in struct member initializers,
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/dm-ioctl-remove-double-parentheses.patch queue-4.4/genirq-use-cpumask_available-for-check-of-cpumask-variable.patch queue-4.4/fs-compat-remove-warning-from-compatible_ioctl.patch queue-4.4/selinux-remove-unnecessary-check-of-array-base-in-selinux_set_mapping.patch queue-4.4/pci-make-pci_rom_address_mask-a-32-bit-constant.patch queue-4.4/cpumask-add-helper-cpumask_available.patch