All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
	Archana Patni <archana.patni@linux.intel.com>,
	Hartmut Knaack <knaack.h@gmx.de>, Jiri Kosina <jikos@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iio/pressure: Delete an error message for a failed memory allocation in hid_press_probe(
Date: Sun, 04 Feb 2018 10:58:39 +0000	[thread overview]
Message-ID: <20180204105839.606f8d2e@archlinux> (raw)
In-Reply-To: <e7dfe444-616a-e156-31d5-8ed626434d1f@users.sourceforge.net>

On Mon, 29 Jan 2018 22:04:11 +0100
SF Markus Elfring <elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 29 Jan 2018 21:55:08 +0100
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Whilst the error message doesn't add a lot, it does add some information
over a simple memory copy failed error.

Hence I think we should keep it.

Jonathan

> ---
>  drivers/iio/pressure/hid-sensor-press.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
> index 4c437918f1d2..9de7590d50b0 100644
> --- a/drivers/iio/pressure/hid-sensor-press.c
> +++ b/drivers/iio/pressure/hid-sensor-press.c
> @@ -280,10 +280,8 @@ static int hid_press_probe(struct platform_device *pdev)
>  
>  	indio_dev->channels = kmemdup(press_channels, sizeof(press_channels),
>  				      GFP_KERNEL);
> -	if (!indio_dev->channels) {
> -		dev_err(&pdev->dev, "failed to duplicate channels\n");
> +	if (!indio_dev->channels)
>  		return -ENOMEM;
> -	}
>  
>  	ret = press_parse_report(pdev, hsdev,
>  				 (struct iio_chan_spec *)indio_dev->channels,


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: SF Markus Elfring
	<elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Archana Patni
	<archana.patni-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>,
	Jiri Kosina <jikos-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	Peter Meerwald-Stadler
	<pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>,
	Srinivas Pandruvada
	<srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] iio/pressure: Delete an error message for a failed memory allocation in hid_press_probe()
Date: Sun, 4 Feb 2018 10:58:39 +0000	[thread overview]
Message-ID: <20180204105839.606f8d2e@archlinux> (raw)
In-Reply-To: <e7dfe444-616a-e156-31d5-8ed626434d1f-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>

On Mon, 29 Jan 2018 22:04:11 +0100
SF Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org> wrote:

> From: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
> Date: Mon, 29 Jan 2018 21:55:08 +0100
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>

Whilst the error message doesn't add a lot, it does add some information
over a simple memory copy failed error.

Hence I think we should keep it.

Jonathan

> ---
>  drivers/iio/pressure/hid-sensor-press.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
> index 4c437918f1d2..9de7590d50b0 100644
> --- a/drivers/iio/pressure/hid-sensor-press.c
> +++ b/drivers/iio/pressure/hid-sensor-press.c
> @@ -280,10 +280,8 @@ static int hid_press_probe(struct platform_device *pdev)
>  
>  	indio_dev->channels = kmemdup(press_channels, sizeof(press_channels),
>  				      GFP_KERNEL);
> -	if (!indio_dev->channels) {
> -		dev_err(&pdev->dev, "failed to duplicate channels\n");
> +	if (!indio_dev->channels)
>  		return -ENOMEM;
> -	}
>  
>  	ret = press_parse_report(pdev, hsdev,
>  				 (struct iio_chan_spec *)indio_dev->channels,

WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
	Archana Patni <archana.patni@linux.intel.com>,
	Hartmut Knaack <knaack.h@gmx.de>, Jiri Kosina <jikos@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iio/pressure: Delete an error message for a failed memory allocation in hid_press_probe()
Date: Sun, 4 Feb 2018 10:58:39 +0000	[thread overview]
Message-ID: <20180204105839.606f8d2e@archlinux> (raw)
In-Reply-To: <e7dfe444-616a-e156-31d5-8ed626434d1f@users.sourceforge.net>

On Mon, 29 Jan 2018 22:04:11 +0100
SF Markus Elfring <elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 29 Jan 2018 21:55:08 +0100
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Whilst the error message doesn't add a lot, it does add some information
over a simple memory copy failed error.

Hence I think we should keep it.

Jonathan

> ---
>  drivers/iio/pressure/hid-sensor-press.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
> index 4c437918f1d2..9de7590d50b0 100644
> --- a/drivers/iio/pressure/hid-sensor-press.c
> +++ b/drivers/iio/pressure/hid-sensor-press.c
> @@ -280,10 +280,8 @@ static int hid_press_probe(struct platform_device *pdev)
>  
>  	indio_dev->channels = kmemdup(press_channels, sizeof(press_channels),
>  				      GFP_KERNEL);
> -	if (!indio_dev->channels) {
> -		dev_err(&pdev->dev, "failed to duplicate channels\n");
> +	if (!indio_dev->channels)
>  		return -ENOMEM;
> -	}
>  
>  	ret = press_parse_report(pdev, hsdev,
>  				 (struct iio_chan_spec *)indio_dev->channels,


  reply	other threads:[~2018-02-04 10:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29 21:04 [PATCH] iio/pressure: Delete an error message for a failed memory allocation in hid_press_probe() SF Markus Elfring
2018-01-29 21:04 ` SF Markus Elfring
2018-02-04 10:58 ` Jonathan Cameron [this message]
2018-02-04 10:58   ` Jonathan Cameron
2018-02-04 10:58   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180204105839.606f8d2e@archlinux \
    --to=jic23@kernel.org \
    --cc=archana.patni@linux.intel.com \
    --cc=elfring@users.sourceforge.net \
    --cc=jikos@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.