Re: [PATCH] USB: fix coding style issue

2017-08-30 Thread pierre kuo
hi Greg

> Note, not all subsystems appreciate coding style cleanups, so be aware
> of that if you do start to do this type of work outside of
> drivers/staging/
Got it.
thanks for your friendly reminder.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] USB: fix coding style issue

2017-08-30 Thread Greg KH
On Wed, Aug 30, 2017 at 09:37:26PM +0800, pierre kuo wrote:
> hi Greg:
> 
> 2017-08-16 23:46 GMT+08:00 Greg KH :
> > On Wed, Aug 16, 2017 at 11:01:20AM +0800, pierre Kuo wrote:
> >> try to fix some codeing style issue, such as "space prohibited" and "not
> >> initialise statics".
> >
> > Only do one type of thing in a single patch please.  And no, "fix all
> > coding style issues" is not a single thing.
> >
> > This needs to be multiple patches.
> so you mean
> a. patch1 for "space prohibited"
> b. patch2 for "not initalise statics"
> right?

Yes.

> >
> > If you want to do coding style cleanups, please start out in
> > drivers/staging/ so you can get the process correct.
> Got it.
> I just found some part of usb driver may need coding style cleanups
> while tracing code flow and hope can do some feedback to this mailing
> list.
> 
> So you mean we first run some typo check on drivers/staging/ and once
> patches accepted then we started for usb part?
> BTW, I found below link show people use checkpatch.pl to checking coding 
> style.
> http://www.tuxradar.com/content/newbies-guide-hacking-linux-kernel
> 
> is that ok if we use "./scripts/checkpatch.pl -f
> drivers/usb/host/ehci-xxx.c" and create different patches based on
> different coding style issue?
> (like above #a and #b shows?)

Please start in the drivers/staging/ portion of the kernel tree for
coding style cleanups.  That's a "safe" place to learn how to do all of
this work.  Only after you have experience there should you venture out
to other portions of the kernel.

Note, not all subsystems appreciate coding style cleanups, so be aware
of that if you do start to do this type of work outside of
drivers/staging/

good luck!

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] USB: fix coding style issue

2017-08-30 Thread pierre kuo
hi Greg:

2017-08-16 23:46 GMT+08:00 Greg KH :
> On Wed, Aug 16, 2017 at 11:01:20AM +0800, pierre Kuo wrote:
>> try to fix some codeing style issue, such as "space prohibited" and "not
>> initialise statics".
>
> Only do one type of thing in a single patch please.  And no, "fix all
> coding style issues" is not a single thing.
>
> This needs to be multiple patches.
so you mean
a. patch1 for "space prohibited"
b. patch2 for "not initalise statics"
right?

>
> If you want to do coding style cleanups, please start out in
> drivers/staging/ so you can get the process correct.
Got it.
I just found some part of usb driver may need coding style cleanups
while tracing code flow and hope can do some feedback to this mailing
list.

So you mean we first run some typo check on drivers/staging/ and once
patches accepted then we started for usb part?
BTW, I found below link show people use checkpatch.pl to checking coding style.
http://www.tuxradar.com/content/newbies-guide-hacking-linux-kernel

is that ok if we use "./scripts/checkpatch.pl -f
drivers/usb/host/ehci-xxx.c" and create different patches based on
different coding style issue?
(like above #a and #b shows?)

appreciate your kind help,
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] USB: fix coding style issue

2017-08-16 Thread Greg KH
On Wed, Aug 16, 2017 at 11:01:20AM +0800, pierre Kuo wrote:
> try to fix some codeing style issue, such as "space prohibited" and "not
> initialise statics".

Only do one type of thing in a single patch please.  And no, "fix all
coding style issues" is not a single thing.

This needs to be multiple patches.

If you want to do coding style cleanups, please start out in
drivers/staging/ so you can get the process correct.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] USB: fix coding style issue

2017-08-15 Thread pierre Kuo
try to fix some codeing style issue, such as "space prohibited" and "not
initialise statics".

Signed-off-by: pierre Kuo 
---
 drivers/usb/host/ehci-hcd.c   |  6 ++---
 drivers/usb/host/ehci-hub.c   | 22 -
 drivers/usb/host/ehci-mem.c   | 55 ++-
 drivers/usb/host/ehci-pci.c   |  4 ++--
 drivers/usb/host/ehci-sysfs.c |  2 +-
 5 files changed, 45 insertions(+), 44 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 6e834b83..cbcac78 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -68,7 +68,7 @@
 #define DRIVER_AUTHOR "David Brownell"
 #define DRIVER_DESC "USB 2.0 'Enhanced' Host Controller (EHCI) Driver"
 
