Thread (18 messages) 18 messages, 18 authors, 2024-06-10

Re: [PATCH v1 1/1] treewide: Align match_string() with sysfs_match_string()

From: Bjorn Helgaas <helgaas@kernel.org>
Date: 2024-06-03 22:00:35
Also in: alsa-devel, cgroups, dri-devel, intel-gfx, intel-xe, keyrings, linux-acpi, linux-bcachefs, linux-clk, linux-crypto, linux-fbdev, linux-gpio, linux-hardening, linux-hwmon, linux-i2c, linux-ide, linux-integrity, linux-leds, linux-mediatek, linux-mm, linux-mmc, linux-omap, linux-pci, linux-phy, linux-pm, linux-rockchip, linux-security-module, linux-sound, linux-staging, linux-sunxi, linux-tegra, linux-trace-kernel, linux-usb, linux-wireless, linuxppc-dev, lkml, nouveau, platform-driver-x86

On Sun, Jun 02, 2024 at 06:57:12PM +0300, Andy Shevchenko wrote:
Make two APIs look similar. Hence convert match_string() to be
a 2-argument macro. In order to avoid unneeded churn, convert
all users as well. There is no functional change intended.
Looks nice, thanks for doing this.
quoted hunk ↗ jump to hunk
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index ac6293c24976..2d317c7e1cea 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -210,7 +210,7 @@ void pcie_ecrc_get_policy(char *str)
 {
 	int i;
 
-	i = match_string(ecrc_policy_str, ARRAY_SIZE(ecrc_policy_str), str);
+	i = match_string(ecrc_policy_str, str);
 	if (i < 0)
 		return;
 
Acked-by: Bjorn Helgaas <bhelgaas@google.com>	# drivers/pci/
quoted hunk ↗ jump to hunk
+++ b/mm/vmpressure.c
@@ -388,7 +388,7 @@ int vmpressure_register_event(struct mem_cgroup *memcg,
 
 	/* Find required level */
 	token = strsep(&spec, ",");
-	ret = match_string(vmpressure_str_levels, VMPRESSURE_NUM_LEVELS, token);
+	ret = match_string(vmpressure_str_levels, token);
VMPRESSURE_NUM_LEVELS looks like it's no longer used?
quoted hunk ↗ jump to hunk
 	if (ret < 0)
 		goto out;
 	level = ret;
@@ -396,7 +396,7 @@ int vmpressure_register_event(struct mem_cgroup *memcg,
 	/* Find optional mode */
 	token = strsep(&spec, ",");
 	if (token) {
-		ret = match_string(vmpressure_str_modes, VMPRESSURE_NUM_MODES, token);
+		ret = match_string(vmpressure_str_modes, token);
Ditto.
 		if (ret < 0)
 			goto out;
 		mode = ret;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help