Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5153921rwb; Tue, 17 Jan 2023 09:49:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXv0tTosYpgA8ptmZ9542GLsKAi7vFrqCfBf+dbE69ZiGMxX2VP+Y8mhcBbGt2CTsuC+oBks X-Received: by 2002:a17:902:9b97:b0:194:7b3a:e93e with SMTP id y23-20020a1709029b9700b001947b3ae93emr3996995plp.53.1673977799034; Tue, 17 Jan 2023 09:49:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673977799; cv=none; d=google.com; s=arc-20160816; b=RgpX3wGSNqawrUnXYey+RgoEdAzcHMERe4615LZnxyyqiziRKyawwySxP7/xBkfAx+ xGhJzLMCLsBp3Hq906BSiuho0zlslBItF+ra2AahgzN0hvCAxvHjZq/NJN8EHDG6Qx3m yevdEqK6xSH/vkEOmcWF3WLUZ32sA8gmkS5Xy4hA5CI9Si8g6R6P4139QWUctW34GvnS DJ6cswB3sf17jmn5S19jvUes9HbdOYbuCkeW488NaotOXa+p7ricE6m6o8PoPb34MVaW GI8ezkIXKnBQMmnGFHIiJsdQDiEGrv1LQSf/sbCmLIdnMkdrJEuIiwLwwW4S7W3L49s/ 4M1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6lY2KXJGztbAGyYNMHKUdfhcboYoB0/rwXuckTWL0Vw=; b=IiofkFibUBPN0JLcsB3x2/BC7XCVEn2F8sZroJqoi6BWfbv2cYoVLmsxPikkTCVQ3y 1uaMf8M//eqHvzdmqEFBpT4tsBgRtrUNnRtz6uHVWRvsF7cWmrvfvb1UrWUPq1ChY4g0 t+LsCTGET4FZ77R5lIwRU6tKJAcprpV7iQy1yLI8KXYqRJ8rYvPj7VZWSBIr0JXX0MGs kfPqu6P9kizVJwhXiA4fTW3+79vITNAfHjzL8OkqH/TlJ3X8rvCi1j7q34UDmF3NFESS 6UpRxpmxQE5iN9WGF/w/v1Dq0RE4L0tCKDeg02F/QyqLy0XHY4zdGphY5jB1F9q41j3K ndGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bl8jn1kf; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020a170902ecc700b001930ab4c4fesi15126075plh.165.2023.01.17.09.49.53; Tue, 17 Jan 2023 09:49:59 -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=@kernel.org header.s=k20201202 header.b=bl8jn1kf; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231217AbjAQRFT (ORCPT + 48 others); Tue, 17 Jan 2023 12:05:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230186AbjAQRFQ (ORCPT ); Tue, 17 Jan 2023 12:05:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D6A3B67C for ; Tue, 17 Jan 2023 09:05:15 -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 BD23AB8128D for ; Tue, 17 Jan 2023 17:05:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F85EC433D2; Tue, 17 Jan 2023 17:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673975112; bh=x0X25cKQNML11LK6Kv5Po/7LOUOfaxLt4ZMA8R6qomk=; h=From:To:Cc:Subject:Date:From; b=bl8jn1kfSXFv8jjXN7ctyTELVTtO2ztNZWJ+28XCuuwNtD89nYTv/KdHetwAW0ai0 kbocvxRUfBaGWJQnoX/UsIKqM9DGKOfDmyvzwroSw5zQn2kQOFhRBmGN3v9LY1TXWn vzl6pcYZZ5jGcc58ippBKZxmR6wajdSv2vMWwkKP0xKHjZT5Vu0M/F6CpOBvz/6Reh fzmVG0MS+eq97LXFZQG6+RrCIA+DNHKsbGwd0Fj4Yp6Gr/RDdECax5ZpGAI6UWVRlD Q8XEgXNdbAHPLJdDpJFSzehGcGB2a1Fpyydcwbpso46012u/aWbrU+1l6xMHjuKRwI U/DyLk5Lq9rpQ== From: Arnd Bergmann To: Minchan Kim , Sergey Senozhatsky , Andrew Morton , Nhat Pham Cc: Arnd Bergmann , Sebastian Andrzej Siewior , Alexey Romanov , "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] zsmalloc: avoid unused-function warning Date: Tue, 17 Jan 2023 18:04:59 +0100 Message-Id: <20230117170507.2651972-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 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 --- 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