diff mbox

ASoC: dwc: remove 'out of memory' message

Message ID 20170225110323.7506-1-michelcatalin@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mihai Burduselu Feb. 25, 2017, 11:03 a.m. UTC
Reported by checkpatch.pl
Signed-off-by: Mihai Burduselu <michelcatalin@gmail.com>
---
 sound/soc/dwc/designware_i2s.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Takashi Sakamoto Feb. 26, 2017, 8:03 a.m. UTC | #1
Hi,

On Feb 25 2017 20:03, Mihai Burduselu wrote:
> Reported by checkpatch.pl
> Signed-off-by: Mihai Burduselu <michelcatalin@gmail.com>
> ---
>  sound/soc/dwc/designware_i2s.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
> index 9c46e4112026..6479768cc6a1 100644
> --- a/sound/soc/dwc/designware_i2s.c
> +++ b/sound/soc/dwc/designware_i2s.c
> @@ -611,10 +611,8 @@ static int dw_i2s_probe(struct platform_device *pdev)
>  	const char *clk_id;
>
>  	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> -	if (!dev) {
> -		dev_warn(&pdev->dev, "kzalloc fail\n");
> +	if (!dev)

The line for 'dev_warn()' should be kept.

>  		return -ENOMEM;
> -	}
>
>  	dw_i2s_dai = devm_kzalloc(&pdev->dev, sizeof(*dw_i2s_dai), GFP_KERNEL);
>  	if (!dw_i2s_dai)


Regards

Takashi Sakamoto
Takashi Iwai Feb. 28, 2017, 3:19 p.m. UTC | #2
On Sun, 26 Feb 2017 09:03:22 +0100,
Takashi Sakamoto wrote:
> 
> Hi,
> 
> On Feb 25 2017 20:03, Mihai Burduselu wrote:
> > Reported by checkpatch.pl
> > Signed-off-by: Mihai Burduselu <michelcatalin@gmail.com>
> > ---
> >  sound/soc/dwc/designware_i2s.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
> > index 9c46e4112026..6479768cc6a1 100644
> > --- a/sound/soc/dwc/designware_i2s.c
> > +++ b/sound/soc/dwc/designware_i2s.c
> > @@ -611,10 +611,8 @@ static int dw_i2s_probe(struct platform_device *pdev)
> >  	const char *clk_id;
> >
> >  	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> > -	if (!dev) {
> > -		dev_warn(&pdev->dev, "kzalloc fail\n");
> > +	if (!dev)
> 
> The line for 'dev_warn()' should be kept.

In general, people regard it superfluous since kmalloc() itself
already gives a kernel warning at an allocation error.  So removing
the message is OK in that sense.

However, the problem of this (and lots of other) patch is that it
doesn't give proper information.  Instead, in a single line, it merely
declares checkpatch.pl as a bible.  Very helpful, eh?

So, please reconsider the changelog when you submit this kind of
patches.


thanks,

Takashi
Mark Brown March 7, 2017, 12:56 p.m. UTC | #3
On Tue, Feb 28, 2017 at 04:19:41PM +0100, Takashi Iwai wrote:

> However, the problem of this (and lots of other) patch is that it
> doesn't give proper information.  Instead, in a single line, it merely
> declares checkpatch.pl as a bible.  Very helpful, eh?

> So, please reconsider the changelog when you submit this kind of
> patches.

Yeah, it's a *huge* set of patches with poor changelogs and very minor
benefits which is more work to digest than it seems useful to.
diff mbox

Patch

diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 9c46e4112026..6479768cc6a1 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -611,10 +611,8 @@  static int dw_i2s_probe(struct platform_device *pdev)
 	const char *clk_id;
 
 	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
-	if (!dev) {
-		dev_warn(&pdev->dev, "kzalloc fail\n");
+	if (!dev)
 		return -ENOMEM;
-	}
 
 	dw_i2s_dai = devm_kzalloc(&pdev->dev, sizeof(*dw_i2s_dai), GFP_KERNEL);
 	if (!dw_i2s_dai)