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

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

From: Zhihao Cheng <chengzhihao1@huawei.com>
Date: 2024-06-04 01:38:17
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, lkml, netdev, nouveau, platform-driver-x86

在 2024/6/2 23:57, Andy Shevchenko 写道:
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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---

Compile tested with `make allyesconfig` and `make allmodconfig`
on x86_64, arm, aarch64, powerpc64 (8 builds total).
[...]
quoted hunk ↗ jump to hunk
diff --git a/fs/ubifs/auth.c b/fs/ubifs/auth.c
index a4a0158f712d..fc0da18bfa65 100644
--- a/fs/ubifs/auth.c
+++ b/fs/ubifs/auth.c
@@ -264,13 +264,13 @@ int ubifs_init_authentication(struct ubifs_info *c)
  		return -EINVAL;
  	}
  
-	c->auth_hash_algo = match_string(hash_algo_name, HASH_ALGO__LAST,
-					 c->auth_hash_name);
-	if ((int)c->auth_hash_algo < 0) {
+	err = __match_string(hash_algo_name, HASH_ALGO__LAST, c->auth_hash_name);
+	if (err < 0) {
  		ubifs_err(c, "Unknown hash algo %s specified",
  			  c->auth_hash_name);
-		return -EINVAL;
+		return err;
  	}
+	c->auth_hash_algo = err;
  
  	snprintf(hmac_name, CRYPTO_MAX_ALG_NAME, "hmac(%s)",
  		 c->auth_hash_name);
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>  # fs/ubifs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help