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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEB97C433F5 for ; Wed, 20 Apr 2022 17:46:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 674056B0073; Wed, 20 Apr 2022 13:46:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 623946B0074; Wed, 20 Apr 2022 13:46:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C46C6B0075; Wed, 20 Apr 2022 13:46:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 3D7D46B0073 for ; Wed, 20 Apr 2022 13:46:41 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1E40A22CC5 for ; Wed, 20 Apr 2022 17:46:41 +0000 (UTC) X-FDA: 79377987402.26.8A903C5 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf25.hostedemail.com (Postfix) with ESMTP id 0AE95A0022 for ; Wed, 20 Apr 2022 17:46:37 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5651F21115; Wed, 20 Apr 2022 17:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1650476799; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tPKj1rP2AQLJCqCkLIk+hRWAp78yyekfr57wPaz0OuY=; b=WgXu1WO4DQaQcLt/m6WI0ZwRBQtftWuEk9Ku29SMuhf7mbEwKSeHzNApe03ApLHrL6rVYN G+bZ3ZZ1PGggIK9Yp27+6r/yvqD+9OvpiYnCoqjaO/dNYAXClLuSQ6s0oLh3lpvn+Vp2Az B/o6PcbEwbWQaoXQ7C9sf8OWsHOZaYc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1650476799; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tPKj1rP2AQLJCqCkLIk+hRWAp78yyekfr57wPaz0OuY=; b=5hbhob32n4hrYjFGAsS1tWcunZrB6GlAXGIbW/JGzO2BN7/UfV+mX9uCBZA1ih0EM485hN shfyfZmonLcMv5Bw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3133313AD5; Wed, 20 Apr 2022 17:46:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id E4guC/9GYGK0awAAMHmgww (envelope-from ); Wed, 20 Apr 2022 17:46:39 +0000 Message-ID: <97a82c11-128d-94a7-d874-a3fbebcce64c@suse.cz> Date: Wed, 20 Apr 2022 19:46:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] mm/slub: remove unneeded return value of slab_pad_check Content-Language: en-US To: Miaohe Lin , cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org Cc: roman.gushchin@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220419120352.37825-1-linmiaohe@huawei.com> From: Vlastimil Babka In-Reply-To: <20220419120352.37825-1-linmiaohe@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 0AE95A0022 X-Stat-Signature: hy1bdz159njao49foetwx6s1m9oxz1yc Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=WgXu1WO4; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=5hbhob32; spf=pass (imf25.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspam-User: X-HE-Tag: 1650476797-768257 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: On 4/19/22 14:03, Miaohe Lin wrote: > The return value of slab_pad_check is never used. So we can make it return > void now. > > Signed-off-by: Miaohe Lin Added, thanks. > --- > mm/slub.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) > > diff --git a/mm/slub.c b/mm/slub.c > index 6dc703488d30..1f699ddfff7f 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -1017,7 +1017,7 @@ static int check_pad_bytes(struct kmem_cache *s, struct slab *slab, u8 *p) > } > > /* Check the pad bytes at the end of a slab page */ > -static int slab_pad_check(struct kmem_cache *s, struct slab *slab) > +static void slab_pad_check(struct kmem_cache *s, struct slab *slab) > { > u8 *start; > u8 *fault; > @@ -1027,21 +1027,21 @@ static int slab_pad_check(struct kmem_cache *s, struct slab *slab) > int remainder; > > if (!(s->flags & SLAB_POISON)) > - return 1; > + return; > > start = slab_address(slab); > length = slab_size(slab); > end = start + length; > remainder = length % s->size; > if (!remainder) > - return 1; > + return; > > pad = end - remainder; > metadata_access_enable(); > fault = memchr_inv(kasan_reset_tag(pad), POISON_INUSE, remainder); > metadata_access_disable(); > if (!fault) > - return 1; > + return; > while (end > fault && end[-1] == POISON_INUSE) > end--; > > @@ -1050,7 +1050,6 @@ static int slab_pad_check(struct kmem_cache *s, struct slab *slab) > print_section(KERN_ERR, "Padding ", pad, remainder); > > restore_bytes(s, "slab padding", POISON_INUSE, fault, end); > - return 0; > } > > static int check_object(struct kmem_cache *s, struct slab *slab, > @@ -1642,8 +1641,7 @@ static inline int free_debug_processing( > void *head, void *tail, int bulk_cnt, > unsigned long addr) { return 0; } > > -static inline int slab_pad_check(struct kmem_cache *s, struct slab *slab) > - { return 1; } > +static inline void slab_pad_check(struct kmem_cache *s, struct slab *slab) {} > static inline int check_object(struct kmem_cache *s, struct slab *slab, > void *object, u8 val) { return 1; } > static inline void add_full(struct kmem_cache *s, struct kmem_cache_node *n,