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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2BC2EE498A for ; Wed, 11 Sep 2024 09:51:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B8FE10E98C; Wed, 11 Sep 2024 09:51:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vgcwAQGO"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5269B10E0A6; Wed, 11 Sep 2024 09:51:49 +0000 (UTC) Received: from pendragon.ideasonboard.com (213-229-8-243.static.upcbusiness.at [213.229.8.243]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7448D5B3; Wed, 11 Sep 2024 11:50:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1726048230; bh=E5X0N4knkqpIVRCMt7kxebRIQnXbxg+DEiCRGEwvRDE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vgcwAQGOKF8g6aC4YH5Z/YW+QqJDzkNWKxzkA4N9Yvy44FowsyepwIRbzc0TRoZ3u aIg6hZJ/evWK0sautqefLLCAE9+FkUkkdJ0u1c+9CE/fgcxwO6DFsuKjc+KPYEBxr9 K9Cxgiwz7hm8px4beniPYY85iim5fGQBXmYP19Mo= Date: Wed, 11 Sep 2024 12:51:13 +0300 From: Laurent Pinchart To: Jani Nikula Cc: Geert Uytterhoeven , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, Nathan Chancellor , Kieran Bingham , linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH 2/8] drm: renesas: rcar-du: annotate rcar_cmm_read() with __maybe_unused Message-ID: <20240911095113.GB4470@pendragon.ideasonboard.com> References: <87jzfjk4vy.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87jzfjk4vy.fsf@intel.com> X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Sep 10, 2024 at 04:36:01PM +0300, Jani Nikula wrote: > On Tue, 10 Sep 2024, Geert Uytterhoeven wrote: > > Hi Jani, > > > > On Tue, Sep 10, 2024 at 12:06 PM Jani Nikula wrote: > >> Building with clang and and W=1 leads to warning about unused > >> rcar_cmm_read(). Fix by annotating it with __maybe_unused. > >> > >> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static > >> inline functions for W=1 build"). > >> > >> Signed-off-by: Jani Nikula > > > > Thanks for your patch! > > > >> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c > >> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c > >> @@ -32,7 +32,7 @@ struct rcar_cmm { > >> } lut; > >> }; > >> > >> -static inline int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg) > >> +static inline __maybe_unused int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg) > >> { > >> return ioread32(rcmm->base + reg); > >> } > > > > This function was never used. Why not remove it instead? > > Can do if that's what the maintainers desire. It's just that sometimes > it's better to have the implementation reviewed and ready waiting for > the users than requiring the first user to add the implementation. I > opted for __maybe_unused across the series. Jiapeng Chong has sent a patch to drop the function, and I've reviewed it. See https://lore.kernel.org/r/20240619075436.86407-1-jiapeng.chong@linux.alibaba.com I've sent a pull request for v6.12 but it hasn't been processed in time :-( See https://lore.kernel.org/r/20240822234445.GA23541@pendragon.ideasonboard.com -- Regards, Laurent Pinchart