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 3CFD4C001DB for ; Sun, 13 Aug 2023 16:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234024AbjHMQXq (ORCPT ); Sun, 13 Aug 2023 12:23:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233945AbjHMQX0 (ORCPT ); Sun, 13 Aug 2023 12:23:26 -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 9C3FB30FB; Sun, 13 Aug 2023 09:13:52 -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 7969A63BB5; Sun, 13 Aug 2023 16:12:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43CEDC433C7; Sun, 13 Aug 2023 16:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691943176; bh=/zpPF214Fv93fyfiVP9v3cH37LRpq22auAxVvW+W0QQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vGSl1PV1qJPtTaUjEd8YBvsa5acRcpl2B6mpLsYhbT8BdtHLQfnoD3tZFfzfFiWao d0W1KwZv8hnc9++VOevtAWqc0yLD1vDKuy/14XzJKsVdjtiNVcmYFtF+PJqN1PPL2d wvkzMIihlks0U0ZfSygm7qroqmkfrEAp88ynPLDLAmJEqY3ynqQLTcmyFiUdO9EogT /kuXEHuFWDgNlpFBSx7Nb65BAjuSLi2XNY1DXntev+k12TC5COuM6F3reB2r4VS8yf jEardPDLWv3e40docq1cz8S2Nd/dWCyI7+vgx/yLNv9FmktPgf1J3wEi9WRGeJTDuI SveFAQ9byXT3Q== 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 5.4 09/14] fs/nls: make load_nls() take a const parameter Date: Sun, 13 Aug 2023 12:11:57 -0400 Message-Id: <20230813161202.1086004-9-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230813161202.1086004-1-sashal@kernel.org> References: <20230813161202.1086004-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.4.253 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