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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 05854C38145 for ; Fri, 2 Sep 2022 15:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8lqbXRGninw+yT+jUYUz5F8Yd8NdQXkcS5XnouyGraU=; b=xnwkuBPiYFe0a8 rmXATPJwL7SJxRZ5sZOqdwi0c/6Y9jAm+m9YQw6t3u/LMVi66E3nqpp3kDiUGQyCjNT8sdaBMgYZF NL1h4S3ukPn30norgcJXHTHkM261sxqNb8u6qqpporsqfiRMI3yw7iWs49HcMmWDzp/dxBsBZ0oV9 jCYFbdeoVCMX4xzeObr7+XqhdQBrsbkTxjdpEzmy7ZTmA4pGwghvmp9aZlmBZW/rqK9MDsIrShBTt QPWY2nC03PERbQ3uPr3hetEH/1FgPa5usxDPfiraXQFL3TguzofGXWJHgJ08sZ/KkicNqQluH+Wmc laAMhjb8a/EBPwO7RbHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU8Bi-005vMb-H0; Fri, 02 Sep 2022 15:02:30 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU8Bd-005vIZ-QR for linux-arm-kernel@lists.infradead.org; Fri, 02 Sep 2022 15:02:27 +0000 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 472B9B829FB; Fri, 2 Sep 2022 15:02:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81D80C433C1; Fri, 2 Sep 2022 15:02:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662130943; bh=fjq5s3JQ2Tmnv1qbYlny3IuIn2WM1CPEyrlgYcbbBxg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DddFvVo+kuaiJE65wFuxkgBXSlmKxa8DWfUzx7m4FW98w0JsWTwP8aRM0c4m5AWj2 qDJwpSrozEtkHMIDYpw1tnBTxjwfawwaQ1SDnLrR7NtApMSH/kXxN6HB3d5M5WiGLQ B2woUAnz07aV+1TbgqHGjiytZomkYxydSMYyYgzyyjuasRPPq5KRev5b74NOMM+5Ft gzMK7ujhaauTC7RLXrGb3lS3MxvHJ14xpHa87LU/nwfqM1dnbaQNCK4D3B8BR3kSOm /4wDllByVD4gpKS/0m2BjeX8AZPslrumRy+4wvq+NYj+Z9a5hh+GpCihTFa+dUuEr5 AhN0P76+LY/tg== Date: Fri, 2 Sep 2022 08:02:20 -0700 From: Nathan Chancellor To: James Clark Cc: Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] coresight: cti-sysfs: Mark coresight_cti_reg_store() as __maybe_unused Message-ID: References: <20220901195055.1932340-1-nathan@kernel.org> <54e034aa-4012-e6f1-c0f3-325d8fe0f4c1@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <54e034aa-4012-e6f1-c0f3-325d8fe0f4c1@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220902_080226_179274_C7244DB0 X-CRM114-Status: GOOD ( 30.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 02, 2022 at 02:03:07PM +0100, James Clark wrote: > > > On 01/09/2022 20:50, Nathan Chancellor wrote: > > When building without CONFIG_CORESIGHT_CTI_INTEGRATION_REGS, there is a > > warning about coresight_cti_reg_store() being unused in the file: > > > > drivers/hwtracing/coresight/coresight-cti-sysfs.c:184:16: warning: 'coresight_cti_reg_store' defined but not used [-Wunused-function] > > 184 | static ssize_t coresight_cti_reg_store(struct device *dev, > > | ^~~~~~~~~~~~~~~~~~~~~~~ > > > > This is expected as coresight_cti_reg_store() is only used in the > > coresight_cti_reg_rw macro, which is only used in a block guarded by > > CONFIG_CORESIGHT_CTI_INTEGRATION_REGS. Mark coresight_cti_reg_store() as > > __maybe_unused to clearly indicate that the function may be unused > > depending on the configuration. > > It would also be possible to fix this by wrapping the definitions in > #ifdef CONFIG_CORESIGHT_CTI_INTEGRATION_REGS. That way the maybe_unused > isn't needed and it's a bit cleaner. Right, I do not have a preference either. I only did this way first because most maintainers do not like ifdef's in .c files. I am happy to change the solution if you all prefer! > Either way, thanks for the fix. > > Reviewed-by: James Clark Thanks for the review! Cheers, Nathan > > Fixes: fbca79e55429 ("coresight: cti-sysfs: Re-use same functions for similar sysfs register accessors") > > Signed-off-by: Nathan Chancellor > > --- > > drivers/hwtracing/coresight/coresight-cti-sysfs.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/hwtracing/coresight/coresight-cti-sysfs.c b/drivers/hwtracing/coresight/coresight-cti-sysfs.c > > index 478b8d38b744..6d59c815ecf5 100644 > > --- a/drivers/hwtracing/coresight/coresight-cti-sysfs.c > > +++ b/drivers/hwtracing/coresight/coresight-cti-sysfs.c > > @@ -181,9 +181,9 @@ static ssize_t coresight_cti_reg_show(struct device *dev, > > } > > > > /* Write registers with power check only (no enable check). */ > > -static ssize_t coresight_cti_reg_store(struct device *dev, > > - struct device_attribute *attr, > > - const char *buf, size_t size) > > +static __maybe_unused ssize_t coresight_cti_reg_store(struct device *dev, > > + struct device_attribute *attr, > > + const char *buf, size_t size) > > { > > struct cti_drvdata *drvdata = dev_get_drvdata(dev->parent); > > struct cs_off_attribute *cti_attr = container_of(attr, struct cs_off_attribute, attr); > > > > base-commit: 0a98181f805058773961c5ab3172ecf1bf1ed0e1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel