From patchwork Mon Jul 15 13:05:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13733530 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C3E1C3DA4B for ; Mon, 15 Jul 2024 13:07:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E2CD6B00A6; Mon, 15 Jul 2024 09:07:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94B936B00A9; Mon, 15 Jul 2024 09:07:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C4876B00A8; Mon, 15 Jul 2024 09:07:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2FBB26B00A6 for ; Mon, 15 Jul 2024 09:07:57 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C468880DCA for ; Mon, 15 Jul 2024 13:07:56 +0000 (UTC) X-FDA: 82342014552.06.5DC4825 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by imf18.hostedemail.com (Postfix) with ESMTP id 920121C0013 for ; Mon, 15 Jul 2024 13:07:53 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.56 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721048833; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sq+7WffXsw9R2PKkPB/mAhf8aUQXRW8fuR4ejmwJAAM=; b=f6M11IMoaxrMo1RSWxjsv7pG5VDftfNxcEKx6CTg9ZNvt5zQQRN55Txya6YB5/pwYwmesK J0oMp1YBp4XIDmRVwOU/xe7KHJ6UzYiTJmMYf8S3zYT48y41bU6YCufn35dAKml3OXAU76 98ozUhq+HwgfqS1OrK88iGnNmrENd6U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721048833; a=rsa-sha256; cv=none; b=VMIErkRY2RX530x/fXYGZVRCLM6Ng3uAeM5vG09swz0uoT8QH6NMJh0FKNJBF/mim9pKd8 07JZAaWFq8jXXwAe0TK3cRNUmlddWxxLw460CHmpR1X1aWVv8j6Tn8q0deQhkElha4fNgB asOe40V5TdC+Jq04/U9ATs0UOjbyKzw= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.56 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4WN2YN3mrfz4f3jRF for ; Mon, 15 Jul 2024 21:07:36 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 729621A0170 for ; Mon, 15 Jul 2024 21:07:48 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgBHKzkhH5VmjCPSAA--.61776S4; Mon, 15 Jul 2024 21:07:48 +0800 (CST) From: Kemeng Shi To: jack@suse.com Cc: mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, hughd@google.com, akpm@linux-foundation.org, ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/4] quota: remove unneeded return value of register_quota_format Date: Mon, 15 Jul 2024 21:05:32 +0800 Message-Id: <20240715130534.2112678-3-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240715130534.2112678-1-shikemeng@huaweicloud.com> References: <20240715130534.2112678-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgBHKzkhH5VmjCPSAA--.61776S4 X-Coremail-Antispam: 1UD129KBjvJXoWxXFy5WFyUJw13KF1fAr4fZrb_yoWrXF4xpw 1kCrs3tFyrtryDZ3yUXay5ury8W39rWF12vr48A3W2qrn09rW8Ar1UG34FvFy5Cry8Aw1Y qFn5C3W7Cw4jgrJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9Kb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUXw A2048vs2IY020Ec7CjxVAFwI0_Gr0_Xr1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMc Ij6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_ Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2AFwI0_Jw0_GFyl42xK82IYc2Ij64vIr4 1l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK 67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI 8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAv wI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14 v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU2WrWUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 920121C0013 X-Stat-Signature: hz7x5rg66abnfpkobhf5x6wfirh1fo58 X-Rspam-User: X-HE-Tag: 1721048873-402633 X-HE-Meta: U2FsdGVkX1+w51v/udVnpayBDijmx9Ry+/yTqL42uAViph57MHAlRDzTNTU/eEXTkxsMC1BFPBOIDsF7d2iHCM106IoXmGFkCjOI9GnagIk8P/nKssOoCJ1tK0Z5HMvOoiFZQ8WzR6WfyPVcKsvi0QHy3MYuE8xJcV28+ur7XC9G9ZCKFCmO1HpLDyTL9kTWeKgYOOUVA+2mJxIPv4roO8jjcbGCJ3vKr3bVbuP4lohBxI9lqKmkNjBLhVoiE5SbgIki6b6Lnp+DppgAvVmMhGozMHiL79DFcaUfXw2vDP5JdtN2txhMZ16IVBoswoIqaij279sHIPQ92vtXxhlQp7xHt31QUC7f3BGWTSq6DYqjcvI9KOBB+MVCfte5QfA41P0xjXBTmYM75yZlrIHgxOs9e6vs/LNJQVNJZLvioMr2VMFuIOEaofNQnYAPGCN+tLomfZivh1oQL+nEDrsTyQ9lklSK1fOfTstGCtTo0dGQGAnVsFSjOjhgQtCJQfI+AAJWdS2bMxJD8AhpLt42XwrLJGn66eduZYFmA1JvXq8eWwUuNCmsRIM6yJ2FfHAw1w2wBB/YYfU3V6xXwaK5G1p+x1KW9hg9coNkJh/SDnPikTMfauYVuQ6gfBu3yDEMrIUOf+deTK46w8avUATQ93h2jYBe8524Ta541ffkla/L85qyIo4Gt5F8cAJNwHAwjvY9YC1wK0SPcOB9qkY44uqdxeRYYUcBK5gfM/HaFx0H4WwJTmukhYvU0eT42V7zsQew5EJ2jiAKKdazm5mjyyhOmN5Lcq27rm0bk/7AhmSnOKRS3JX91ynS5NKsKh4rFnc8y333sfinUcKZeYLq8kfXlNUTPdc9qzPMdo/sk5Vj/IZVJYf1iIbSNRfrPP8TmZ787RjdHQaeZ0JLiAW2iWfmqjj9H9LTrdcPmrUWwzoMf1eFf+ueJEnEDksJItNO71Jbv8lA55Wog7Sl1vj +SVSvqDw 9waKi7YmnjLXVBVZ5Q4fXp80ZmkSSNARohudiOpD0rxfcW04cJZR6BYPxEgcgJx8ixGnPl080Ah8gClvnBRTNiCGBdBwHBqGjSaxEEKmtQ8/4ugEhxaZ0oalxwGimk1p1R2maT0Q7DIBdlcg2FJ73aPDhn4wiIokK/TFmvJR/3QdtNRXnDM3WyLMR7Qgxjy8fCocGg+aXH7utJQp8b3TYAaklkg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The register_quota_format always returns 0, simply remove unneeded return value. Signed-off-by: Kemeng Shi Reviewed-by: Joseph Qi --- fs/ocfs2/super.c | 6 ++---- fs/quota/dquot.c | 3 +-- fs/quota/quota_v1.c | 3 ++- fs/quota/quota_v2.c | 9 +++------ include/linux/quota.h | 2 +- mm/shmem.c | 7 +------ 6 files changed, 10 insertions(+), 20 deletions(-) diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index afee70125ae3..73caa8914ebe 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -1571,15 +1571,13 @@ static int __init ocfs2_init(void) ocfs2_set_locking_protocol(); - status = register_quota_format(&ocfs2_quota_format); - if (status < 0) - goto out3; + register_quota_format(&ocfs2_quota_format); + status = register_filesystem(&ocfs2_fs_type); if (!status) return 0; unregister_quota_format(&ocfs2_quota_format); -out3: debugfs_remove(ocfs2_debugfs_root); ocfs2_free_mem_caches(); out2: diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 23fcf9e9d6c5..a08a71890cd8 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -163,13 +163,12 @@ static struct quota_module_name module_names[] = INIT_QUOTA_MODULE_NAMES; /* SLAB cache for dquot structures */ static struct kmem_cache *dquot_cachep; -int register_quota_format(struct quota_format_type *fmt) +void register_quota_format(struct quota_format_type *fmt) { spin_lock(&dq_list_lock); fmt->qf_next = quota_formats; quota_formats = fmt; spin_unlock(&dq_list_lock); - return 0; } EXPORT_SYMBOL(register_quota_format); diff --git a/fs/quota/quota_v1.c b/fs/quota/quota_v1.c index 3f3e8acc05db..6f7f0b4afba9 100644 --- a/fs/quota/quota_v1.c +++ b/fs/quota/quota_v1.c @@ -235,7 +235,8 @@ static struct quota_format_type v1_quota_format = { static int __init init_v1_quota_format(void) { - return register_quota_format(&v1_quota_format); + register_quota_format(&v1_quota_format); + return 0; } static void __exit exit_v1_quota_format(void) diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index c48c233f3bef..1fda93dcbc1b 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -440,12 +440,9 @@ static struct quota_format_type v2r1_quota_format = { static int __init init_v2_quota_format(void) { - int ret; - - ret = register_quota_format(&v2r0_quota_format); - if (ret) - return ret; - return register_quota_format(&v2r1_quota_format); + register_quota_format(&v2r0_quota_format); + register_quota_format(&v2r1_quota_format); + return 0; } static void __exit exit_v2_quota_format(void) diff --git a/include/linux/quota.h b/include/linux/quota.h index 07071e64abf3..89a0d83ddad0 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -526,7 +526,7 @@ struct quota_info { const struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ }; -int register_quota_format(struct quota_format_type *fmt); +void register_quota_format(struct quota_format_type *fmt); void unregister_quota_format(struct quota_format_type *fmt); struct quota_module_name { diff --git a/mm/shmem.c b/mm/shmem.c index a8b181a63402..d27104e1af9b 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -4660,11 +4660,7 @@ void __init shmem_init(void) shmem_init_inodecache(); #ifdef CONFIG_TMPFS_QUOTA - error = register_quota_format(&shmem_quota_format); - if (error < 0) { - pr_err("Could not register quota format\n"); - goto out3; - } + register_quota_format(&shmem_quota_format); #endif error = register_filesystem(&shmem_fs_type); @@ -4693,7 +4689,6 @@ void __init shmem_init(void) out2: #ifdef CONFIG_TMPFS_QUOTA unregister_quota_format(&shmem_quota_format); -out3: #endif shmem_destroy_inodecache(); shm_mnt = ERR_PTR(error);