lkml.org 
[lkml]   [2016]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 2/2] USB: OHCI: pxa27x:fix code warnig and errors
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

\
 
 \ /
  Last update: 2016-12-11 08:11    [W:0.022 / U:4.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site