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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15CE8C43466 for ; Mon, 21 Sep 2020 02:03:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 299DE207C3 for ; Mon, 21 Sep 2020 02:03:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 299DE207C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 415DD900017; Sun, 20 Sep 2020 22:03:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 39DB9900009; Sun, 20 Sep 2020 22:03:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 264BA900017; Sun, 20 Sep 2020 22:03:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id 05EBC900009 for ; Sun, 20 Sep 2020 22:03:00 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id BA8B73624 for ; Mon, 21 Sep 2020 02:02:59 +0000 (UTC) X-FDA: 77285420478.23.goose88_430782e27141 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 98F4D37604 for ; Mon, 21 Sep 2020 02:02:59 +0000 (UTC) X-HE-Tag: goose88_430782e27141 X-Filterd-Recvd-Size: 2928 Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Mon, 21 Sep 2020 02:02:58 +0000 (UTC) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 969C04D159F87F639888; Mon, 21 Sep 2020 10:02:55 +0800 (CST) Received: from mdc.huawei.com (10.175.112.208) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Mon, 21 Sep 2020 10:02:47 +0800 From: Chen Jun To: , CC: , , , Subject: [PATCH -next 1/5] mm/kmemleak: make create_object return void Date: Mon, 21 Sep 2020 02:00:03 +0000 Message-ID: <20200921020007.35803-2-chenjun102@huawei.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200921020007.35803-1-chenjun102@huawei.com> References: <20200921020007.35803-1-chenjun102@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.208] X-CFilter-Loop: Reflected Content-Transfer-Encoding: quoted-printable 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: From: Wei Yongjun No user cares about the return value of create_object, so make it return void. Signed-off-by: Wei Yongjun Signed-off-by: Chen Jun --- mm/kmemleak.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index c0014d3b91c1..b3f603fd9fc3 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -567,8 +567,8 @@ static int __save_stack_trace(unsigned long *trace) * Create the metadata (struct kmemleak_object) corresponding to an allo= cated * memory block and add it to the object_list and object_tree_root. */ -static struct kmemleak_object *create_object(unsigned long ptr, size_t s= ize, - int min_count, gfp_t gfp) +static void create_object(unsigned long ptr, size_t size, int min_count, + gfp_t gfp) { unsigned long flags; struct kmemleak_object *object, *parent; @@ -579,7 +579,7 @@ static struct kmemleak_object *create_object(unsigned= long ptr, size_t size, if (!object) { pr_warn("Cannot allocate a kmemleak_object structure\n"); kmemleak_disable(); - return NULL; + return; } =20 INIT_LIST_HEAD(&object->object_list); @@ -640,7 +640,6 @@ static struct kmemleak_object *create_object(unsigned= long ptr, size_t size, */ dump_object_info(parent); kmem_cache_free(object_cache, object); - object =3D NULL; goto out; } } @@ -650,7 +649,6 @@ static struct kmemleak_object *create_object(unsigned= long ptr, size_t size, list_add_tail_rcu(&object->object_list, &object_list); out: raw_spin_unlock_irqrestore(&kmemleak_lock, flags); - return object; } =20 /* --=20 2.25.0