linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: csmanjuvijay@gmail.com
Cc: Alan Stern <stern@rowland.harvard.edu>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] USB: OHCI: pxa27x:fix code warnig and errors
Date: Sun, 11 Dec 2016 08:11:03 +0100	[thread overview]
Message-ID: <20161211071103.GA32092@kroah.com> (raw)
In-Reply-To: <1481411325-22458-3-git-send-email-csmanjuvijay@gmail.com>

On Sat, Dec 10, 2016 at 11:08:45PM +0000, csmanjuvijay@gmail.com wrote:
> From: Manjunath Goudar <csmanjuvijay@gmail.com>
> 
> This patch will fix the checkpatch.pl following errors:
> WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ...
> then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
> ERROR: space prohibited after that open parenthesis '('
> ERROR: space prohibited before that close parenthesis ')'
> 
> Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> 
> ---
> changelog V1->V2:
> Have fixed the printk warning.
>  drivers/usb/host/ohci-pxa27x.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
> index c73e1ae..350e384 100644
> --- a/drivers/usb/host/ohci-pxa27x.c
> +++ b/drivers/usb/host/ohci-pxa27x.c
> @@ -138,12 +138,15 @@ struct pxa27x_ohci {
>   * PMM_PERPORT_MODE -- PMM per port switching mode
>   *     Ports are powered individually.
>   */
> -static int pxa27x_ohci_select_pmm(struct pxa27x_ohci *pxa_ohci, int mode)
> +static int pxa27x_ohci_select_pmm(struct pxa27x_ohci *pxa_ohci,
> +				struct device *dev)

Eeek, no!

Stop and look at what you did here.  Why would you want to include 2
struct device pointers in a function, when they really point to the same
thing?  That makes no sense at all.

I appreciate general code cleanups, but please, get some experience in C
and how the kernel handles the driver model before trying to make
changes like this.  You can't just blindly make coding style changes and
expect them to be correct without that knowledge.

If you want to make coding style fixes, please practice on the
drivers/staging/ area.  The maintainer of that code is much more
forgiving and not grumpy when stuff like this happens...

thanks,

greg k-h

  parent reply	other threads:[~2016-12-11  7:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1481332408-452-1-git-send-email-csmanjuvijay@gmail.com>
     [not found] ` <1481332408-452-3-git-send-email-csmanjuvijay@gmail.com>
2016-12-10 14:08   ` [PATCH 2/2] USB: OHCI: pxa27x:fix code errors Greg Kroah-Hartman
     [not found] ` <1481411325-22458-1-git-send-email-csmanjuvijay@gmail.com>
     [not found]   ` <1481411325-22458-3-git-send-email-csmanjuvijay@gmail.com>
2016-12-11  7:11     ` Greg Kroah-Hartman [this message]
     [not found]   ` <1481411325-22458-2-git-send-email-csmanjuvijay@gmail.com>
2016-12-11  7:11     ` [PATCH v2 1/2] USB: OHCI: pxa27x:fix code warnings Greg Kroah-Hartman

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=20161211071103.GA32092@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=csmanjuvijay@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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;
as well as URLs for NNTP newsgroup(s).