Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6969952rwb; Wed, 18 Jan 2023 11:40:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXtr4/yrQJIWDywnNUCT3ZT492mnC6tHgXnkHpayEqgRHGg8d9KonMs8/GmGqLYGK2b78Kz7 X-Received: by 2002:a17:903:2441:b0:194:4483:bff6 with SMTP id l1-20020a170903244100b001944483bff6mr12234817pls.68.1674070802232; Wed, 18 Jan 2023 11:40:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674070802; cv=none; d=google.com; s=arc-20160816; b=SY7X6OjPk3cy5r1PCxFLaqJDAeQwxAulQKiGA9JdoAGif8lu183Cft50DaIkIVvALz Vglj0O392n69qcIMqC4aHjWYE5bedH2QGrQ7tv3AgwnLCIt7AB2dwCyQzBLV+qacuc4x BUWt6ezCnuSWULrbSSxUl+jr5LABjZSJPrQSZ72UUpmX3pmyL0QV3Or8O4UW5ShRhQo1 gUaJpaiLEp+KU2WVXjAt70qOF2CRrYfcNgT4BW0fTmMGruHzVbH/LEXE4G4LyM7WSdP9 ExA0h/AMXZAczpb6PEVx12lfxJQhQZAl6bRZjd5zqZXFQPX/n/F5y7oKgQ002lwNuC3u pdBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gw2OqH8svh6Y9ZQ3ZoPeYoQ8UKFhnjhW8PRKbQptBoM=; b=jBdzfV5dvQ3Im10ZBJu4W1YFwf7WOf8b9CBFM3MMXsN1B5xY6NQy9cNB2EyYBsbOdL T9p7uJaS/5zOq4TJM7yhfxP/HqQu+mcZwxf5G/L3dtSW3YtJ82DaUQ+V2pqZ3RhevqZ5 Ao4d5nQOv1V6XMcLWMTHBgImyM8Mfs32s65P3bGvYQvZn1iTD2d6bYcy47BncLsKUTYY r1q6aQ/0xOlAIEZGABrMAJ2KcYDjUZLkqexBG1X8ZLPQpHKZHNAo7iO9wYyFVl5rKfsQ dO9QwF8boxAFm2qiEF0+uFBvVQoSfUQ4vD5m5MWBwxJErxmyMKqRnOOe+xFI4vxvSB7D OX+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TMiWMlpw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g2-20020a170902c38200b0019489437a80si11430015plg.144.2023.01.18.11.39.56; Wed, 18 Jan 2023 11:40:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TMiWMlpw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbjART1g (ORCPT + 47 others); Wed, 18 Jan 2023 14:27:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbjART1e (ORCPT ); Wed, 18 Jan 2023 14:27:34 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D873854113 for ; Wed, 18 Jan 2023 11:27:33 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id fl11-20020a05600c0b8b00b003daf72fc844so2154255wmb.0 for ; Wed, 18 Jan 2023 11:27:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=gw2OqH8svh6Y9ZQ3ZoPeYoQ8UKFhnjhW8PRKbQptBoM=; b=TMiWMlpwLUVOrMAwJfpLSxTLSfISTZxQuoH1QDmbORP0znWZukAADiab8gbClB7yVp rQL+JQtw3269VSA1h/D520aDAeYyuj1F5Y8vKPco5GLPm5YNDKZ1aPTMcIQgm1UJ+2Nb SNZLL9ay6CfI0O10nRLxLocTSD4uCfEkPGQ/Np2tvHG27LDhqqEGdXQ8uMD5pUvTEvCx jHPTPBKcUtO4yiseDDXvitbc1p6SxSxbNARzCdiUmibEBYpyfAn8YwDg8Z0ix53rdEjG 8XKisRtVxGToANgKFGvoIUiLSVzUhQ51n+E7shy43/ClDvFH7Jkk0cjQUOy7k7jJaVxE hdKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gw2OqH8svh6Y9ZQ3ZoPeYoQ8UKFhnjhW8PRKbQptBoM=; b=6AhCm7Ao6vUw8cCys1P2TDyOC4jLQ8W+4YQPm7WV94SQW+jsszQ/ZE3aFcBb7ozgIc 8G2RiMSkTsyw1wWrsgU7rJwQtWJKKOhBZPJKXoVjfXuLi+EvWCrrATz4Zkck5/Mr4iWi GePGoYU5QgrihAxGayffC68wu+1sZ4+IjfFdsYZtfHOmKTdPz75jAGi+FSGuxakx5l/z sVKoDGjmiidQFYFg+7/pcITd/kdjc3xeywudEhXZEh3CZOJFodfir9aSIXHVNo7Ub0q7 sl+JDbhgecAorz8BsUL2TZba4EIiFFblspY+lkNCMPkVJ4dzn4yee2H/oXaJZVAWIFbd XTZQ== X-Gm-Message-State: AFqh2koIUTXlOpUlJllqO0L1wSIicgZjfSEt4f/6JY8UG4D233pbjCVB 7ZBBtx389QiGydd2YfAeW+vSuNxIpp0BMUuwQQfxpZyssh9RLw== X-Received: by 2002:a05:600c:a686:b0:3db:104:7821 with SMTP id ip6-20020a05600ca68600b003db01047821mr436651wmb.77.1674070052343; Wed, 18 Jan 2023 11:27:32 -0800 (PST) MIME-Version: 1.0 References: <20230117170507.2651972-1-arnd@kernel.org> In-Reply-To: <20230117170507.2651972-1-arnd@kernel.org> From: Nhat Pham Date: Wed, 18 Jan 2023 11:27:21 -0800 Message-ID: Subject: Re: [PATCH] zsmalloc: avoid unused-function warning To: Arnd Bergmann Cc: Minchan Kim , Sergey Senozhatsky , Andrew Morton , Arnd Bergmann , Sebastian Andrzej Siewior , Alexey Romanov , "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 17, 2023 at 9:05 AM Arnd Bergmann wrote: > > From: Arnd Bergmann > > obj_allocated() can be called from two places that are each > inside of an #ifdef. When both are disabled, the compiler warns: > > mm/zsmalloc.c:900:13: error: 'obj_allocated' defined but not used [-Werror=unused-function] > > Rather than trying to figure out the correct #ifdef, mark the > trivial function as 'inline', which implies __maybe_unused and > shuts up the warning. > > Fixes: 796c71ac728e ("zsmalloc: fix a race with deferred_handles storing") > Signed-off-by: Arnd Bergmann Acked-by: Nhat Pham > --- > mm/zsmalloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c > index 723ed56d3fbb..9d27d9b00bce 100644 > --- a/mm/zsmalloc.c > +++ b/mm/zsmalloc.c > @@ -937,7 +937,7 @@ static bool obj_tagged(struct page *page, void *obj, unsigned long *phandle, > return true; > } > > -static bool obj_allocated(struct page *page, void *obj, unsigned long *phandle) > +static inline bool obj_allocated(struct page *page, void *obj, unsigned long *phandle) > { > return obj_tagged(page, obj, phandle, OBJ_ALLOCATED_TAG); > } > -- > 2.39.0 > Tricky one indeed - I definitely missed that. Thanks for the fix!