From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C7051386B9; Tue, 4 Jun 2024 01:38:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717465101; cv=none; b=JvxZkDxHuCb221SvNWLsy7LDyq2/cJhXDesH2TSL0d2EBGAGTmpgf7GkkY58zFmT8ooLBuWWmy/Ax9fz7gI8HfwXBO56ArDiOPAA78FS++EA8yBQ0kjF6nsxCwga3ymGWHxf5nILIHC0n0Dq0CtvSmMi88DvZ4Os2bOPE+1x1l8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717465101; c=relaxed/simple; bh=AJSz8KJObMMDxhywmduW5EuoLxLL09BUaUxOa9QUubw=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=W76wPOqJhcfdB6bDI384qYWr5It8IGNtsF7P3ZiEf2do4DteNys1XNAEj5j60+v6mm0u/CGqeb0nwGs+414yqQsMpnESMXIbwZneeb0x7Kbi/vtHxEGiYG4HQPZLqgd0UOu3U5f8c5+SFb6zgHHWbikoW93g8IYO0vRmjfGZQu4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VtY6M5szWzwRV0; Tue, 4 Jun 2024 09:34:19 +0800 (CST) Received: from kwepemm600013.china.huawei.com (unknown [7.193.23.68]) by mail.maildlp.com (Postfix) with ESMTPS id 7C016180069; Tue, 4 Jun 2024 09:38:14 +0800 (CST) Received: from [10.174.178.46] (10.174.178.46) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 4 Jun 2024 09:38:02 +0800 Subject: Re: [PATCH v1 1/1] treewide: Align match_string() with sysfs_match_string() To: Andy Shevchenko , "Rafael J. Wysocki" , Greg Kroah-Hartman , Corey Minyard , Allen Pais , Sebastian Reichel , Perry Yuan , Giovanni Cabiddu , Herbert Xu , Nuno Sa , Guenter Roeck , Randy Dunlap , Andi Shyti , Heiner Kallweit , Lee Jones , Samuel Holland , Elad Nachman , Arseniy Krasnov , Johannes Berg , Gregory Greenman , Benjamin Berg , Bjorn Helgaas , Robert Richter , Vinod Koul , Chunfeng Yun , Linus Walleij , Hans de Goede , =?UTF-8?Q?Ilpo_J=c3=a4rvinen?= , Nikita Kravets , Jiri Slaby , Srinivas Pandruvada , Stanley Chang , Heikki Krogerus , Abdel Alkuor , Kent Overstreet , Eric Biggers , Kees Cook , Ingo Molnar , "Steven Rostedt (Google)" , Daniel Bristot de Oliveira , Andrew Morton , Hugh Dickins , Abel Wu , John Johansen , Mimi Zohar , Stefan Berger , Roberto Sassu , Eric Snowberg , Takashi Iwai , Takashi Sakamoto , Jiapeng Chong , Mark Brown , Kuninori Morimoto , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N. Rao" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , David Howells , "David S. Miller" , "Rafael J. Wysocki" , Len Brown , Sergey Shtylyov , Damien Le Moal , Niklas Cassel , Daniel Scally , Sakari Ailus , Michael Turquette , Stephen Boyd , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Heiko Stuebner , Peter De Schrijver , Prashant Gaikwad , Thierry Reding , Jonathan Hunter , Huang Rui , "Gautham R. Shenoy" , Mario Limonciello , Viresh Kumar , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , Karol Herbst , Lyude Paul , Danilo Krummrich , Jean Delvare , Alexander Shishkin , Pavel Machek , Chen-Yu Tsai , Jernej Skrabec , Tony Lindgren , Adrian Hunter , Hu Ziji , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Potnuri Bharat Teja , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Miri Korenblit , Kalle Valo , Mahesh J Salgaonkar , Oliver O'Halloran , Kishon Vijay Abraham I , Matthias Brugger , AngeloGioacchino Del Regno , JC Kuo , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Sebastian Reichel , Daniel Lezcano , Zhang Rui , Lukasz Luba , Thinh Nguyen , Helge Deller , Brian Foster , Tejun Heo , Zefan Li , Johannes Weiner , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Masami Hiramatsu , Mathieu Desnoyers , Jason Baron , Jim Cromie , Paul Moore , James Morris , "Serge E. Hallyn" , Dmitry Kasatkin , Clemens Ladisch , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Linus Torvalds References: <20240603211538.289765-1-andriy.shevchenko@linux.intel.com> From: Zhihao Cheng Message-ID: Date: Tue, 4 Jun 2024 09:37:50 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240603211538.289765-1-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600013.china.huawei.com (7.193.23.68) ÔÚ 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 > --- > > Compile tested with `make allyesconfig` and `make allmodconfig` > on x86_64, arm, aarch64, powerpc64 (8 builds total). > [...] > 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 # fs/ubifs