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 7AA18C636D4 for ; Wed, 15 Feb 2023 17:01:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229960AbjBORBM (ORCPT ); Wed, 15 Feb 2023 12:01:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjBORBI (ORCPT ); Wed, 15 Feb 2023 12:01:08 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B563B303FB; Wed, 15 Feb 2023 09:01:07 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6588FB8225F; Wed, 15 Feb 2023 17:01:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F248C433D2; Wed, 15 Feb 2023 17:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676480465; bh=7NDzIefEbXiIJCEib3sr7gh8/H2KcWsCHwSr/TU1F/Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a4CMP6ci0CdBOLo61RbH7msCByorysRMQT3XacNFmZxBVNn13P0YBA55+Me8718LR MjhlwFdtHhCSCp7P2mrAUoMjqq6+wFMMt+EB2LQ7rr7wo4PVq0YilbODEqJITiBV+z zXdi5HOpF7mTI1DXK+QeTWSIr2HUVQx83rASNGuK1DdkLLO+6zcIxcxPvyEbX8puD3 cOvy9O5Yq4LdWQ1YMP4/CQ0KZgu16x4tgvy9hrUCS1xMr1JhO3SpJuWK1ZlmufGfNA YghVak6aTAD9SSZG/BiZnKEvJKt+QCIzDhCXsRdFBOJha++g9k6AIZlgRHWyFwNHkR N3Z4Ih9RVJPTA== Date: Wed, 15 Feb 2023 10:01:02 -0700 From: Nathan Chancellor To: Chris Down Cc: Jiapeng Chong , mcgrof@kernel.org, ndesaulniers@google.com, trix@redhat.com, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev, Abaci Robot Subject: Re: [PATCH] module: Remove the unused function within Message-ID: References: <20230210064243.116335-1-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 15, 2023 at 04:47:44PM +0000, Chris Down wrote: > Jiapeng Chong writes: > > The function within is defined in the main.c file, but not called > > elsewhere, so remove this unused function. > > Huh? It's used by __module_text_address(), no? Not after commit 2ece476a2346 ("module: replace module_layout with module_memory") in -next. This patch should have a fixes tag, even if the warning is currently hidden behind W=1. > > kernel/module/main.c:3007:19: warning: unused function 'within'. > > > > Reported-by: Abaci Robot > > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4035 > > Signed-off-by: Jiapeng Chong > > --- > > kernel/module/main.c | 5 ----- > > 1 file changed, 5 deletions(-) > > > > diff --git a/kernel/module/main.c b/kernel/module/main.c > > index c598f11e7016..062065568b40 100644 > > --- a/kernel/module/main.c > > +++ b/kernel/module/main.c > > @@ -3004,11 +3004,6 @@ SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags) > > return load_module(&info, uargs, flags); > > } > > > > -static inline int within(unsigned long addr, void *start, unsigned long size) > > -{ > > - return ((void *)addr >= start && (void *)addr < start + size); > > -} > > - > > /* Keep in sync with MODULE_FLAGS_BUF_SIZE !!! */ > > char *module_flags(struct module *mod, char *buf, bool show_state) > > { > > -- > > 2.20.1.7.g153144c > >