From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DAF1C001B0 for ; Sun, 13 Aug 2023 15:52:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231701AbjHMPwE (ORCPT ); Sun, 13 Aug 2023 11:52:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231756AbjHMPv4 (ORCPT ); Sun, 13 Aug 2023 11:51:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F8502696; Sun, 13 Aug 2023 08:51:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A34B2632BC; Sun, 13 Aug 2023 15:51:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D111C433C8; Sun, 13 Aug 2023 15:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691941860; bh=/zpPF214Fv93fyfiVP9v3cH37LRpq22auAxVvW+W0QQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lem4+ZjMl4balwLdpcCPuQODq+StGnxdbbGxn8sA0qpCkjzN/P+5qoSZnb9zH/OcK yf1K+Z82l4pd6686IQWP6vWfSpaHjyLn3dG0cVm/Q5aujdChwFWl28v4sxuV52M1+k YlgyURslQsO2xOASOrvGhrcT0mIPPJF5ewtLxCI5YFBgb7UVHjYDUsHV5WIXxSeVit QNAH+DR9sefaNt4njYlDw/TzJiZjLpo3PAmTiefjJj1xp5KT3ScitJkAxyF6ubc1k+ XHLZKUL1Kq7cu0XQwpTzqFPM0nQzAoMqXaUjnFr94qxC7+vS5zc4kbnyH9gZYkINfO amIM4zcYizpGQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Winston Wen , Stephen Rothwell , Paulo Alcantara , Christian Brauner , Steve French , Sasha Levin Subject: [PATCH AUTOSEL 6.4 26/54] fs/nls: make load_nls() take a const parameter Date: Sun, 13 Aug 2023 11:49:05 -0400 Message-Id: <20230813154934.1067569-26-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230813154934.1067569-1-sashal@kernel.org> References: <20230813154934.1067569-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.4.10 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Winston Wen [ Upstream commit c1ed39ec116272935528ca9b348b8ee79b0791da ] load_nls() take a char * parameter, use it to find nls module in list or construct the module name to load it. This change make load_nls() take a const parameter, so we don't need do some cast like this: ses->local_nls = load_nls((char *)ctx->local_nls->charset); Suggested-by: Stephen Rothwell Signed-off-by: Winston Wen Reviewed-by: Paulo Alcantara Reviewed-by: Christian Brauner Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/nls/nls_base.c | 4 ++-- include/linux/nls.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c index 52ccd34b1e792..a026dbd3593f6 100644 --- a/fs/nls/nls_base.c +++ b/fs/nls/nls_base.c @@ -272,7 +272,7 @@ int unregister_nls(struct nls_table * nls) return -EINVAL; } -static struct nls_table *find_nls(char *charset) +static struct nls_table *find_nls(const char *charset) { struct nls_table *nls; spin_lock(&nls_lock); @@ -288,7 +288,7 @@ static struct nls_table *find_nls(char *charset) return nls; } -struct nls_table *load_nls(char *charset) +struct nls_table *load_nls(const char *charset) { return try_then_request_module(find_nls(charset), "nls_%s", charset); } diff --git a/include/linux/nls.h b/include/linux/nls.h index 499e486b3722d..e0bf8367b274a 100644 --- a/include/linux/nls.h +++ b/include/linux/nls.h @@ -47,7 +47,7 @@ enum utf16_endian { /* nls_base.c */ extern int __register_nls(struct nls_table *, struct module *); extern int unregister_nls(struct nls_table *); -extern struct nls_table *load_nls(char *); +extern struct nls_table *load_nls(const char *charset); extern void unload_nls(struct nls_table *); extern struct nls_table *load_nls_default(void); #define register_nls(nls) __register_nls((nls), THIS_MODULE) -- 2.40.1