-static const char  hcd_name [] = "ehci_hcd";
+static const char  hcd_name[] = "ehci_hcd";
 
 
 #undef EHCI_URB_TRACE
@@ -88,12 +88,12 @@
 #defineEHCI_TUNE_FLS   1   /* (medium) 512-frame schedule 
*/
 
 /* Initial IRQ latency:  faster than hw default */
-static int log2_irq_thresh = 0;// 0 to 6
+static int log2_irq_thresh;// 0 to 6
 module_param (log2_irq_thresh, int, S_IRUGO);
 MODULE_PARM_DESC (log2_irq_thresh, "log2 IRQ latency, 1-64 microframes");
 
 /* initial park setting:  slower than hw default */
-static unsigned park = 0;
+static unsigned int park;
 module_param (park, uint, S_IRUGO);
 MODULE_PARM_DESC (park, "park setting; 1-3 back-to-back async packets");
 
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index df169c8..e880861 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -268,7 +268,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
fs_idle_delay = false;
port = HCS_N_PORTS(ehci->hcs_params);
while (port--) {
-   u32 __iomem *reg = >regs->port_status [port];
+   u32 __iomem *reg = >regs->port_status[port];
u32 t1 = ehci_readl(ehci, reg) & ~PORT_RWC_BITS;
u32 t2 = t1 & ~PORT_WAKE_BITS;
 
@@ -474,14 +474,14 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
/* manually resume the ports we suspended during bus_suspend() */
i = HCS_N_PORTS (ehci->hcs_params);
while (i--) {
-   temp = ehci_readl(ehci, >regs->port_status [i]);
+   temp = ehci_readl(ehci, >regs->port_status[i]);
temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
if (test_bit(i, >bus_suspended) &&
(temp & PORT_SUSPEND)) {
temp |= PORT_RESUME;
set_bit(i, _needed);
}
-   ehci_writel(ehci, temp, >regs->port_status [i]);
+   ehci_writel(ehci, temp, >regs->port_status[i]);
}
 
/*
@@ -498,10 +498,10 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
 
i = HCS_N_PORTS (ehci->hcs_params);
while (i--) {
-   temp = ehci_readl(ehci, >regs->port_status [i]);
+   temp = ehci_readl(ehci, >regs->port_status[i]);
if (test_bit(i, _needed)) {
temp &= ~(PORT_RWC_BITS | PORT_SUSPEND | PORT_RESUME);
-   ehci_writel(ehci, temp, >regs->port_status [i]);
+   ehci_writel(ehci, temp, >regs->port_status[i]);
}
}
 
@@ -628,7 +628,7 @@ static int check_reset_complete (
u32 ppcd = ~0;
 
/* init status to no-changes */
-   buf [0] = 0;
+   buf[0] = 0;
ports = HCS_N_PORTS (ehci->hcs_params);
if (ports > 7) {
buf [1] = 0;
@@ -679,9 +679,9 @@ static int check_reset_complete (
|| (ehci->reset_done[i] && time_after_eq(
jiffies, ehci->reset_done[i]))) {
if (i < 7)
-   buf [0] |= 1 << (i + 1);
+   buf[0] |= 1 << (i + 1);
else
-   buf [1] |= 1 << (i - 7);
+   buf[1] |= 1 << (i - 7);
status = STS_PCD;
}
}
@@ -1016,7 +1016,7 @@ int ehci_hub_control(
if (temp & PORT_PEC)
status |= USB_PORT_STAT_C_ENABLE << 16;
 
-   if ((temp & PORT_OCC) && !ignore_oc){
+   if ((temp & PORT_OCC) && !ignore_oc) {
status |= USB_PORT_STAT_C_OVERCURRENT << 16;
 
/*
@@ -1077,7 +1077,7 @@ int ehci_hub_control(
/* whoever resets must GetPortStatus to complete it!! */
} else {
status |= USB_PORT_STAT_C_RESET << 16;
-   ehci->reset_done [wIndex] = 0;
+   ehci->reset_done[wIndex] = 0;
 
/* force reset to complete */
   

[PATCH] usb: fix coding style issue

2015-06-16 Thread Kris Borer
Fixed coding style issue: newline after declaration

Signed-off-by: Kris Borer kbo...@gmail.com
---
 drivers/usb/core/driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 818369a..6b5063e 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -160,6 +160,7 @@ static ssize_t remove_id_store(struct device_driver 
*driver, const char *buf,
spin_lock(usb_driver-dynids.lock);
list_for_each_entry_safe(dynid, n, usb_driver-dynids.list, node) {
struct usb_device_id *id = dynid-id;
+
if ((id-idVendor == idVendor) 
(id-idProduct == idProduct)) {
list_del(dynid-node);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html