Message ID | 20230207161316.293923-1-arnd@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Sakari Ailus |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1pPQb8-00H42C-Dk; Tue, 07 Feb 2023 16:13:34 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230450AbjBGQNb (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Tue, 7 Feb 2023 11:13:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232791AbjBGQN2 (ORCPT <rfc822;linux-media@vger.kernel.org>); Tue, 7 Feb 2023 11:13:28 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C274E055; Tue, 7 Feb 2023 08:13:20 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3FB8360EA6; Tue, 7 Feb 2023 16:13:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5C26C433EF; Tue, 7 Feb 2023 16:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675786399; bh=FLLBP0tTZMTEFNWTFRCOfoqXmh7TMFj9z2SwwwQ+5qo=; h=From:To:Cc:Subject:Date:From; b=nhhBAWfFDWtPwtP5V87mG2i7Se7blpUDpt0dX0s1B2Nz8J9dHcar/LTEE4M2F5/yM E28Y0A+5GYWCzYXlSv7zJv5A44VpQS74C7z3Lb6oWWf/VVnmPzVPw9z7b1kD8Cf6Ih 1mePSowwg3p65lzzLBB8pWQrSdIwquj5+0ELfVZ4g5rIp4DhdopEpfMedZTDwGQUcY kMHKKjMiatRL3vqMusbbsqcpxO55rY30nr07BbirYbZqnBSkPrmLyBhIjVQRzdsr5v bz6QlUCL+ZuccEB7nOAZVRzWmcbVl9vQATNgIXJ4w+M+f1KO6XKeb7Vtrm+TzjoUhq B0qttGVTChpdg== From: Arnd Bergmann <arnd@kernel.org> To: Manivannan Sadhasivam <mani@kernel.org>, Mauro Carvalho Chehab <mchehab@kernel.org>, Sakari Ailus <sakari.ailus@linux.intel.com>, Alexander Stein <alexander.stein@ew.tq-group.com>, Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Arnd Bergmann <arnd@arndb.de>, Dave Stevenson <dave.stevenson@raspberrypi.com>, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: i2c: imx290: fix conditional function defintions Date: Tue, 7 Feb 2023 17:13:12 +0100 Message-Id: <20230207161316.293923-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.1 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: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -3.1 (---) X-LSpam-Report: No, score=-3.1 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no |
Series |
media: i2c: imx290: fix conditional function defintions
|
|
Commit Message
Arnd Bergmann
Feb. 7, 2023, 4:13 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> The runtime suspend/resume functions are only referenced from the dev_pm_ops, but they use the old SET_RUNTIME_PM_OPS() helper that requires a __maybe_unused annotation to avoid a warning: drivers/media/i2c/imx290.c:1082:12: error: unused function 'imx290_runtime_resume' [-Werror,-Wunused-function] static int imx290_runtime_resume(struct device *dev) ^ drivers/media/i2c/imx290.c:1090:12: error: unused function 'imx290_runtime_suspend' [-Werror,-Wunused-function] static int imx290_runtime_suspend(struct device *dev) ^ Convert this to the new RUNTIME_PM_OPS() helper that so this is not required. To improve this further, also use the pm_ptr() helper that lets the dev_pm_ops get dropped entirely when CONFIG_PM is disabled. A related mistake happened in the of_match_ptr() macro here, which like SET_RUNTIME_PM_OPS() requires the match table to be marked as __maybe_unused, though I could not reproduce building this without CONFIG_OF. Remove the of_match_ptr() here as there is no point in dropping the match table in configurations without CONFIG_OF. Fixes: 02852c01f654 ("media: i2c: imx290: Initialize runtime PM before subdev") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/media/i2c/imx290.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Comments
Hi Arnd, Thank you for the patch. On Tue, Feb 07, 2023 at 05:13:12PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The runtime suspend/resume functions are only referenced from the > dev_pm_ops, but they use the old SET_RUNTIME_PM_OPS() helper > that requires a __maybe_unused annotation to avoid a warning: > > drivers/media/i2c/imx290.c:1082:12: error: unused function 'imx290_runtime_resume' [-Werror,-Wunused-function] > static int imx290_runtime_resume(struct device *dev) > ^ > drivers/media/i2c/imx290.c:1090:12: error: unused function 'imx290_runtime_suspend' [-Werror,-Wunused-function] > static int imx290_runtime_suspend(struct device *dev) > ^ > > Convert this to the new RUNTIME_PM_OPS() helper that so this > is not required. To improve this further, also use the pm_ptr() > helper that lets the dev_pm_ops get dropped entirely when > CONFIG_PM is disabled. > > A related mistake happened in the of_match_ptr() macro here, which > like SET_RUNTIME_PM_OPS() requires the match table to be marked > as __maybe_unused, though I could not reproduce building this without > CONFIG_OF. Remove the of_match_ptr() here as there is no point in > dropping the match table in configurations without CONFIG_OF. > > Fixes: 02852c01f654 ("media: i2c: imx290: Initialize runtime PM before subdev") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > drivers/media/i2c/imx290.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c > index 49d6c8bdec41..48ae2e0adf9e 100644 > --- a/drivers/media/i2c/imx290.c > +++ b/drivers/media/i2c/imx290.c > @@ -1098,7 +1098,7 @@ static int imx290_runtime_suspend(struct device *dev) > } > > static const struct dev_pm_ops imx290_pm_ops = { > - SET_RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL) > + RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL) > }; > > /* ---------------------------------------------------------------------------- > @@ -1362,8 +1362,8 @@ static struct i2c_driver imx290_i2c_driver = { > .remove = imx290_remove, > .driver = { > .name = "imx290", > - .pm = &imx290_pm_ops, > - .of_match_table = of_match_ptr(imx290_of_match), > + .pm = pm_ptr(&imx290_pm_ops), > + .of_match_table = imx290_of_match, > }, > }; >
Linux regression tracking (Thorsten Leemhuis)
March 20, 2023, 9:18 a.m. UTC |
#2
Addressed
Unaddressed
On 07.02.23 17:40, Laurent Pinchart wrote: > On Tue, Feb 07, 2023 at 05:13:12PM +0100, Arnd Bergmann wrote: >> From: Arnd Bergmann <arnd@arndb.de> >> >> The runtime suspend/resume functions are only referenced from the >> dev_pm_ops, but they use the old SET_RUNTIME_PM_OPS() helper >> that requires a __maybe_unused annotation to avoid a warning: >> >> drivers/media/i2c/imx290.c:1082:12: error: unused function 'imx290_runtime_resume' [-Werror,-Wunused-function] >> static int imx290_runtime_resume(struct device *dev) >> ^ >> drivers/media/i2c/imx290.c:1090:12: error: unused function 'imx290_runtime_suspend' [-Werror,-Wunused-function] >> static int imx290_runtime_suspend(struct device *dev) >> ^ >> I might be missing something (if so, please tell me), but to me it looks this fix for a build issue in 6.3-rc (which shows up in Guenters weekly reports to Linus) didn't make any progress in the past few weeks. Is there a reason why? Who actually needs to pick it up and send it towards mainline? Manivannan Sadhasivam? Sakari Ailus? Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) -- Everything you wanna know about Linux kernel regression tracking: https://linux-regtracking.leemhuis.info/about/#tldr If I did something stupid, please tell me, as explained on that page. #regzbot poke >> Convert this to the new RUNTIME_PM_OPS() helper that so this >> is not required. To improve this further, also use the pm_ptr() >> helper that lets the dev_pm_ops get dropped entirely when >> CONFIG_PM is disabled. >> >> A related mistake happened in the of_match_ptr() macro here, which >> like SET_RUNTIME_PM_OPS() requires the match table to be marked >> as __maybe_unused, though I could not reproduce building this without >> CONFIG_OF. Remove the of_match_ptr() here as there is no point in >> dropping the match table in configurations without CONFIG_OF. >> >> Fixes: 02852c01f654 ("media: i2c: imx290: Initialize runtime PM before subdev") >> Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > >> --- >> drivers/media/i2c/imx290.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c >> index 49d6c8bdec41..48ae2e0adf9e 100644 >> --- a/drivers/media/i2c/imx290.c >> +++ b/drivers/media/i2c/imx290.c >> @@ -1098,7 +1098,7 @@ static int imx290_runtime_suspend(struct device *dev) >> } >> >> static const struct dev_pm_ops imx290_pm_ops = { >> - SET_RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL) >> + RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL) >> }; >> >> /* ---------------------------------------------------------------------------- >> @@ -1362,8 +1362,8 @@ static struct i2c_driver imx290_i2c_driver = { >> .remove = imx290_remove, >> .driver = { >> .name = "imx290", >> - .pm = &imx290_pm_ops, >> - .of_match_table = of_match_ptr(imx290_of_match), >> + .pm = pm_ptr(&imx290_pm_ops), >> + .of_match_table = imx290_of_match, >> }, >> }; >> >
On Tue, Feb 07, 2023 at 05:13:12PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The runtime suspend/resume functions are only referenced from the > dev_pm_ops, but they use the old SET_RUNTIME_PM_OPS() helper > that requires a __maybe_unused annotation to avoid a warning: > > drivers/media/i2c/imx290.c:1082:12: error: unused function 'imx290_runtime_resume' [-Werror,-Wunused-function] > static int imx290_runtime_resume(struct device *dev) > ^ > drivers/media/i2c/imx290.c:1090:12: error: unused function 'imx290_runtime_suspend' [-Werror,-Wunused-function] > static int imx290_runtime_suspend(struct device *dev) > ^ > > Convert this to the new RUNTIME_PM_OPS() helper that so this > is not required. To improve this further, also use the pm_ptr() > helper that lets the dev_pm_ops get dropped entirely when > CONFIG_PM is disabled. > > A related mistake happened in the of_match_ptr() macro here, which > like SET_RUNTIME_PM_OPS() requires the match table to be marked > as __maybe_unused, though I could not reproduce building this without > CONFIG_OF. Remove the of_match_ptr() here as there is no point in > dropping the match table in configurations without CONFIG_OF. > > Fixes: 02852c01f654 ("media: i2c: imx290: Initialize runtime PM before subdev") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Thanks, Mani > --- > drivers/media/i2c/imx290.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c > index 49d6c8bdec41..48ae2e0adf9e 100644 > --- a/drivers/media/i2c/imx290.c > +++ b/drivers/media/i2c/imx290.c > @@ -1098,7 +1098,7 @@ static int imx290_runtime_suspend(struct device *dev) > } > > static const struct dev_pm_ops imx290_pm_ops = { > - SET_RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL) > + RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL) > }; > > /* ---------------------------------------------------------------------------- > @@ -1362,8 +1362,8 @@ static struct i2c_driver imx290_i2c_driver = { > .remove = imx290_remove, > .driver = { > .name = "imx290", > - .pm = &imx290_pm_ops, > - .of_match_table = of_match_ptr(imx290_of_match), > + .pm = pm_ptr(&imx290_pm_ops), > + .of_match_table = imx290_of_match, > }, > }; > > -- > 2.39.1 >
Hello, On Mon, Mar 20, 2023 at 10:18:23AM +0100, Linux regression tracking (Thorsten Leemhuis) wrote: > On 07.02.23 17:40, Laurent Pinchart wrote: > > On Tue, Feb 07, 2023 at 05:13:12PM +0100, Arnd Bergmann wrote: > >> From: Arnd Bergmann <arnd@arndb.de> > >> > >> The runtime suspend/resume functions are only referenced from the > >> dev_pm_ops, but they use the old SET_RUNTIME_PM_OPS() helper > >> that requires a __maybe_unused annotation to avoid a warning: > >> > >> drivers/media/i2c/imx290.c:1082:12: error: unused function 'imx290_runtime_resume' [-Werror,-Wunused-function] > >> static int imx290_runtime_resume(struct device *dev) > >> ^ > >> drivers/media/i2c/imx290.c:1090:12: error: unused function 'imx290_runtime_suspend' [-Werror,-Wunused-function] > >> static int imx290_runtime_suspend(struct device *dev) > >> ^ > >> > > I might be missing something (if so, please tell me), but to me it looks > this fix for a build issue in 6.3-rc (which shows up in Guenters weekly > reports to Linus) didn't make any progress in the past few weeks. Is > there a reason why? Who actually needs to pick it up and send it towards > mainline? Manivannan Sadhasivam? Sakari Ailus? Mauro has recently pulled my PR including this and I understand it's in Mauro's tree now.
Linux regression tracking (Thorsten Leemhuis)
March 20, 2023, 9:42 a.m. UTC |
#5
Addressed
Unaddressed
On 20.03.23 10:32, Sakari Ailus wrote: > On Mon, Mar 20, 2023 at 10:18:23AM +0100, Linux regression tracking (Thorsten Leemhuis) wrote: >> On 07.02.23 17:40, Laurent Pinchart wrote: >>> On Tue, Feb 07, 2023 at 05:13:12PM +0100, Arnd Bergmann wrote: >>>> From: Arnd Bergmann <arnd@arndb.de> >>>> >>>> The runtime suspend/resume functions are only referenced from the >>>> dev_pm_ops, but they use the old SET_RUNTIME_PM_OPS() helper >>>> that requires a __maybe_unused annotation to avoid a warning: >>>> >>>> drivers/media/i2c/imx290.c:1082:12: error: unused function 'imx290_runtime_resume' [-Werror,-Wunused-function] >>>> static int imx290_runtime_resume(struct device *dev) >>>> ^ >>>> drivers/media/i2c/imx290.c:1090:12: error: unused function 'imx290_runtime_suspend' [-Werror,-Wunused-function] >>>> static int imx290_runtime_suspend(struct device *dev) >>>> ^ >>>> >> >> I might be missing something (if so, please tell me), but to me it looks >> this fix for a build issue in 6.3-rc (which shows up in Guenters weekly >> reports to Linus) didn't make any progress in the past few weeks. Is >> there a reason why? Who actually needs to pick it up and send it towards >> mainline? Manivannan Sadhasivam? Sakari Ailus? > > Mauro has recently pulled my PR including this and I understand it's in > Mauro's tree now. Ahh, great, many thx. I checked Linux-next before writing my mail, but didn't sport it there. :-/ Ciao, Thorsten
Linux regression tracking (Thorsten Leemhuis)
March 20, 2023, 9:46 a.m. UTC |
#6
Addressed
Unaddressed
On 20.03.23 10:42, Linux regression tracking (Thorsten Leemhuis) wrote: > On 20.03.23 10:32, Sakari Ailus wrote: >> On Mon, Mar 20, 2023 at 10:18:23AM +0100, Linux regression tracking (Thorsten Leemhuis) wrote: >>> On 07.02.23 17:40, Laurent Pinchart wrote: >>>> On Tue, Feb 07, 2023 at 05:13:12PM +0100, Arnd Bergmann wrote: >>>>> From: Arnd Bergmann <arnd@arndb.de> >>>>> >>>>> The runtime suspend/resume functions are only referenced from the >>>>> dev_pm_ops, but they use the old SET_RUNTIME_PM_OPS() helper >>>>> that requires a __maybe_unused annotation to avoid a warning: >>>>> >>>>> drivers/media/i2c/imx290.c:1082:12: error: unused function 'imx290_runtime_resume' [-Werror,-Wunused-function] >>>>> static int imx290_runtime_resume(struct device *dev) >>>>> ^ >>>>> drivers/media/i2c/imx290.c:1090:12: error: unused function 'imx290_runtime_suspend' [-Werror,-Wunused-function] >>>>> static int imx290_runtime_suspend(struct device *dev) >>>>> ^ >>>>> >>> >>> I might be missing something (if so, please tell me), but to me it looks >>> this fix for a build issue in 6.3-rc (which shows up in Guenters weekly >>> reports to Linus) didn't make any progress in the past few weeks. Is >>> there a reason why? Who actually needs to pick it up and send it towards >>> mainline? Manivannan Sadhasivam? Sakari Ailus? >> >> Mauro has recently pulled my PR including this and I understand it's in >> Mauro's tree now. > > Ahh, great, many thx. > > I checked Linux-next before writing my mail, but didn't sport it there. :-/ Argh, ohh no, it's there. Sorry for the noise. Second time something like this happens today. Seems today is not my best day. :-/ Ciao, Thorsten
On Mon, Mar 20, 2023 at 10:46:45AM +0100, Thorsten Leemhuis wrote: > Argh, ohh no, it's there. Sorry for the noise. Second time something > like this happens today. Seems today is not my best day. :-/ No worries!
diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c index 49d6c8bdec41..48ae2e0adf9e 100644 --- a/drivers/media/i2c/imx290.c +++ b/drivers/media/i2c/imx290.c @@ -1098,7 +1098,7 @@ static int imx290_runtime_suspend(struct device *dev) } static const struct dev_pm_ops imx290_pm_ops = { - SET_RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL) + RUNTIME_PM_OPS(imx290_runtime_suspend, imx290_runtime_resume, NULL) }; /* ---------------------------------------------------------------------------- @@ -1362,8 +1362,8 @@ static struct i2c_driver imx290_i2c_driver = { .remove = imx290_remove, .driver = { .name = "imx290", - .pm = &imx290_pm_ops, - .of_match_table = of_match_ptr(imx290_of_match), + .pm = pm_ptr(&imx290_pm_ops), + .of_match_table = imx290_of_match, }, };