From patchwork Tue Jan 17 17:04:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13104893 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 E79BFC3DA78 for ; Tue, 17 Jan 2023 17:05:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 338396B0072; Tue, 17 Jan 2023 12:05:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E8496B0073; Tue, 17 Jan 2023 12:05:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B0506B0074; Tue, 17 Jan 2023 12:05:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 081106B0072 for ; Tue, 17 Jan 2023 12:05:18 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B07981205E3 for ; Tue, 17 Jan 2023 17:05:17 +0000 (UTC) X-FDA: 80364916674.19.4A56242 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf12.hostedemail.com (Postfix) with ESMTP id C260040029 for ; Tue, 17 Jan 2023 17:05:15 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bl8jn1kf; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of arnd@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=arnd@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673975116; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=6lY2KXJGztbAGyYNMHKUdfhcboYoB0/rwXuckTWL0Vw=; b=N8//tf7DRsaZWqzCio3OiCWqbyDuCmlWGB5HbaYejv3EhX7FEgSu9qYi9Rwd8NpyqTzuet JBsOSex/6moM0ln4GVk3MjaDqmfM2xuZeiKQVY0BXOhJcCytn4V1+lo5eqivw5pACyB5zW VYINNbBUXKpFbbvOEx8fnruGAzgZcgk= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bl8jn1kf; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of arnd@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=arnd@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673975116; a=rsa-sha256; cv=none; b=tszsWzVnvcKPcuCQX6dQV2xSQg01VNNvF4mqqq6QTP6o86UjiIp8FWrArm1QelYK5Kzih7 rbCsyEbF4Mzq6e6BNn8Sw5YLDcgV+Fkc7OZQ3vwSzeHVmase/ij+l1ohCCMzsx5w/skMbf lj+vElvwSgC5MOIF1q3oU29rPwGOQgA= 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 B5FB9B8128A; 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 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: C260040029 X-Stat-Signature: yusb1tcbes313s86ds44xewfoi3wwxkq X-HE-Tag: 1673975115-266840 X-HE-Meta: U2FsdGVkX19cvDZxKvjk689uJqb0/mfdckkwbuc0z+1hxWOO1X7sX7oaf8qkqMfNoQlps6Gvru//Ky4iVYHWyZzgIyr5kMGC+4XuVoELK7r5ortEfBINy3FfWy6dMIgFYfhgeYQu7fwAlDSfIfsBBRTcy7VtOsWH6sQAQ+eK5lA5CW8GhCCPPc0El7PlU7JsOwEeC4dDAHmCacVfGHCQRFXoccKT4txs/Wqb4yf0PphNRHeCOFELiGiQcT4cFwS0Hzeh09nqm5ZVVBKaEoyAUDmJtaiNsY2TIVD39jcQip7UfPZslWTCm1IOjhHzP1CFbyGXB1Ww5+bqkAS3ySX3ZaQ8/X4HRVp0pXy1ZFY12yb2I3Z2yI/W58mSu9okiHeDvUrIvrIdayeZ9Hq0RZW6Ghx4rJNGsPZWp4fXwyagGtBUqZgK0lPQFqE3+FrNTml73Eg6J5zwuctW0RAoZ1PIe/Kq31ORpCzcSgICjCtcgCXXLH79QzYZysTR7L0gIelBUQ/pjFdzCZw9zDjVJNoEm0pkTA+b+jyi5LgKPNcxw6jfvAQrRJg6VktCNQrxVxDexBdzBivGiOIHVnz8dwYeweCKFBwPO+SY3jRe/Sk71NalhHbWkZduY5KtNRRjwBouYxDLrVpoBteSULd/xpZX3M37GZnIkSZ3gEAjRVB7MR6JIfJrSPkW4YSIWk45w/f9xrqq2xnT+vjhPuqc9XJ7PefBTg4E5OuM214Davb/XFWREd6vn+phRvxa04oetVptzJO9N2zf8jH/7umNoivs+2pzXC1LwiXdc8uT0eXQGhEIzVHCROrw4sY5+VdJjQgbALqE/G1UfpaOfpEAvTH9+Gjns8ke5C9xsQSdjhgIGfxfJck3Ht07mUEO/Jy4lTnwDjKRF1/h9EFqmMLF1xElnRkifUC3g5Lta5ROc2oerPruJugiNFLoLY9dKdmh+rdepBFBMFtQ/QYKjiFKw/K yO3W//UW N0pVZ72kuJ0Dki+Fo+dP9ex+eRsEOEOb8/1BUYAL8jD6QXL4iIk0/s3MhHUHReLxmLqfZBTZfOoxW7QY= 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: 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 Reviewed-by: Sergey Senozhatsky 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); }