[PATCH 3/3][V2] lib: re-introduce new match_string() helper/macro

2019-05-28 Thread Alexandru Ardelean
reviewed by each subsystem. Signed-off-by: Alexandru Ardelean --- include/linux/string.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/string.h b/include/linux/string.h index 7149fcdf62df..34491b075449 100644 --- a/include/linux/string.h +++ b/include/linux/string.h

[PATCH 2/3][V2] treewide: rename match_string() -> __match_string()

2019-05-28 Thread Alexandru Ardelean
differs. Signed-off-by: Alexandru Ardelean --- arch/powerpc/xmon/xmon.c | 2 +- arch/x86/kernel/cpu/mtrr/if.c| 2 +- drivers/ata/pata_hpt366.c| 2 +- drivers/ata/pata_hpt37x.c| 2 +- drivers/base/d

[PATCH 1/3][V2] lib: fix match_string() helper on -1 array size

2019-05-28 Thread Alexandru Ardelean
doing some cosmetic changes, which are aimed at grouping the users of `match_string()`. Signed-off-by: Alexandru Ardelean --- Changelog v1 -> v2: * split the initial series into just 3 patches that fix the `match_string()` helper and start introducing a new version of this helper, wh

[PATCH 15/16] video: fbdev: pxafb: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
The `lcd_types` array is a static array of strings. Using match_string() (which computes the array size via ARRAY_SIZE()) is possible. This reduces the array by 1 element, since the NULL (at the end of the array) is no longer needed. Signed-off-by: Alexandru Ardelean --- drivers/video/fbdev

[PATCH 11/16] mm/vmpressure.c: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
computed automatically, which would only help if they ever get expanded. Signed-off-by: Alexandru Ardelean --- mm/vmpressure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/vmpressure.c b/mm/vmpressure.c index d43f33139568..b8149924f078 100644 --- a/mm/vmpressure.c

[PATCH 16/16] sched: debug: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
The `sched_feat_names` array is a static array of strings. Using match_string() (which computes the array size via ARRAY_SIZE()) is possible. The change is mostly cosmetic. No functionality change. Signed-off-by: Alexandru Ardelean --- kernel/sched/debug.c | 2 +- 1 file changed, 1 insertion

[PATCH 14/16] staging: gdm724x: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
The `DRIVER_STRING` array is a static array of strings. Using match_string() (which computes the array size via ARRAY_SIZE()) is possible. The change is mostly cosmetic. No functionality change. Signed-off-by: Alexandru Ardelean --- drivers/staging/gdm724x/gdm_tty.c | 3 +-- 1 file changed, 1

[PATCH 13/16] drm/edid: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
The `generic_edid_name` is a static array of strings. Using match_string() (which computes the array size via ARRAY_SIZE()) is possible. The change is mostly cosmetic. No functionality change. Signed-off-by: Alexandru Ardelean --- drivers/gpu/drm/drm_edid_load.c | 2 +- 1 file changed, 1

[PATCH 12/16] rdmacg: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
The `rdmacg_resource_names` array is a static array of strings. Using match_string() (which computes the array size via ARRAY_SIZE()) is possible. The change is mostly cosmetic. No functionality change. Signed-off-by: Alexandru Ardelean --- kernel/cgroup/rdma.c | 2 +- 1 file changed, 1

[PATCH 10/16] pinctrl: armada-37xx: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
-by: Alexandru Ardelean --- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c index 07a5bcaa0067..68b0db5ef5e9 100644 --- a/drivers/pinc

[PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
The change is also cosmetic, but it also does a tighter coupling between the enums & the string values. This way, the ARRAY_SIZE(phy_types) that is implicitly done in the match_string() macro is also a bit safer. Signed-off-by: Alexandru Ardelean --- drivers/mmc/host/sdhci-xenon-phy.c

[PATCH 08/16] cpufreq/intel_pstate: remove NULL entry + use match_string()

2019-05-08 Thread Alexandru Ardelean
The change is mostly cosmetic. The `energy_perf_strings` array is static, so match_string() can be used (which will implicitly do a ARRAY_SIZE(energy_perf_strings)). The only small benefit here, is the reduction of the array size by 1 element. Signed-off-by: Alexandru Ardelean --- drivers

[PATCH 07/16] device connection: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
struct), so using the match_string() (which does an ARRAY_SIZE((con->endpoint)) should be fine. The recent change to match_string() (to ignore NULL entries up to the size of the array) shouldn't affect this. Signed-off-by: Alexandru Ardelean --- drivers/base/devcon.c | 2 +- 1 file ch

[PATCH 06/16] x86/mtrr: use new match_string() helper + add gaps == minor fix

2019-05-08 Thread Alexandru Ardelean
n't), but this fixes that. Signed-off-by: Alexandru Ardelean --- arch/x86/kernel/cpu/mtrr/if.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c index 4ec7a5f7b94c..e67820a044cc 100644 --- a/arch/x86/kerne

[PATCH 05/16] ALSA: oxygen: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
and ignore the NULL. Signed-off-by: Alexandru Ardelean --- sound/pci/oxygen/oxygen_mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 13c2fb75fd71..961fd1cbc712 100644 --- a/sound/pci/oxygen

[PATCH 04/16] powerpc/xmon: use new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
NULL. This would technically allow for "reserved" regs, though here it's not the case. Signed-off-by: Alexandru Ardelean --- arch/powerpc/xmon/xmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c ind

[PATCH 03/16] lib,treewide: add new match_string() helper/macro

2019-05-08 Thread Alexandru Ardelean
This change re-introduces `match_string()` as a macro that uses ARRAY_SIZE() to compute the size of the array. The macro is added in all the places that do `match_string(_a, ARRAY_SIZE(_a), s)`, since the change is pretty straightforward. Signed-off-by: Alexandru Ardelean --- drivers/clk/bcm

[PATCH 02/16] treewide: rename match_string() -> __match_string()

2019-05-08 Thread Alexandru Ardelean
ositive value does not make any difference: the iteration will stop at the first NULL element. Signed-off-by: Alexandru Ardelean --- arch/powerpc/xmon/xmon.c | 2 +- arch/x86/kernel/cpu/mtrr/if.c| 2 +- drivers/ata/pata_h

[PATCH 00/16] treewide: fix match_string() helper when array size

2019-05-08 Thread Alexandru Ardelean
ge-able way. The first patch is important, the others can be dropped. Signed-off-by: Alexandru Ardelean Alexandru Ardelean (16): lib: fix match_string() helper when array size is positive treewide: rename match_string() -> __match_string() lib,treewide: add new match_string() helper/mac

[PATCH 01/16] lib: fix match_string() helper when array size is positive

2019-05-08 Thread Alexandru Ardelean
in the series will focus on doing some cosmetic changes, which are aimed at grouping the users of `match_string()`. Signed-off-by: Alexandru Ardelean --- lib/string.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/string.c b/lib/string.c index 3ab861c1a857

[PATCH 01/16] lib: fix match_string() helper on -1 array size

2019-05-08 Thread Alexandru Ardelean
doing some cosmetic changes, which are aimed at grouping the users of `match_string()`. Signed-off-by: Alexandru Ardelean --- lib/string.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/string.c b/lib/string.c index 3ab861c1a857..76edb7bf76cb 100644 --- a/lib