2020-03-02 07:57:38

by Anson Huang

[permalink] [raw]
Subject: [PATCH V2] thermal: imx_thermal: Use __maybe_unused instead of CONFIG_PM_SLEEP

Use __maybe_unused for power management related functions instead
of #if CONFIG_PM_SLEEP to simplify the code.

Signed-off-by: Anson Huang <[email protected]>
Reviewed-by: Uwe Kleine-König <[email protected]>
---
Changes since V1:
- fix typo of commit message, simply->simplify.
---
drivers/thermal/imx_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index bb6754a..e75dda5 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -878,8 +878,7 @@ static int imx_thermal_remove(struct platform_device *pdev)
return 0;
}

-#ifdef CONFIG_PM_SLEEP
-static int imx_thermal_suspend(struct device *dev)
+static int __maybe_unused imx_thermal_suspend(struct device *dev)
{
struct imx_thermal_data *data = dev_get_drvdata(dev);
struct regmap *map = data->tempmon;
@@ -900,7 +899,7 @@ static int imx_thermal_suspend(struct device *dev)
return 0;
}

-static int imx_thermal_resume(struct device *dev)
+static int __maybe_unused imx_thermal_resume(struct device *dev)
{
struct imx_thermal_data *data = dev_get_drvdata(dev);
struct regmap *map = data->tempmon;
@@ -918,7 +917,6 @@ static int imx_thermal_resume(struct device *dev)

return 0;
}
-#endif

static SIMPLE_DEV_PM_OPS(imx_thermal_pm_ops,
imx_thermal_suspend, imx_thermal_resume);
--
2.7.4


2020-03-02 08:07:51

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH V2] thermal: imx_thermal: Use __maybe_unused instead of CONFIG_PM_SLEEP

On Mon, Mar 02, 2020 at 03:50:10PM +0800, Anson Huang wrote:
> Use __maybe_unused for power management related functions instead
> of #if CONFIG_PM_SLEEP to simplify the code.
>
> Signed-off-by: Anson Huang <[email protected]>
> Reviewed-by: Uwe Kleine-K?nig <[email protected]>

IMHO translating my "otherwise looks fine" in a "Reviewed-by" is a bit
bold. Please don't assume this.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |

2020-03-02 08:27:52

by Anson Huang

[permalink] [raw]
Subject: RE: [PATCH V2] thermal: imx_thermal: Use __maybe_unused instead of CONFIG_PM_SLEEP

Hi, Uwe


> Subject: Re: [PATCH V2] thermal: imx_thermal: Use __maybe_unused instead
> of CONFIG_PM_SLEEP
>
> On Mon, Mar 02, 2020 at 03:50:10PM +0800, Anson Huang wrote:
> > Use __maybe_unused for power management related functions instead of
> > #if CONFIG_PM_SLEEP to simplify the code.
> >
> > Signed-off-by: Anson Huang <[email protected]>
> > Reviewed-by: Uwe Kleine-König <[email protected]>
>
> IMHO translating my "otherwise looks fine" in a "Reviewed-by" is a bit bold.
> Please don't assume this.

OK, will keep it in mind next time, thanks.

Anson

2020-03-02 08:54:56

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH V2] thermal: imx_thermal: Use __maybe_unused instead of CONFIG_PM_SLEEP

On 02/03/2020 09:26, Anson Huang wrote:
> Hi, Uwe
>
>
>> Subject: Re: [PATCH V2] thermal: imx_thermal: Use __maybe_unused instead
>> of CONFIG_PM_SLEEP
>>
>> On Mon, Mar 02, 2020 at 03:50:10PM +0800, Anson Huang wrote:
>>> Use __maybe_unused for power management related functions instead of
>>> #if CONFIG_PM_SLEEP to simplify the code.
>>>
>>> Signed-off-by: Anson Huang <[email protected]>
>>> Reviewed-by: Uwe Kleine-König <[email protected]>
>>
>> IMHO translating my "otherwise looks fine" in a "Reviewed-by" is a bit bold.
>> Please don't assume this.
>
> OK, will keep it in mind next time, thanks.

When applying a patch, now we add the link to the lkml archive
automatically. I can't apply this patch if the Reviewed-by is not accepted.

Or the Reviewed-by tag is confirmed or a V3 without the Reviewed-by must
be resent.


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

2020-03-02 09:01:32

by Anson Huang

[permalink] [raw]
Subject: RE: [PATCH V2] thermal: imx_thermal: Use __maybe_unused instead of CONFIG_PM_SLEEP



> Subject: Re: [PATCH V2] thermal: imx_thermal: Use __maybe_unused instead
> of CONFIG_PM_SLEEP
>
> On 02/03/2020 09:26, Anson Huang wrote:
> > Hi, Uwe
> >
> >
> >> Subject: Re: [PATCH V2] thermal: imx_thermal: Use __maybe_unused
> >> instead of CONFIG_PM_SLEEP
> >>
> >> On Mon, Mar 02, 2020 at 03:50:10PM +0800, Anson Huang wrote:
> >>> Use __maybe_unused for power management related functions instead
> of
> >>> #if CONFIG_PM_SLEEP to simplify the code.
> >>>
> >>> Signed-off-by: Anson Huang <[email protected]>
> >>> Reviewed-by: Uwe Kleine-König <[email protected]>
> >>
> >> IMHO translating my "otherwise looks fine" in a "Reviewed-by" is a bit
> bold.
> >> Please don't assume this.
> >
> > OK, will keep it in mind next time, thanks.
>
> When applying a patch, now we add the link to the lkml archive automatically.
> I can't apply this patch if the Reviewed-by is not accepted.
>
> Or the Reviewed-by tag is confirmed or a V3 without the Reviewed-by must
> be resent.

I just sent a V3 patch to drop the reviewed-by tag, thanks.

Anson

2020-03-02 09:03:05

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH V2] thermal: imx_thermal: Use __maybe_unused instead of CONFIG_PM_SLEEP

On Mon, Mar 02, 2020 at 09:54:34AM +0100, Daniel Lezcano wrote:
> On 02/03/2020 09:26, Anson Huang wrote:
> > Hi, Uwe
> >
> >
> >> Subject: Re: [PATCH V2] thermal: imx_thermal: Use __maybe_unused instead
> >> of CONFIG_PM_SLEEP
> >>
> >> On Mon, Mar 02, 2020 at 03:50:10PM +0800, Anson Huang wrote:
> >>> Use __maybe_unused for power management related functions instead of
> >>> #if CONFIG_PM_SLEEP to simplify the code.
> >>>
> >>> Signed-off-by: Anson Huang <[email protected]>
> >>> Reviewed-by: Uwe Kleine-K?nig <[email protected]>
> >>
> >> IMHO translating my "otherwise looks fine" in a "Reviewed-by" is a bit bold.
> >> Please don't assume this.
> >
> > OK, will keep it in mind next time, thanks.
>
> When applying a patch, now we add the link to the lkml archive
> automatically. I can't apply this patch if the Reviewed-by is not accepted.
>
> Or the Reviewed-by tag is confirmed or a V3 without the Reviewed-by must
> be resent.

I didn't look close enough to justify a Reviewed-by:, so "the
Reviewed-by tag is confirmed" is ruled out.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |