public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Pushkar Jambhlekar <pushkar.iit@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tamara Diaconita <diaconitatamara@gmail.com>,
	Jasmin Jessich <jasmin@anw.at>,
	Ralph Metzler <rjkm@metzlerbros.de>,
	Eva Rachel Retuya <eraretuya@gmail.com>
Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/staging/media:  Prefer using  __func__ instead
Date: Thu, 29 Jun 2017 06:30:16 -0700	[thread overview]
Message-ID: <1498743016.8633.14.camel@perches.com> (raw)
In-Reply-To: <1498735766-3068-1-git-send-email-pushkar.iit@gmail.com>

On Thu, 2017-06-29 at 16:59 +0530, Pushkar Jambhlekar wrote:
> Function name is hardcoded. replacing with __func__

Please run your proposed patches through checkpatch
before you send them.

> diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c
[]
> @@ -100,7 +100,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter, u8 adr,
>  				   .buf = val, .len = 1} };
>  
>  	if (i2c_transfer(adapter, msgs, 2) != 2) {
> -		dev_err(&adapter->dev, "error in i2c_read_reg\n");
> +		dev_err(&adapter->dev, "error in %s\n", __func__);
>  		return -1;
>  	}
>  	return 0;
> @@ -115,7 +115,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr,
>  				   .buf = data, .len = n} };
>  
>  	if (i2c_transfer(adapter, msgs, 2) != 2) {
> -		dev_err(&adapter->dev, "error in i2c_read\n");
> +		dev_err(&adapter->dev, "error in %s\n",__func__);

There is a missing space before __func__.

As well, the form for listing a function name
is generally:

	print("%s: <error description>\n", __func__);

so ideally, these messages would be something like:

		dev_err(&adapter->dev, "%s: i2c_transfer error\n", __func__);

      reply	other threads:[~2017-06-29 13:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 11:29 [PATCH] drivers/staging/media: Prefer using __func__ instead Pushkar Jambhlekar
2017-06-29 13:30 ` Joe Perches [this message]

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=1498743016.8633.14.camel@perches.com \
    --to=joe@perches.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=diaconitatamara@gmail.com \
    --cc=eraretuya@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasmin@anw.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=pushkar.iit@gmail.com \
    --cc=rjkm@metzlerbros.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox