Linux IIO development
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: mlx90632: Minor fixes
@ 2022-11-05 12:51 Jonathan Cameron
  2022-11-05 12:51 ` [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable() Jonathan Cameron
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jonathan Cameron @ 2022-11-05 12:51 UTC (permalink / raw)
  To: linux-iio, Crt Mori; +Cc: coverity-bot, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

A couple of minor fixes.  The devm_ error handling was a coverity report.
Static was a warning I'd missed originally but saw in build whilst testing
the above.

Crt, could you give these a quick look (+tag ideally) then I'll get them
on the tree so the issue is fixed in Linux next before I send Greg a pull
request.

Jonathan Cameron (2):
  iio: temperature: mlx90632: Add error handling for
    devm_pm_runtime_enable()
  iio: temperature: mlx90632: Add missing static marking on devm_pm_ops

 drivers/iio/temperature/mlx90632.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.38.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()
  2022-11-05 12:51 [PATCH 0/2] iio: mlx90632: Minor fixes Jonathan Cameron
@ 2022-11-05 12:51 ` Jonathan Cameron
  2022-11-07  9:50   ` Crt Mori
  2022-11-05 12:51 ` [PATCH 2/2] iio: temperature: mlx90632: Add missing static marking on devm_pm_ops Jonathan Cameron
  2022-11-12 15:47 ` [PATCH 0/2] iio: mlx90632: Minor fixes Jonathan Cameron
  2 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2022-11-05 12:51 UTC (permalink / raw)
  To: linux-iio, Crt Mori; +Cc: coverity-bot, Jonathan Cameron, coverity-bot

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This call can fail so handling is necessary even if it is very unlikely.

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527134 ("Error handling issues")
Fixes: c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/temperature/mlx90632.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
index a17fe5f4967a..7572ae3f8432 100644
--- a/drivers/iio/temperature/mlx90632.c
+++ b/drivers/iio/temperature/mlx90632.c
@@ -1267,7 +1267,10 @@ static int mlx90632_probe(struct i2c_client *client,
 	pm_runtime_get_noresume(&client->dev);
 	pm_runtime_set_active(&client->dev);
 
-	devm_pm_runtime_enable(&client->dev);
+	ret = devm_pm_runtime_enable(&client->dev);
+	if (ret)
+		return ret;
+
 	pm_runtime_set_autosuspend_delay(&client->dev, MLX90632_SLEEP_DELAY_MS);
 	pm_runtime_use_autosuspend(&client->dev);
 	pm_runtime_put_autosuspend(&client->dev);
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] iio: temperature: mlx90632: Add missing static marking on devm_pm_ops
  2022-11-05 12:51 [PATCH 0/2] iio: mlx90632: Minor fixes Jonathan Cameron
  2022-11-05 12:51 ` [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable() Jonathan Cameron
@ 2022-11-05 12:51 ` Jonathan Cameron
  2022-11-07  9:50   ` Crt Mori
  2022-11-12 15:47 ` [PATCH 0/2] iio: mlx90632: Minor fixes Jonathan Cameron
  2 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2022-11-05 12:51 UTC (permalink / raw)
  To: linux-iio, Crt Mori; +Cc: coverity-bot, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Only used within this file, so should be marked static.

Fixes: c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/temperature/mlx90632.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
index 7572ae3f8432..f1f5ebc145b1 100644
--- a/drivers/iio/temperature/mlx90632.c
+++ b/drivers/iio/temperature/mlx90632.c
@@ -1326,7 +1326,7 @@ static int mlx90632_pm_runtime_suspend(struct device *dev)
 	return mlx90632_pwr_set_sleep_step(data->regmap);
 }
 
-const struct dev_pm_ops mlx90632_pm_ops = {
+static const struct dev_pm_ops mlx90632_pm_ops = {
 	SYSTEM_SLEEP_PM_OPS(mlx90632_pm_suspend, mlx90632_pm_resume)
 	RUNTIME_PM_OPS(mlx90632_pm_runtime_suspend, NULL, NULL)
 };
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()
  2022-11-05 12:51 ` [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable() Jonathan Cameron
@ 2022-11-07  9:50   ` Crt Mori
  0 siblings, 0 replies; 6+ messages in thread
From: Crt Mori @ 2022-11-07  9:50 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, coverity-bot, Jonathan Cameron, coverity-bot

Acked-off-by: Crt Mori <cmo@melexis.com>

On Sat, 5 Nov 2022 at 13:51, Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This call can fail so handling is necessary even if it is very unlikely.
>
> Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
> Addresses-Coverity-ID: 1527134 ("Error handling issues")
> Fixes: c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes")
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  drivers/iio/temperature/mlx90632.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
> index a17fe5f4967a..7572ae3f8432 100644
> --- a/drivers/iio/temperature/mlx90632.c
> +++ b/drivers/iio/temperature/mlx90632.c
> @@ -1267,7 +1267,10 @@ static int mlx90632_probe(struct i2c_client *client,
>         pm_runtime_get_noresume(&client->dev);
>         pm_runtime_set_active(&client->dev);
>
> -       devm_pm_runtime_enable(&client->dev);
> +       ret = devm_pm_runtime_enable(&client->dev);
> +       if (ret)
> +               return ret;
> +
>         pm_runtime_set_autosuspend_delay(&client->dev, MLX90632_SLEEP_DELAY_MS);
>         pm_runtime_use_autosuspend(&client->dev);
>         pm_runtime_put_autosuspend(&client->dev);
> --
> 2.38.1
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] iio: temperature: mlx90632: Add missing static marking on devm_pm_ops
  2022-11-05 12:51 ` [PATCH 2/2] iio: temperature: mlx90632: Add missing static marking on devm_pm_ops Jonathan Cameron
@ 2022-11-07  9:50   ` Crt Mori
  0 siblings, 0 replies; 6+ messages in thread
From: Crt Mori @ 2022-11-07  9:50 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, coverity-bot, Jonathan Cameron

Acked-off-by: Crt Mori <cmo@melexis.com>

On Sat, 5 Nov 2022 at 13:51, Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Only used within this file, so should be marked static.
>
> Fixes: c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes")
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  drivers/iio/temperature/mlx90632.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
> index 7572ae3f8432..f1f5ebc145b1 100644
> --- a/drivers/iio/temperature/mlx90632.c
> +++ b/drivers/iio/temperature/mlx90632.c
> @@ -1326,7 +1326,7 @@ static int mlx90632_pm_runtime_suspend(struct device *dev)
>         return mlx90632_pwr_set_sleep_step(data->regmap);
>  }
>
> -const struct dev_pm_ops mlx90632_pm_ops = {
> +static const struct dev_pm_ops mlx90632_pm_ops = {
>         SYSTEM_SLEEP_PM_OPS(mlx90632_pm_suspend, mlx90632_pm_resume)
>         RUNTIME_PM_OPS(mlx90632_pm_runtime_suspend, NULL, NULL)
>  };
> --
> 2.38.1
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] iio: mlx90632: Minor fixes
  2022-11-05 12:51 [PATCH 0/2] iio: mlx90632: Minor fixes Jonathan Cameron
  2022-11-05 12:51 ` [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable() Jonathan Cameron
  2022-11-05 12:51 ` [PATCH 2/2] iio: temperature: mlx90632: Add missing static marking on devm_pm_ops Jonathan Cameron
@ 2022-11-12 15:47 ` Jonathan Cameron
  2 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2022-11-12 15:47 UTC (permalink / raw)
  To: linux-iio, Crt Mori; +Cc: coverity-bot, Jonathan Cameron

On Sat,  5 Nov 2022 12:51:06 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> A couple of minor fixes.  The devm_ error handling was a coverity report.
> Static was a warning I'd missed originally but saw in build whilst testing
> the above.
> 
> Crt, could you give these a quick look (+tag ideally) then I'll get them
> on the tree so the issue is fixed in Linux next before I send Greg a pull
> request.

Series applied.

Thanks,

Jonathan

> 
> Jonathan Cameron (2):
>   iio: temperature: mlx90632: Add error handling for
>     devm_pm_runtime_enable()
>   iio: temperature: mlx90632: Add missing static marking on devm_pm_ops
> 
>  drivers/iio/temperature/mlx90632.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-12 15:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-05 12:51 [PATCH 0/2] iio: mlx90632: Minor fixes Jonathan Cameron
2022-11-05 12:51 ` [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable() Jonathan Cameron
2022-11-07  9:50   ` Crt Mori
2022-11-05 12:51 ` [PATCH 2/2] iio: temperature: mlx90632: Add missing static marking on devm_pm_ops Jonathan Cameron
2022-11-07  9:50   ` Crt Mori
2022-11-12 15:47 ` [PATCH 0/2] iio: mlx90632: Minor fixes Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox