[PATCH 1/3] staging: rtl8192e: fixed block comments use * on subsequent lines

2016-09-27 Thread Darryl T. Agostinelli
fixed block comments use * on subsequent lines

Signed-off-by: Darryl T. Agostinelli 
---
 drivers/staging/rtl8192e/rtllib_tx.c | 54 ++--
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_tx.c 
b/drivers/staging/rtl8192e/rtllib_tx.c
index 58fc70e..04fbc07 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -1,31 +1,31 @@
 /**
-
-  Copyright(c) 2003 - 2004 Intel Corporation. All rights reserved.
-
-  This program is free software; you can redistribute it and/or modify it
-  under the terms of version 2 of the GNU General Public License as
-  published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but WITHOUT
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-  more details.
-
-  The full GNU General Public License is included in this distribution in the
-  file called LICENSE.
-
-  Contact Information:
-  James P. Ketrenos 
-  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
-
-**
-
-  Few modifications for Realtek's Wi-Fi drivers by
-  Andrea Merello 
-
-  A special thanks goes to Realtek for their support !
-
-**/
+ *
+ * Copyright(c) 2003 - 2004 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * The full GNU General Public License is included in this distribution in the
+ * file called LICENSE.
+ *
+ * Contact Information:
+ * James P. Ketrenos 
+ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+ *
+ *
+ *
+ * Few modifications for Realtek's Wi-Fi drivers by
+ * Andrea Merello 
+ *
+ * A special thanks goes to Realtek for their support !
+ *
+ */
 
 #include 
 #include 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] staging: rtl8192e: fixed statements should start on a tabstop

2016-09-27 Thread Darryl T. Agostinelli
fixed statements should start on a tabstop

Signed-off-by: Darryl T. Agostinelli 
---
 drivers/staging/rtl8192e/rtllib_tx.c | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_tx.c 
b/drivers/staging/rtl8192e/rtllib_tx.c
index 04fbc07..43ca90d 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -731,17 +731,19 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct 
net_device *dev)
if (qos_actived) {
hdr_len = RTLLIB_3ADDR_LEN + 2;
 
-   /* in case we are a client verify acm is not set for this ac */
-   while (unlikely(ieee->wmm_acm & (0x01 << skb->priority))) {
-   netdev_info(ieee->dev, "skb->priority = %x\n",
-   skb->priority);
-   if (wme_downgrade_ac(skb))
-   break;
-   netdev_info(ieee->dev, "converted skb->priority = %x\n",
-  skb->priority);
-}
+   /* in case we are a client verify acm is not set for 
this ac */
+   while (unlikely(ieee->wmm_acm & (0x01 << 
skb->priority))) {
+   netdev_info(ieee->dev, "skb->priority = %x\n",
+   skb->priority);
+   if (wme_downgrade_ac(skb))
+   break;
+   netdev_info(ieee->dev, "converted skb->priority 
= %x\n",
+  skb->priority);
+   }
+
qos_ctl |= skb->priority;
header.qos_ctl = cpu_to_le16(qos_ctl & RTLLIB_QOS_TID);
+
} else {
hdr_len = RTLLIB_3ADDR_LEN;
}
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/3] staging: rtl8192e: fixed use a blank line after function/struct/union/enum declarations

2016-09-27 Thread Darryl T. Agostinelli
fixed use a blank line after function/struct/union/enum declarations

Signed-off-by: Darryl T. Agostinelli 
---
 drivers/staging/rtl8192e/rtllib_tx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8192e/rtllib_tx.c 
b/drivers/staging/rtl8192e/rtllib_tx.c
index 43ca90d..78a3ad5 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -983,6 +983,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct 
net_device *dev)
return 1;
 
 }
+
 int rtllib_xmit(struct sk_buff *skb, struct net_device *dev)
 {
memset(skb->cb, 0, sizeof(skb->cb));
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 1/2 v2] pci-hyperv: properly handle pci bus remove

2016-09-27 Thread Long Li


> -Original Message-
> From: Bjorn Helgaas [mailto:helg...@kernel.org]
> Sent: Tuesday, September 27, 2016 12:30 PM
> To: Long Li 
> Cc: KY Srinivasan ; Haiyang Zhang
> ; Bjorn Helgaas ;
> de...@linuxdriverproject.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Long Li 
> Subject: Re: [PATCH 1/2 v2] pci-hyperv: properly handle pci bus remove
> 
> On Wed, Sep 14, 2016 at 07:10:01PM -0700, Long Li wrote:
> > From: Long Li 
> >
> > hv_pci_devices_present is called in hv_pci_remove when we remove a PCI
> device from host (e.g. by disabling SRIOV on a device). In hv_pci_remove,
> the bus is already removed before the call, so we don't need to rescan the
> bus in the workqueue scheduled from hv_pci_devices_present. By
> introducing status hv_pcibus_removed, we can avoid this situation.
> >
> > The patch fixes the following kernel panic.
> >
> > [  383.853124] Workqueue: events pci_devices_present_work [pci_hyperv]
> > [  383.853124] task: 88007f5f8000 ti: 88007f60 task.ti:
> > 88007f60
> > [  383.853124] RIP: 0010:[]  []
> > pci_is_pcie+0x6/0x20
> > [  383.853124] RSP: 0018:88007f603d38  EFLAGS: 00010206 [
> > 383.853124] RAX: 88007f5f8000 RBX: 642f3d4854415056 RCX:
> > 88007f603fd8
> > [  383.853124] RDX:  RSI:  RDI:
> > 642f3d4854415056
> > [  383.853124] RBP: 88007f603d68 R08: 0246 R09:
> > a045eb9e
> > [  383.853124] R10: 88007b419a80 R11: ea0001c0ef40 R12:
> > 880003ee1c00
> > [  383.853124] R13: 63702f30303a3137 R14:  R15:
> > 0246
> > [  383.853124] FS:  () GS:88007b40()
> > knlGS:
> > [  383.853124] CS:  0010 DS:  ES:  CR0: 80050033 [
> > 383.853124] CR2: 7f68b3f52350 CR3: 03546000 CR4:
> > 000406f0
> > [  383.853124] DR0:  DR1:  DR2:
> > 
> > [  383.853124] DR3:  DR6: 0ff0 DR7:
> > 0400
> > [  383.853124] Stack:
> > [  383.853124]  88007f603d68 8134db17 0008
> > 880003ee1c00
> > [  383.853124]  63702f30303a3137 880003d8edb8 88007f603da0
> > 8134ee2d [  383.853124]  880003d8ed00 88007f603dd8
> > 880075fec320
> > 880003d8edb8
> > [  383.853124] Call Trace:
> > [  383.853124]  [] ? pci_scan_slot+0x27/0x140 [
> > 383.853124]  [] pci_scan_child_bus+0x3d/0x150 [
> > 383.853124]  []
> > pci_devices_present_work+0x3ea/0x400 [pci_hyperv] [  383.853124]
> > [] process_one_work+0x17b/0x470 [  383.853124]
> > [] worker_thread+0x126/0x410 [  383.853124]
> > [] ? rescuer_thread+0x460/0x460 [  383.853124]
> > [] kthread+0xcf/0xe0 [  383.853124]
> > [] ?
> > kthread_create_on_node+0x140/0x140
> > [  383.853124]  [] ret_from_fork+0x58/0x90 [
> > 383.853124]  [] ?
> > kthread_create_on_node+0x140/0x140
> > [  383.853124] Code: 89 e5 5d 25 f0 00 00 00 c1 f8 04 c3 66 0f 1f 84
> > 00
> > 00 00 00 00 66 66 66 66 90 55 0f b6 47 4a 48 89 e5 5d c3 90 66 66 66
> > 66
> > 90 55 <80> 7f 4a 00 48 89 e5 5d 0f 95 c0 c3 0f 1f 40 00 66 2e 0f 1f 84
> > [  383.853124] RIP  [] pci_is_pcie+0x6/0x20 [
> > 383.853124]  RSP 
> 
> Personally, I would remove the timestamps and addresses from this trace
> because I don't think they contribute to diagnosing the problem.

Thanks Bjorn. I will remove those kernel traces and send a v3 patch.

> 
> > Signed-off-by: Long Li 
> 
> I'm ready to apply these but am waiting for an ack from the maintainers listed
> in MAINTAINERS (feel free to update that if it's out of date).
> 
> > ---
> >  drivers/pci/host/pci-hyperv.c | 20 +---
> >  1 file changed, 17 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/pci/host/pci-hyperv.c
> > b/drivers/pci/host/pci-hyperv.c index a8deeca..4a37598 100644
> > --- a/drivers/pci/host/pci-hyperv.c
> > +++ b/drivers/pci/host/pci-hyperv.c
> > @@ -348,6 +348,7 @@ enum hv_pcibus_state {
> > hv_pcibus_init = 0,
> > hv_pcibus_probed,
> > hv_pcibus_installed,
> > +   hv_pcibus_removed,
> > hv_pcibus_maximum
> >  };
> >
> > @@ -1481,13 +1482,24 @@ static void pci_devices_present_work(struct
> work_struct *work)
> > put_pcichild(hpdev, hv_pcidev_ref_initial);
> > }
> >
> > -   /* Tell the core to rescan bus because there may have been changes.
> */
> > -   if (hbus->state == hv_pcibus_installed) {
> > +   switch (hbus->state) {
> > +   case hv_pcibus_installed:
> > +   /*
> > +* Tell the core to rescan bus
> > +* because there may have been changes.
> > +*/
> > pci_lock_rescan_remove();
> > pci_scan_child_bus(hbus->pci_bus);
> > pci_unlock_rescan_remove();
> > -   } else {
> > +   break;
> > +
> > +   case 

RE: [PATCH 1/2 v2] pci-hyperv: properly handle pci bus remove

2016-09-27 Thread Long Li
Thanks for pointing that out.

If you don't mind, I will also add "Tested-by: Cathy Avery ".

> -Original Message-
> From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On
> Behalf Of Cathy Avery
> Sent: Friday, September 23, 2016 4:59 AM
> To: driverdev-devel@linuxdriverproject.org
> Subject: Re: [PATCH 1/2 v2] pci-hyperv: properly handle pci bus remove
> 
> Hi,
> 
> You seem to be missing the Reported-by tag.
> 
> That's xiaof...@redhat.com.
> 
> Cathy
> 
> On 09/14/2016 10:10 PM, Long Li wrote:
> > From: Long Li 
> >
> > hv_pci_devices_present is called in hv_pci_remove when we remove a PCI
> device from host (e.g. by disabling SRIOV on a device). In hv_pci_remove,
> the bus is already removed before the call, so we don't need to rescan the
> bus in the workqueue scheduled from hv_pci_devices_present. By
> introducing status hv_pcibus_removed, we can avoid this situation.
> >
> > The patch fixes the following kernel panic.
> >
> > [  383.853124] Workqueue: events pci_devices_present_work [pci_hyperv]
> > [  383.853124] task: 88007f5f8000 ti: 88007f60 task.ti:
> > 88007f60
> > [  383.853124] RIP: 0010:[]  []
> > pci_is_pcie+0x6/0x20
> > [  383.853124] RSP: 0018:88007f603d38  EFLAGS: 00010206 [
> > 383.853124] RAX: 88007f5f8000 RBX: 642f3d4854415056 RCX:
> > 88007f603fd8
> > [  383.853124] RDX:  RSI:  RDI:
> > 642f3d4854415056
> > [  383.853124] RBP: 88007f603d68 R08: 0246 R09:
> > a045eb9e
> > [  383.853124] R10: 88007b419a80 R11: ea0001c0ef40 R12:
> > 880003ee1c00
> > [  383.853124] R13: 63702f30303a3137 R14:  R15:
> > 0246
> > [  383.853124] FS:  () GS:88007b40()
> > knlGS:
> > [  383.853124] CS:  0010 DS:  ES:  CR0: 80050033 [
> > 383.853124] CR2: 7f68b3f52350 CR3: 03546000 CR4:
> > 000406f0
> > [  383.853124] DR0:  DR1:  DR2:
> > 
> > [  383.853124] DR3:  DR6: 0ff0 DR7:
> > 0400
> > [  383.853124] Stack:
> > [  383.853124]  88007f603d68 8134db17 0008
> > 880003ee1c00
> > [  383.853124]  63702f30303a3137 880003d8edb8 88007f603da0
> > 8134ee2d [  383.853124]  880003d8ed00 88007f603dd8
> > 880075fec320
> > 880003d8edb8
> > [  383.853124] Call Trace:
> > [  383.853124]  [] ? pci_scan_slot+0x27/0x140 [
> > 383.853124]  [] pci_scan_child_bus+0x3d/0x150 [
> > 383.853124]  []
> > pci_devices_present_work+0x3ea/0x400 [pci_hyperv] [  383.853124]
> > [] process_one_work+0x17b/0x470 [  383.853124]
> > [] worker_thread+0x126/0x410 [  383.853124]
> > [] ? rescuer_thread+0x460/0x460 [  383.853124]
> > [] kthread+0xcf/0xe0 [  383.853124]
> > [] ?
> > kthread_create_on_node+0x140/0x140
> > [  383.853124]  [] ret_from_fork+0x58/0x90 [
> > 383.853124]  [] ?
> > kthread_create_on_node+0x140/0x140
> > [  383.853124] Code: 89 e5 5d 25 f0 00 00 00 c1 f8 04 c3 66 0f 1f 84
> > 00
> > 00 00 00 00 66 66 66 66 90 55 0f b6 47 4a 48 89 e5 5d c3 90 66 66 66
> > 66
> > 90 55 <80> 7f 4a 00 48 89 e5 5d 0f 95 c0 c3 0f 1f 40 00 66 2e 0f 1f 84
> > [  383.853124] RIP  [] pci_is_pcie+0x6/0x20 [
> > 383.853124]  RSP 
> >
> > Signed-off-by: Long Li 
> > ---
> >   drivers/pci/host/pci-hyperv.c | 20 +---
> >   1 file changed, 17 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/pci/host/pci-hyperv.c
> > b/drivers/pci/host/pci-hyperv.c index a8deeca..4a37598 100644
> > --- a/drivers/pci/host/pci-hyperv.c
> > +++ b/drivers/pci/host/pci-hyperv.c
> > @@ -348,6 +348,7 @@ enum hv_pcibus_state {
> > hv_pcibus_init = 0,
> > hv_pcibus_probed,
> > hv_pcibus_installed,
> > +   hv_pcibus_removed,
> > hv_pcibus_maximum
> >   };
> >
> > @@ -1481,13 +1482,24 @@ static void pci_devices_present_work(struct
> work_struct *work)
> > put_pcichild(hpdev, hv_pcidev_ref_initial);
> > }
> >
> > -   /* Tell the core to rescan bus because there may have been changes.
> */
> > -   if (hbus->state == hv_pcibus_installed) {
> > +   switch (hbus->state) {
> > +   case hv_pcibus_installed:
> > +   /*
> > +* Tell the core to rescan bus
> > +* because there may have been changes.
> > +*/
> > pci_lock_rescan_remove();
> > pci_scan_child_bus(hbus->pci_bus);
> > pci_unlock_rescan_remove();
> > -   } else {
> > +   break;
> > +
> > +   case hv_pcibus_init:
> > +   case hv_pcibus_probed:
> > survey_child_resources(hbus);
> > +   break;
> > +
> > +   default:
> > +   break;
> > }
> >
> > up(>enum_sem);
> > @@ -2163,6 +2175,7 @@ static int hv_pci_probe(struct hv_device *hdev,
> > hbus = kzalloc(sizeof(*hbus), GFP_KERNEL);
> > if (!hbus)
> > 

[RFC v2 1/4] skge: Change LED_OFF to LED_REG_OFF in marvel skge driver to avoid conflicts with leds namespace

2016-09-27 Thread Zach Brown
Adding led support for phy causes namespace conflicts for some
phy drivers.

The marvel skge driver declared an enum for representing the states of
Link LED Register. The enum contained constant LED_OFF which conflicted
with declartation found in linux/leds.h.
LED_OFF changed to LED_REG_OFF

Signed-off-by: Zach Brown 
---
 drivers/net/ethernet/marvell/skge.c | 4 ++--
 drivers/net/ethernet/marvell/skge.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/skge.c 
b/drivers/net/ethernet/marvell/skge.c
index 7173836..ff5a087 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -1062,7 +1062,7 @@ static void skge_link_up(struct skge_port *skge)
 
 static void skge_link_down(struct skge_port *skge)
 {
-   skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_OFF);
+   skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_REG_OFF);
netif_carrier_off(skge->netdev);
netif_stop_queue(skge->netdev);
 
@@ -2668,7 +2668,7 @@ static int skge_down(struct net_device *dev)
if (hw->ports == 1)
free_irq(hw->pdev->irq, hw);
 
-   skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_OFF);
+   skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG), LED_REG_OFF);
if (is_genesis(hw))
genesis_stop(skge);
else
diff --git a/drivers/net/ethernet/marvell/skge.h 
b/drivers/net/ethernet/marvell/skge.h
index a2eb341..ec054d3 100644
--- a/drivers/net/ethernet/marvell/skge.h
+++ b/drivers/net/ethernet/marvell/skge.h
@@ -663,7 +663,7 @@ enum {
LED_SYNC_ON = 1<<3, /* Use Sync Wire to switch LED */
LED_SYNC_OFF= 1<<2, /* Disable Sync Wire Input */
LED_ON  = 1<<1, /* switch LED on */
-   LED_OFF = 1<<0, /* switch LED off */
+   LED_REG_OFF = 1<<0, /* switch LED off */
 };
 
 /* Receive GMAC FIFO (YUKON) */
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC v2 2/4] staging: rtl8712: Change _LED_STATE enum in rtl871x driver to avoid conflicts with LED namespace

2016-09-27 Thread Zach Brown
Adding led support for phy causes namespace conflicts for some
phy drivers.

The rtl871 driver declared an enum for representing LED states. The enum
contains constant LED_OFF which conflicted with declaration found in
linux/leds.h. LED_OFF changed to LED_STATE_OFF
In order to avoid a possible future collision LED_ON was changed to
LED_STATE_ON as well.

Signed-off-by: Zach Brown 
---
 drivers/staging/rtl8712/rtl8712_led.c | 388 +-
 1 file changed, 194 insertions(+), 194 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_led.c 
b/drivers/staging/rtl8712/rtl8712_led.c
index 9055827..8a524ac 100644
--- a/drivers/staging/rtl8712/rtl8712_led.c
+++ b/drivers/staging/rtl8712/rtl8712_led.c
@@ -51,8 +51,8 @@
  */
 enum _LED_STATE_871x {
LED_UNKNOWN = 0,
-   LED_ON = 1,
-   LED_OFF = 2,
+   LED_STATE_ON = 1,
+   LED_STATE_OFF = 2,
LED_BLINK_NORMAL = 3,
LED_BLINK_SLOWLY = 4,
LED_POWER_ON_BLINK = 5,
@@ -92,7 +92,7 @@ static void InitLed871x(struct _adapter *padapter, struct 
LED_871x *pLed,
nic = padapter->pnetdev;
pLed->padapter = padapter;
pLed->LedPin = LedPin;
-   pLed->CurrLedState = LED_OFF;
+   pLed->CurrLedState = LED_STATE_OFF;
pLed->bLedOn = false;
pLed->bLedBlinkInProgress = false;
pLed->BlinkTimes = 0;
@@ -208,7 +208,7 @@ static void SwLedBlink(struct LED_871x *pLed)
u8 bStopBlinking = false;
 
/* Change LED according to BlinkingLedState specified. */
-   if (pLed->BlinkingLedState == LED_ON)
+   if (pLed->BlinkingLedState == LED_STATE_ON)
SwLedOn(padapter, pLed);
else
SwLedOff(padapter, pLed);
@@ -248,10 +248,10 @@ static void SwLedBlink(struct LED_871x *pLed)
pLed->bLedBlinkInProgress = false;
} else {
/* Assign LED state to toggle. */
-   if (pLed->BlinkingLedState == LED_ON)
-   pLed->BlinkingLedState = LED_OFF;
+   if (pLed->BlinkingLedState == LED_STATE_ON)
+   pLed->BlinkingLedState = LED_STATE_OFF;
else
-   pLed->BlinkingLedState = LED_ON;
+   pLed->BlinkingLedState = LED_STATE_ON;
 
/* Schedule a timer to toggle LED state. */
switch (pLed->CurrLedState) {
@@ -288,7 +288,7 @@ static void SwLedBlink1(struct LED_871x *pLed)
if (peeprompriv->CustomerID == RT_CID_819x_CAMEO)
pLed = &(ledpriv->SwLed1);
/* Change LED according to BlinkingLedState specified. */
-   if (pLed->BlinkingLedState == LED_ON)
+   if (pLed->BlinkingLedState == LED_STATE_ON)
SwLedOn(padapter, pLed);
else
SwLedOff(padapter, pLed);
@@ -312,17 +312,17 @@ static void SwLedBlink1(struct LED_871x *pLed)
switch (pLed->CurrLedState) {
case LED_BLINK_SLOWLY:
if (pLed->bLedOn)
-   pLed->BlinkingLedState = LED_OFF;
+   pLed->BlinkingLedState = LED_STATE_OFF;
else
-   pLed->BlinkingLedState = LED_ON;
+   pLed->BlinkingLedState = LED_STATE_ON;
mod_timer(>BlinkTimer, jiffies +
  msecs_to_jiffies(LED_BLINK_NO_LINK_INTERVAL_ALPHA));
break;
case LED_BLINK_NORMAL:
if (pLed->bLedOn)
-   pLed->BlinkingLedState = LED_OFF;
+   pLed->BlinkingLedState = LED_STATE_OFF;
else
-   pLed->BlinkingLedState = LED_ON;
+   pLed->BlinkingLedState = LED_STATE_ON;
mod_timer(>BlinkTimer, jiffies +
  msecs_to_jiffies(LED_BLINK_LINK_INTERVAL_ALPHA));
break;
@@ -335,27 +335,27 @@ static void SwLedBlink1(struct LED_871x *pLed)
pLed->bLedLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_NORMAL;
if (pLed->bLedOn)
-   pLed->BlinkingLedState = LED_OFF;
+   pLed->BlinkingLedState = LED_STATE_OFF;
else
-   pLed->BlinkingLedState = LED_ON;
+   pLed->BlinkingLedState = LED_STATE_ON;
mod_timer(>BlinkTimer, jiffies +
  
msecs_to_jiffies(LED_BLINK_LINK_INTERVAL_ALPHA));
} else if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
pLed->bLedNoLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_SLOWLY;
if (pLed->bLedOn)
-   

[RFC v2 4/4] phy, leds: add support for led triggers on phy link state change

2016-09-27 Thread Zach Brown
From: Josh Cartwright 

Create an option CONFIG_LED_TRIGGER_PHY (default n), which will
create a set of led triggers for each instantiated PHY device.  There is
one LED trigger per link-speed, per-phy.

This allows for a user to configure their system to allow a set of LEDs
to represent link state changes on the phy.

Signed-off-by: Josh Cartwright 
Signed-off-by: Nathan Sullivan 
Signed-off-by: Zach Brown 
---
 drivers/net/phy/Kconfig|  13 +++-
 drivers/net/phy/Makefile   |   1 +
 drivers/net/phy/phy.c  |   1 +
 drivers/net/phy/phy_device.c   |   4 ++
 drivers/net/phy/phy_led_triggers.c | 121 +
 include/linux/phy.h|   9 +++
 include/linux/phy_led_triggers.h   |  52 
 7 files changed, 200 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/phy/phy_led_triggers.c
 create mode 100644 include/linux/phy_led_triggers.h

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 1c3e07c..f233625 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -25,6 +25,18 @@ config MDIO_BCM_IPROC
  This module provides a driver for the MDIO busses found in the
  Broadcom iProc SoC's.
 
+config LED_TRIGGER_PHY
+   bool "Support LED triggers for tracking link state"
+   depends on LEDS_TRIGGERS
+   ---help---
+ Adds support for a set of LED trigger events per-PHY.  Link
+ state change will trigger the events, for consumption by an
+ LED class driver.  There are triggers for each link speed,
+ and are of the form:
+  ::
+
+ Where speed is one of: 10Mbps, 100Mbps, 1Gbps, 2.5Gbps, or 10Gbps.
+
 config MDIO_BCM_UNIMAC
tristate "Broadcom UniMAC MDIO bus controller"
depends on HAS_IOMEM
@@ -40,7 +52,6 @@ config MDIO_BITBANG
  This module implements the MDIO bus protocol in software,
  for use by low level drivers that export the ability to
  drive the relevant pins.
-
  If in doubt, say N.
 
 config MDIO_BUS_MUX
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index e58667d..86d12cd 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -2,6 +2,7 @@
 
 libphy-y   := phy.o phy_device.o mdio_bus.o mdio_device.o
 libphy-$(CONFIG_SWPHY) += swphy.o
+libphy-$(CONFIG_LED_TRIGGER_PHY)   += phy_led_triggers.o
 
 obj-$(CONFIG_PHYLIB)   += libphy.o
 
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f5721db..e5f9fee7 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -896,6 +896,7 @@ EXPORT_SYMBOL(phy_start);
 static void phy_adjust_link(struct phy_device *phydev)
 {
phydev->adjust_link(phydev->attached_dev);
+   phy_led_trigger_change_speed(phydev);
 }
 
 /**
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index e977ba9..4671c13 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -57,6 +58,7 @@ static void phy_mdio_device_free(struct mdio_device *mdiodev)
 
 static void phy_device_release(struct device *dev)
 {
+   phy_led_triggers_unregister(to_phy_device(dev));
kfree(to_phy_device(dev));
 }
 
@@ -345,6 +347,8 @@ struct phy_device *phy_device_create(struct mii_bus *bus, 
int addr, int phy_id,
 
dev->state = PHY_DOWN;
 
+   phy_led_triggers_register(dev);
+
mutex_init(>lock);
INIT_DELAYED_WORK(>state_queue, phy_state_machine);
INIT_WORK(>phy_queue, phy_change);
diff --git a/drivers/net/phy/phy_led_triggers.c 
b/drivers/net/phy/phy_led_triggers.c
new file mode 100644
index 000..32326d7
--- /dev/null
+++ b/drivers/net/phy/phy_led_triggers.c
@@ -0,0 +1,121 @@
+/* Copyright (C) 2016 National Instruments Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+  * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include 
+#include 
+#include 
+
+static struct phy_led_trigger *phy_speed_to_led_trigger(struct phy_device *phy,
+   unsigned int speed)
+{
+   switch (speed) {
+   case SPEED_10:
+   return >phy_led_trigger[0];
+   case SPEED_100:
+   return >phy_led_trigger[1];
+   case SPEED_1000:
+   return >phy_led_trigger[2];
+   case SPEED_2500:
+   return 

[RFC v2 0/4] Add support for led triggers on phy link state change

2016-09-27 Thread Zach Brown
Fix two net drivers that declared enum constants that conflict with enum
constants in linux/leds.h

Create function that encapsulates actions taken during the adjust phy link step
of phy state changes.

Add support for led triggers on phy link state changes by adding
a config option. When set the config option will create a set of led triggers
for each phy device. Users can use the led triggers to represent link state
changes on the phy.

v2:
 * New patch that creates phy_adjust_link function to encapsulate actions taken
   when adjusting phy link during phy state changes
 * led trigger speed strings changed to match existing phy speed strings
 * New function that maps speeds to led triggers
 * Replace magic constants with definitions when declaring trigger name buffer
   and number of triggers.

Josh Cartwright (1):
  phy,leds: add support for led triggers on phy link state change

Zach Brown (3):
  skge: Change LED_OFF to LED_REG_OFF in marvel skge driver to avoid
conflicts with leds namespace
  staging: rtl8712: Change _LED_STATE enum in rtl871x driver to avoid
conflicts with LED namespace
  phy: Encapsulate actions performed during link state changes into
function phy_adjust_link

 drivers/net/ethernet/marvell/skge.c   |   4 +-
 drivers/net/ethernet/marvell/skge.h   |   2 +-
 drivers/net/phy/Kconfig   |  13 +-
 drivers/net/phy/Makefile  |   1 +
 drivers/net/phy/phy.c |  22 +-
 drivers/net/phy/phy_device.c  |   4 +
 drivers/net/phy/phy_led_triggers.c| 121 +++
 drivers/staging/rtl8712/rtl8712_led.c | 388 +-
 include/linux/phy.h   |   9 +
 include/linux/phy_led_triggers.h  |  52 +
 10 files changed, 410 insertions(+), 206 deletions(-)
 create mode 100644 drivers/net/phy/phy_led_triggers.c
 create mode 100644 include/linux/phy_led_triggers.h

--
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC v2 3/4] phy: Encapsulate actions performed during link state changes into function phy_adjust_link

2016-09-27 Thread Zach Brown
During phy state machine state transitions some set of actions should
occur whenever the link state changes. These actions should be
encapsulated into a single function.

This patch adds the phy_adjust_link function, which is called whenever
phydev->adjust_link would have been called before. Actions that should
occur whenever the phy link is adjusted can now be added to the
phy_adjust_link function.

Signed-off-by: Zach Brown 
---
 drivers/net/phy/phy.c | 21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c6f6683..f5721db 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -893,6 +893,11 @@ void phy_start(struct phy_device *phydev)
 }
 EXPORT_SYMBOL(phy_start);
 
+static void phy_adjust_link(struct phy_device *phydev)
+{
+   phydev->adjust_link(phydev->attached_dev);
+}
+
 /**
  * phy_state_machine - Handle the state machine
  * @work: work_struct that describes the work to be done
@@ -935,7 +940,7 @@ void phy_state_machine(struct work_struct *work)
if (!phydev->link) {
phydev->state = PHY_NOLINK;
netif_carrier_off(phydev->attached_dev);
-   phydev->adjust_link(phydev->attached_dev);
+   phy_adjust_link(phydev);
break;
}
 
@@ -948,7 +953,7 @@ void phy_state_machine(struct work_struct *work)
if (err > 0) {
phydev->state = PHY_RUNNING;
netif_carrier_on(phydev->attached_dev);
-   phydev->adjust_link(phydev->attached_dev);
+   phy_adjust_link(phydev);
 
} else if (0 == phydev->link_timeout--)
needs_aneg = true;
@@ -975,7 +980,7 @@ void phy_state_machine(struct work_struct *work)
}
phydev->state = PHY_RUNNING;
netif_carrier_on(phydev->attached_dev);
-   phydev->adjust_link(phydev->attached_dev);
+   phy_adjust_link(phydev);
}
break;
case PHY_FORCING:
@@ -991,7 +996,7 @@ void phy_state_machine(struct work_struct *work)
needs_aneg = true;
}
 
-   phydev->adjust_link(phydev->attached_dev);
+   phy_adjust_link(phydev);
break;
case PHY_RUNNING:
/* Only register a CHANGE if we are polling and link changed
@@ -1020,7 +1025,7 @@ void phy_state_machine(struct work_struct *work)
netif_carrier_off(phydev->attached_dev);
}
 
-   phydev->adjust_link(phydev->attached_dev);
+   phy_adjust_link(phydev);
 
if (phy_interrupt_is_valid(phydev))
err = phy_config_interrupt(phydev,
@@ -1030,7 +1035,7 @@ void phy_state_machine(struct work_struct *work)
if (phydev->link) {
phydev->link = 0;
netif_carrier_off(phydev->attached_dev);
-   phydev->adjust_link(phydev->attached_dev);
+   phy_adjust_link(phydev);
do_suspend = true;
}
break;
@@ -1054,7 +1059,7 @@ void phy_state_machine(struct work_struct *work)
} else  {
phydev->state = PHY_NOLINK;
}
-   phydev->adjust_link(phydev->attached_dev);
+   phy_adjust_link(phydev);
} else {
phydev->state = PHY_AN;
phydev->link_timeout = PHY_AN_TIMEOUT;
@@ -1070,7 +1075,7 @@ void phy_state_machine(struct work_struct *work)
} else  {
phydev->state = PHY_NOLINK;
}
-   phydev->adjust_link(phydev->attached_dev);
+   phy_adjust_link(phydev);
}
break;
}
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2 v2] pci-hyperv: properly handle pci bus remove

2016-09-27 Thread Bjorn Helgaas
On Wed, Sep 14, 2016 at 07:10:01PM -0700, Long Li wrote:
> From: Long Li 
> 
> hv_pci_devices_present is called in hv_pci_remove when we remove a PCI device 
> from host (e.g. by disabling SRIOV on a device). In hv_pci_remove, the bus is 
> already removed before the call, so we don't need to rescan the bus in the 
> workqueue scheduled from hv_pci_devices_present. By introducing status 
> hv_pcibus_removed, we can avoid this situation.
> 
> The patch fixes the following kernel panic.
> 
> [  383.853124] Workqueue: events pci_devices_present_work [pci_hyperv]
> [  383.853124] task: 88007f5f8000 ti: 88007f60 task.ti:
> 88007f60
> [  383.853124] RIP: 0010:[]  []
> pci_is_pcie+0x6/0x20
> [  383.853124] RSP: 0018:88007f603d38  EFLAGS: 00010206
> [  383.853124] RAX: 88007f5f8000 RBX: 642f3d4854415056 RCX:
> 88007f603fd8
> [  383.853124] RDX:  RSI:  RDI:
> 642f3d4854415056
> [  383.853124] RBP: 88007f603d68 R08: 0246 R09:
> a045eb9e
> [  383.853124] R10: 88007b419a80 R11: ea0001c0ef40 R12:
> 880003ee1c00
> [  383.853124] R13: 63702f30303a3137 R14:  R15:
> 0246
> [  383.853124] FS:  () GS:88007b40()
> knlGS:
> [  383.853124] CS:  0010 DS:  ES:  CR0: 80050033
> [  383.853124] CR2: 7f68b3f52350 CR3: 03546000 CR4:
> 000406f0
> [  383.853124] DR0:  DR1:  DR2:
> 
> [  383.853124] DR3:  DR6: 0ff0 DR7:
> 0400
> [  383.853124] Stack:
> [  383.853124]  88007f603d68 8134db17 0008
> 880003ee1c00
> [  383.853124]  63702f30303a3137 880003d8edb8 88007f603da0
> 8134ee2d
> [  383.853124]  880003d8ed00 88007f603dd8 880075fec320
> 880003d8edb8
> [  383.853124] Call Trace:
> [  383.853124]  [] ? pci_scan_slot+0x27/0x140
> [  383.853124]  [] pci_scan_child_bus+0x3d/0x150
> [  383.853124]  []
> pci_devices_present_work+0x3ea/0x400 [pci_hyperv]
> [  383.853124]  [] process_one_work+0x17b/0x470
> [  383.853124]  [] worker_thread+0x126/0x410
> [  383.853124]  [] ? rescuer_thread+0x460/0x460
> [  383.853124]  [] kthread+0xcf/0xe0
> [  383.853124]  [] ?
> kthread_create_on_node+0x140/0x140
> [  383.853124]  [] ret_from_fork+0x58/0x90
> [  383.853124]  [] ?
> kthread_create_on_node+0x140/0x140
> [  383.853124] Code: 89 e5 5d 25 f0 00 00 00 c1 f8 04 c3 66 0f 1f 84 00
> 00 00 00 00 66 66 66 66 90 55 0f b6 47 4a 48 89 e5 5d c3 90 66 66 66 66
> 90 55 <80> 7f 4a 00 48 89 e5 5d 0f 95 c0 c3 0f 1f 40 00 66 2e 0f 1f 84
> [  383.853124] RIP  [] pci_is_pcie+0x6/0x20
> [  383.853124]  RSP 

Personally, I would remove the timestamps and addresses from this trace
because I don't think they contribute to diagnosing the problem.

> Signed-off-by: Long Li 

I'm ready to apply these but am waiting for an ack from the maintainers
listed in MAINTAINERS (feel free to update that if it's out of date).

> ---
>  drivers/pci/host/pci-hyperv.c | 20 +---
>  1 file changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
> index a8deeca..4a37598 100644
> --- a/drivers/pci/host/pci-hyperv.c
> +++ b/drivers/pci/host/pci-hyperv.c
> @@ -348,6 +348,7 @@ enum hv_pcibus_state {
>   hv_pcibus_init = 0,
>   hv_pcibus_probed,
>   hv_pcibus_installed,
> + hv_pcibus_removed,
>   hv_pcibus_maximum
>  };
>  
> @@ -1481,13 +1482,24 @@ static void pci_devices_present_work(struct 
> work_struct *work)
>   put_pcichild(hpdev, hv_pcidev_ref_initial);
>   }
>  
> - /* Tell the core to rescan bus because there may have been changes. */
> - if (hbus->state == hv_pcibus_installed) {
> + switch (hbus->state) {
> + case hv_pcibus_installed:
> + /*
> +  * Tell the core to rescan bus
> +  * because there may have been changes.
> +  */
>   pci_lock_rescan_remove();
>   pci_scan_child_bus(hbus->pci_bus);
>   pci_unlock_rescan_remove();
> - } else {
> + break;
> +
> + case hv_pcibus_init:
> + case hv_pcibus_probed:
>   survey_child_resources(hbus);
> + break;
> +
> + default:
> + break;
>   }
>  
>   up(>enum_sem);
> @@ -2163,6 +2175,7 @@ static int hv_pci_probe(struct hv_device *hdev,
>   hbus = kzalloc(sizeof(*hbus), GFP_KERNEL);
>   if (!hbus)
>   return -ENOMEM;
> + hbus->state = hv_pcibus_init;
>  
>   /*
>* The PCI bus "domain" is what is called "segment" in ACPI and
> @@ -2305,6 +2318,7 @@ static int hv_pci_remove(struct hv_device *hdev)
>   pci_stop_root_bus(hbus->pci_bus);
>   pci_remove_root_bus(hbus->pci_bus);
>   

[PATCH 0/3] staging: unisys: visorbus: Add missing s-Par livedump data

2016-09-27 Thread David Kershner
During additional testing it was noticed that additional data was missing
from the s-Par livedump. This series corrects the problem.

Tim Sell (3):
  staging: unisys: visorbus: fix sloppy unsigned/signed int conversions
  staging: unisys: visorbus: fix vbus info generated for s-Par livedumps
  staging: unisys: visorbus: fix typos with client_bus_info /sys entry

 drivers/staging/unisys/visorbus/visorbus_main.c | 18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/3] staging: unisys: visorbus: fix typos with client_bus_info /sys entry

2016-09-27 Thread David Kershner
From: Tim Sell 

Example corrected output:

$ pwd
/sys/bus/visorbus/devices/visorbus1
$ cat client_bus_info
Client device / client driver info for s-Par Console partition
 (vbus #1):
   chipset visorchipsetkernel ver. 4.8.0-rc6-ARCH+
   clientbus   visorbuskernel ver. 4.8.0-rc6-ARCH+
[2]keyboardvisorinput  kernel ver. 4.8.0-rc6-ARCH+
[3]mouse   visorinput  kernel ver. 4.8.0-rc6-ARCH+

$ cat ../visorbus2/client_bus_info
Client device / client driver info for s-Par IOVM partition
 (vbus #2):
   chipset visorchipsetkernel ver. 4.8.0-rc6-ARCH+
   clientbus   visorbuskernel ver. 4.8.0-rc6-ARCH+
[0]ultravnic   visornickernel ver. 4.8.0-rc6-ARCH+
[1]ultravnic   visornickernel ver. 4.8.0-rc6-ARCH+
[2]sparvhbavisorhbakernel ver. 4.8.0-rc6-ARCH+

Signed-off-by: Tim Sell 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 2b4abda..fec0a54 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -361,8 +361,8 @@ static ssize_t client_bus_info_show(struct device *dev,
if (vdev->name)
partition_name = vdev->name;
shift = snprintf(pos, remain,
-"Client device / client driver info for %s 
eartition (vbus #%u):\n",
-partition_name, vdev->chipset_dev_no);
+"Client device / client driver info for %s 
partition (vbus #%u):\n",
+partition_name, vdev->chipset_bus_no);
pos += shift;
remain -= shift;
shift = visorchannel_read(channel,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] staging: unisys: visorbus: fix vbus info generated for s-Par livedumps

2016-09-27 Thread David Kershner
From: Tim Sell 

Previously, the lines describing devices controlled by the visorinput,
visornic, and visorhba drivers (keyboard, mouse, ultravnic, sparvhba) would
be missing from the vbus channel header.  This is important info that is
collected as part of s-Par livedumps, and can be examined via
/sys/bus/visorbus/devices/visorbus/client_bus_info, e.g.:

$ pwd
/sys/bus/visorbus/devices
$ cat visorbus1/client_bus_info
Client device / client driver info for s-Par Console eartition
 (vbus #4294967295):
   chipset visorchipsetkernel ver. 4.8.0-rc6-ARCH+
   clientbus   visorbuskernel ver. 4.8.0-rc6-ARCH+
 -> [2]keyboardvisorinput  kernel ver. 4.8.0-rc6-ARCH+
 -> [3]mouse   visorinput  kernel ver. 4.8.0-rc6-ARCH+

$ cat visorbus2/client_bus_info
Client device / client driver info for s-Par IOVM eartition
 (vbus #4294967295):
   chipset visorchipsetkernel ver. 4.8.0-rc6-ARCH+
   clientbus   visorbuskernel ver. 4.8.0-rc6-ARCH+
 -> [0]ultravnic   visornickernel ver. 4.8.0-rc6-ARCH+
 -> [1]ultravnic   visornickernel ver. 4.8.0-rc6-ARCH+
 -> [2]sparvhbavisorhbakernel ver. 4.8.0-rc6-ARCH+

Signed-off-by: Tim Sell 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index ccdb5a1..2b4abda 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -796,14 +796,12 @@ fix_vbus_dev_info(struct visor_device *visordev)
if (!visordev->device.driver)
return;
 
-   hdr_info = (struct spar_vbus_headerinfo *)visordev->vbus_hdr_info;
-   if (!hdr_info)
-   return;
-
bdev = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL);
if (!bdev)
return;
-
+   hdr_info = (struct spar_vbus_headerinfo *)bdev->vbus_hdr_info;
+   if (!hdr_info)
+   return;
visordrv = to_visor_driver(visordev->device.driver);
 
/*
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] staging: unisys: visorbus: fix sloppy unsigned/signed int conversions

2016-09-27 Thread David Kershner
From: Tim Sell 

Several implicit unsigned --> signed int conversions were corrected.
No runtime effects were observed here, nevertheless implicit conversions
between integral types can lead to unexpected behavior.

Signed-off-by: Tim Sell 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1f3d2e0..ccdb5a1 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -762,7 +762,7 @@ write_vbus_bus_info(struct visorchannel *chan,
 static void
 write_vbus_dev_info(struct visorchannel *chan,
struct spar_vbus_headerinfo *hdr_info,
-   struct ultra_vbus_deviceinfo *info, int devix)
+   struct ultra_vbus_deviceinfo *info, unsigned int devix)
 {
int off =
(sizeof(struct channel_header) + hdr_info->dev_info_offset) +
@@ -787,8 +787,8 @@ fix_vbus_dev_info(struct visor_device *visordev)
int i;
struct visor_device *bdev;
struct visor_driver *visordrv;
-   int bus_no = visordev->chipset_bus_no;
-   int dev_no = visordev->chipset_dev_no;
+   u32 bus_no = visordev->chipset_bus_no;
+   u32 dev_no = visordev->chipset_dev_no;
struct ultra_vbus_deviceinfo dev_info;
const char *chan_type_name = NULL;
struct spar_vbus_headerinfo *hdr_info;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: vt6656: Remove unused variable 'rx_sts'

2016-09-27 Thread Martin Alonso
As suggested by Joe Perches, rx_sts is not
used anywhere and could be removed.

Signed-off-by: Martin Alonso 
---
 drivers/staging/vt6656/dpc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index c352c70..655f000 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -46,7 +46,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
__le64 *tsf_time;
u32 frame_size;
int ii, r;
-   u8 *rx_sts, *rx_rate, *sq, *sq_3;
+   u8 *rx_rate, *sq, *sq_3;
u32 wbk_status;
u8 *skb_data;
u16 *pay_load_len;
@@ -75,7 +75,6 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
 
skb_data = (u8 *)skb->data;
 
-   rx_sts = skb_data + 4;
rx_rate = skb_data + 5;
 
/* real Frame Size = USBframe_size -4WbkStatus - 4RxStatus */
-- 
2.8.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: vt6656: Make 'rx_rate' u8 instead of u8 *

2016-09-27 Thread Martin Alonso
Change the type and uses of rx_rate.

Signed-off-by: Martin Alonso 
---
 drivers/staging/vt6656/dpc.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index 655f000..782b7d7 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -46,7 +46,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
__le64 *tsf_time;
u32 frame_size;
int ii, r;
-   u8 *rx_rate, *sq, *sq_3;
+   u8 rx_rate;
+   u8 *sq, *sq_3;
u32 wbk_status;
u8 *skb_data;
u16 *pay_load_len;
@@ -75,7 +76,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
 
skb_data = (u8 *)skb->data;
 
-   rx_rate = skb_data + 5;
+   rx_rate = *(skb_data + 5);
 
/* real Frame Size = USBframe_size -4WbkStatus - 4RxStatus */
/* -8TSF - 4RSR - 4SQ3 - ?Padding */
@@ -96,7 +97,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
sband = hw->wiphy->bands[hw->conf.chandef.chan->band];
 
for (r = RATE_1M; r < MAX_RATE; r++) {
-   if (*rx_rate == rate[r])
+   if (rx_rate == rate[r])
break;
}
 
@@ -110,7 +111,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
}
 
if (ii == sband->n_bitrates) {
-   dev_dbg(>usb->dev, "Wrong RxRate %x\n", *rx_rate);
+   dev_dbg(>usb->dev, "Wrong RxRate %x\n", rx_rate);
return false;
}
 
-- 
2.8.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: android: fix permissions style

2016-09-27 Thread Joe Perches
On Mon, 2016-09-26 at 22:02 +0100, Ramiro Oliveira wrote:
> Change permissions from symbolic to octal.
[]
> diff --git a/drivers/staging/android/lowmemorykiller.c 
> b/drivers/staging/android/lowmemorykiller.c
[]
> @@ -204,10 +204,10 @@ device_initcall(lowmem_init);
>   * not really modular, but the easiest way to keep compat with existing
>   * bootargs behaviour is to continue using module_param here.
>   */
> -module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
> +module_param_named(cost, lowmem_shrinker.seeks, int, 0644);
>  module_param_array_named(adj, lowmem_adj, short, _adj_size,
> >  S_IRUGO | S_IWUSR);
>  module_param_array_named(minfree, lowmem_minfree, uint, _minfree_size,
>    S_IRUGO | S_IWUSR);

Seems odd to fix the other two but not this one.

> -module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
> +module_param_named(debug_level, lowmem_debug_level, uint, 0644);
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: declare private functions static

2016-09-27 Thread Sergio Paracuellos
Private functions in ks7010_sdio.c can be declared static.

Fixes sparse warnings 'was not declared. Should it be static?'.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/ks7010/ks7010_sdio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index b27e9b0..0884960 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -87,7 +87,7 @@ static int ks7010_sdio_write(struct ks_wlan_private *priv, 
unsigned int address,
return rc;
 }
 
-void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
+static void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
 {
unsigned char rw_data;
int retval;
@@ -117,7 +117,7 @@ void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private 
*priv)
priv->sleep_mode = atomic_read(>sleepstatus.status);
 }
 
-void ks_wlan_hw_sleep_wakeup_request(struct ks_wlan_private *priv)
+static void ks_wlan_hw_sleep_wakeup_request(struct ks_wlan_private *priv)
 {
unsigned char rw_data;
int retval;
@@ -169,7 +169,7 @@ void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
}
 }
 
-int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
+static int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 {
unsigned char rw_data;
int retval;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] staging: wlan-ng: avoid new typedef: netdevice_t

2016-09-27 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211netdev.h:
WARNING: do not add new typedefs

It applies for typedef netdevice_t

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211conv.c   |  2 +-
 drivers/staging/wlan-ng/p80211netdev.c | 38 +-
 drivers/staging/wlan-ng/p80211netdev.h |  9 +++-
 drivers/staging/wlan-ng/prism2sta.c|  6 --
 4 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.c 
b/drivers/staging/wlan-ng/p80211conv.c
index efc52e9..0247cbc 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -277,7 +277,7 @@ static void orinoco_spy_gather(struct wlandevice *wlandev, 
char *mac,
 int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
struct sk_buff *skb)
 {
-   netdevice_t *netdev = wlandev->netdev;
+   struct net_device *netdev = wlandev->netdev;
u16 fc;
unsigned int payload_length;
unsigned int payload_offset;
diff --git a/drivers/staging/wlan-ng/p80211netdev.c 
b/drivers/staging/wlan-ng/p80211netdev.c
index 0a31467..825a63a 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -91,16 +91,16 @@
 #include "cfg80211.c"
 
 /* netdevice method functions */
-static int p80211knetdev_init(netdevice_t *netdev);
-static int p80211knetdev_open(netdevice_t *netdev);
-static int p80211knetdev_stop(netdevice_t *netdev);
+static int p80211knetdev_init(struct net_device *netdev);
+static int p80211knetdev_open(struct net_device *netdev);
+static int p80211knetdev_stop(struct net_device *netdev);
 static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
-netdevice_t *netdev);
-static void p80211knetdev_set_multicast_list(netdevice_t *dev);
-static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr,
+struct net_device *netdev);
+static void p80211knetdev_set_multicast_list(struct net_device *dev);
+static int p80211knetdev_do_ioctl(struct net_device *dev, struct ifreq *ifr,
  int cmd);
-static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr);
-static void p80211knetdev_tx_timeout(netdevice_t *netdev);
+static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr);
+static void p80211knetdev_tx_timeout(struct net_device *netdev);
 static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc);
 
 int wlan_watchdog = 5000;
@@ -123,7 +123,7 @@ MODULE_PARM_DESC(wlan_wext_write, "enable write wireless 
extensions");
 * Returns:
 *  nothing
 */
-static int p80211knetdev_init(netdevice_t *netdev)
+static int p80211knetdev_init(struct net_device *netdev)
 {
/* Called in response to register_netdev */
/* This is usually the probe function, but the probe has */
@@ -146,7 +146,7 @@ static int p80211knetdev_init(netdevice_t *netdev)
 * Returns:
 *  zero on success, non-zero otherwise
 */
-static int p80211knetdev_open(netdevice_t *netdev)
+static int p80211knetdev_open(struct net_device *netdev)
 {
int result = 0; /* success */
struct wlandevice *wlandev = netdev->ml_priv;
@@ -181,7 +181,7 @@ static int p80211knetdev_open(netdevice_t *netdev)
 * Returns:
 *  zero on success, non-zero otherwise
 */
-static int p80211knetdev_stop(netdevice_t *netdev)
+static int p80211knetdev_stop(struct net_device *netdev)
 {
int result = 0;
struct wlandevice *wlandev = netdev->ml_priv;
@@ -267,7 +267,7 @@ static void p80211netdev_rx_bh(unsigned long arg)
 {
struct wlandevice *wlandev = (struct wlandevice *)arg;
struct sk_buff *skb = NULL;
-   netdevice_t *dev = wlandev->netdev;
+   struct net_device *dev = wlandev->netdev;
 
/* Let's empty our our queue */
while ((skb = skb_dequeue(>nsd_rxq))) {
@@ -318,7 +318,7 @@ static void p80211netdev_rx_bh(unsigned long arg)
 *  zero on success, non-zero on failure.
 */
 static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
-netdevice_t *netdev)
+struct net_device *netdev)
 {
int result = 0;
int txresult = -1;
@@ -446,7 +446,7 @@ failed:
 * Returns:
 *  nothing
 */
-static void p80211knetdev_set_multicast_list(netdevice_t *dev)
+static void p80211knetdev_set_multicast_list(struct net_device *dev)
 {
struct wlandevice *wlandev = dev->ml_priv;
 
@@ -531,7 +531,7 @@ static int 

[PATCH 0/3] staging: wlang-ng: fix some style warnings in p80211netdev.h

2016-09-27 Thread Sergio Paracuellos
This patchset fix all remaining warnings reported by checkpatch.pl script for 
p80211netdev.h header file:
- WARNING: do not add new typedefs
- WARNING: line over 80 characters

Sergio Paracuellos (3):
  staging: wlan-ng: avoid new typedef: netdevice_t
  staging: wlan-ng: avoid new typedef: p80211_frmrx_t
  staging: wlan-ng: fix line style warnings in p80211netdev.h

 drivers/staging/wlan-ng/p80211conv.c   |  2 +-
 drivers/staging/wlan-ng/p80211netdev.c | 38 +-
 drivers/staging/wlan-ng/p80211netdev.h | 19 +++--
 drivers/staging/wlan-ng/prism2sta.c|  6 --
 4 files changed, 32 insertions(+), 33 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/3] staging: wlan-ng: fix line style warnings in p80211netdev.h

2016-09-27 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211netdev.h:
WARNING: line over 80 characters

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211netdev.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211netdev.h 
b/drivers/staging/wlan-ng/p80211netdev.h
index e1a5689..1e6a774 100644
--- a/drivers/staging/wlan-ng/p80211netdev.h
+++ b/drivers/staging/wlan-ng/p80211netdev.h
@@ -225,8 +225,8 @@ struct wlandevice {
 int wep_change_key(struct wlandevice *wlandev, int keynum, u8 *key, int 
keylen);
 int wep_decrypt(struct wlandevice *wlandev, u8 *buf, u32 len, int key_override,
u8 *iv, u8 *icv);
-int wep_encrypt(struct wlandevice *wlandev, u8 *buf, u8 *dst, u32 len, int 
keynum,
-   u8 *iv, u8 *icv);
+int wep_encrypt(struct wlandevice *wlandev, u8 *buf, u8 *dst, u32 len,
+   int keynum, u8 *iv, u8 *icv);
 
 int wlan_setup(struct wlandevice *wlandev, struct device *physdev);
 void wlan_unsetup(struct wlandevice *wlandev);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] staging: wlan-ng: avoid new typedef: p80211_frmrx_t

2016-09-27 Thread Sergio Paracuellos
This patch fixes the following checkpatch.pl warning in p80211netdev.h:
WARNING: do not add new typedefs

It applies for typedef p80211_frmrx_t

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211netdev.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211netdev.h 
b/drivers/staging/wlan-ng/p80211netdev.h
index 5055837..e1a5689 100644
--- a/drivers/staging/wlan-ng/p80211netdev.h
+++ b/drivers/staging/wlan-ng/p80211netdev.h
@@ -98,7 +98,7 @@
 #define P80211_NSDCAP_NOSCAN0x200 /* nsd can scan */
 
 /* Received frame statistics */
-typedef struct p80211_frmrx_t {
+struct p80211_frmrx {
u32 mgmt;
u32 assocreq;
u32 assocresp;
@@ -132,7 +132,7 @@ typedef struct p80211_frmrx_t {
u32 data_unknown;
u32 decrypt;
u32 decrypt_err;
-} p80211_frmrx_t;
+};
 
 /* called by /proc/net/wireless */
 struct iw_statistics *p80211wext_get_wireless_stats(struct net_device *dev);
@@ -211,7 +211,7 @@ struct wlandevice {
struct sk_buff_head nsd_rxq;
 
/* 802.11 device statistics */
-   struct p80211_frmrx_t rx;
+   struct p80211_frmrx rx;
 
struct iw_statistics wstats;
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vt6656: Add spaces around '+' operator

2016-09-27 Thread Martin Alonso
On Mon, Sep 26, 2016 at 11:02:33AM -0700, Joe Perches wrote:
> On Mon, 2016-09-26 at 14:48 -0300, Martin Alonso wrote:
> > Fix coding style issue "spaces preferred around '+'
> > detected by checkpatch.pl in dpc.c file.
> []
> > diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
> []
> > @@ -75,8 +75,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
> > *ptr_rcb,
> >  
> > >   skb_data = (u8 *)skb->data;
> >  
> > -   rx_sts = skb_data+4;
> > -   rx_rate = skb_data+5;
> > +   rx_sts = skb_data + 4;
> > +   rx_rate = skb_data + 5;
> >  
> >     /* real Frame Size = USBframe_size -4WbkStatus - 4RxStatus */
> >     /* -8TSF - 4RSR - 4SQ3 - ?Padding */
> 
> You might as well make rx_rate u8 instead of u8 *
> and change the uses of rx_rate.  rx_sts isn't used
> anywhere at all and could be removed.
> 
I'll send two patches to fix this issues.
Regards.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [1/2] rtlwifi: Add HAL_DEF_WOWLAN case to *_get_hw() routines

2016-09-27 Thread Kalle Valo
Larry Finger  wrote:
> Only rtl8821ae implements WOWLAN; however, the other drivers may receive
> a call requesting information about this mode. The other drivers need to
> ignore the request rather than logging that the default branch of the
> switch statement has been reached.
> 
> Reported by: Jean Delvare 
> Signed-off-by: Larry Finger 

2 patches applied to wireless-drivers-next.git, thanks.

1cc49a5b5466 rtlwifi: Add HAL_DEF_WOWLAN case to *_get_hw() routines
8334ffdc8290 rtlwifi: Add explicit values to hw_variables enum

-- 
https://patchwork.kernel.org/patch/9349217/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/7] selftest: sync: basic tests for sw_sync framework

2016-09-27 Thread Emilio López

Hi,

El 27/09/16 a las 01:23, Michael Ellerman escribió:

Emilio López  writes:

El 22/09/16 a las 06:43, Michael Ellerman escribió:

Emilio López  writes:

Please don't include the *kernel* headers, they're really not meant to
be used in userspace programs :)


+CFLAGS += -I../../../../usr/include/


That is the correct place to get them from. They'll have been put there
by 'make headers_install'.


My inspiration here has been tools/testing/selftests/memfd/Makefile,
which does it this way. If I only include the ones on usr then it
doesn't build, as there's no sync_file.h available, even after running
make headers_install. How am I supposed to use the ioctls from there?


It looks like it's missing from include/uapi/linux/Kbuild, you need to
add it to the list of exported headers:


I tried that over the weekend and it worked, but I wondered if it was 
the way to go. Thanks for the confirmation :) I've sent a patch for 
that[0] now.


With that resolved, CFLAGS can just be

CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra
CFLAGS += -I../../../../usr/include/

I'll wait a bit more to see if anyone else has any comments, otherwise 
I'll send a v2 in a couple of days.


Thanks!
Emilio

[0] https://lkml.org/lkml/2016/9/27/289
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: android: fix permissions style

2016-09-27 Thread Ramiro Oliveira
Change permissions from symbolic to octal.

Signed-off-by: Ramiro Oliveira 
---
 drivers/staging/android/lowmemorykiller.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/lowmemorykiller.c 
b/drivers/staging/android/lowmemorykiller.c
index 80d7adf..03b5765 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -204,10 +204,10 @@ device_initcall(lowmem_init);
  * not really modular, but the easiest way to keep compat with existing
  * bootargs behaviour is to continue using module_param here.
  */
-module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
+module_param_named(cost, lowmem_shrinker.seeks, int, 0644);
 module_param_array_named(adj, lowmem_adj, short, _adj_size,
 S_IRUGO | S_IWUSR);
 module_param_array_named(minfree, lowmem_minfree, uint, _minfree_size,
 S_IRUGO | S_IWUSR);
-module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
+module_param_named(debug_level, lowmem_debug_level, uint, 0644);

--
2.9.3


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: dgnc: Align the * on a block comment

2016-09-27 Thread Ramiro Oliveira
On 9/27/2016 12:13 PM, Greg KH wrote:
> On Mon, Sep 26, 2016 at 06:39:15PM +0100, Ramiro Oliveira wrote:
>> This patch corrects a misalligned * in a block comment warning found by 
>> checkpatch.pl
>>
>> Signed-off-by: Ramiro Oliveira 
>> ---
>>  drivers/staging/dgnc/dgnc_cls.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
> Does not apply to my tree, are you sure you are working against
> linux-next?
>
> thanks,
>
> greg k-h

Sorry, I was just looking at the day of the linux-next commit and missed the 
month.

Nevermind this patch.

BRs,
Ramiro
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vt6656: Add spaces around '+' operator

2016-09-27 Thread Martin Alonso
On Tue, Sep 27, 2016 at 01:10:04PM +0200, Greg KH wrote:
> On Mon, Sep 26, 2016 at 02:48:24PM -0300, Martin Alonso wrote:
> > Fix coding style issue "spaces preferred around '+'
> > detected by checkpatch.pl in dpc.c file.
> > 
> > Signed-off-by: Martin Alonso 
> > ---
> >  drivers/staging/vt6656/dpc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
> > index 6019aac..900cd5c 100644
> > --- a/drivers/staging/vt6656/dpc.c
> > +++ b/drivers/staging/vt6656/dpc.c
> > @@ -75,8 +75,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
> > *ptr_rcb,
> >  
> > skb_data = (u8 *)skb->data;
> >  
> > -   rx_sts = skb_data+4;
> > -   rx_rate = skb_data+5;
> > +   rx_sts = skb_data + 4;
> > +   rx_rate = skb_data + 5;
> >  
> > /* real Frame Size = USBframe_size -4WbkStatus - 4RxStatus */
> > /* -8TSF - 4RSR - 4SQ3 - ?Padding */
> > -- 
> > 2.8.0
> > 
> 
> Doesn't apply to my tree, did someone do this before you?  You are
> working against linux-next, right?
> 
> thanks,
> 
> greg k-h
I wasn't working against linux-next as i though.
Sorry for the annoyance.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: dgnc: Align the * on a block comment

2016-09-27 Thread Greg KH
On Mon, Sep 26, 2016 at 06:39:15PM +0100, Ramiro Oliveira wrote:
> This patch corrects a misalligned * in a block comment warning found by 
> checkpatch.pl
> 
> Signed-off-by: Ramiro Oliveira 
> ---
>  drivers/staging/dgnc/dgnc_cls.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Does not apply to my tree, are you sure you are working against
linux-next?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8192e: fixed statements should start on a tabstop

2016-09-27 Thread Greg KH
On Mon, Sep 26, 2016 at 07:37:27PM -0500, Darryl T. Agostinelli wrote:
> checkpatch.pl repairs:
> corrected: statements should start on a tabstop
> corrected: block comments use * on subsequent lines
> corrected: use a blank line after function/struct/union/enum declarations

That's multiple different things, please break this patch up into
multiple different patches.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vt6656: Add spaces around '+' operator

2016-09-27 Thread Greg KH
On Mon, Sep 26, 2016 at 02:48:24PM -0300, Martin Alonso wrote:
> Fix coding style issue "spaces preferred around '+'
> detected by checkpatch.pl in dpc.c file.
> 
> Signed-off-by: Martin Alonso 
> ---
>  drivers/staging/vt6656/dpc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
> index 6019aac..900cd5c 100644
> --- a/drivers/staging/vt6656/dpc.c
> +++ b/drivers/staging/vt6656/dpc.c
> @@ -75,8 +75,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
> *ptr_rcb,
>  
>   skb_data = (u8 *)skb->data;
>  
> - rx_sts = skb_data+4;
> - rx_rate = skb_data+5;
> + rx_sts = skb_data + 4;
> + rx_rate = skb_data + 5;
>  
>   /* real Frame Size = USBframe_size -4WbkStatus - 4RxStatus */
>   /* -8TSF - 4RSR - 4SQ3 - ?Padding */
> -- 
> 2.8.0
> 

Doesn't apply to my tree, did someone do this before you?  You are
working against linux-next, right?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 01/37] staging: lustre: llite: add missing LMV_MAGIC_V1 case

2016-09-27 Thread Greg Kroah-Hartman
On Mon, Sep 26, 2016 at 10:50:50AM -0400, James Simmons wrote:
> From: wang di 
> 
> The port to upstream dropped handling the LMV_MAGIC_V1
> case for ll_dir_getstripe. This adds it back.
> 
> Signed-off-by: wang di 
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
> Reviewed-on: http://review.whamcloud.com/7228
> Reviewed-by: Andreas Dilger 
> Reviewed-by: John L. Hammond 
> Reviewed-by: Alex Zhuravlev 
> Reviewed-by: Oleg Drokin 
> Signed-off-by: James Simmons 
> ---
>  drivers/staging/lustre/lustre/llite/dir.c   | 4 
>  drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 1 +
>  2 files changed, 5 insertions(+)

I got this single patch, what about the other 36 patches you are saying
this is a series of?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/9] staging: unisys: Remove version information

2016-09-27 Thread Dan Carpenter
You guys are sending good patches these days.  You seem to have the
process down.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] greybus: manifest: style fix missing space before '('

2016-09-27 Thread Dan Carpenter
On Tue, Sep 27, 2016 at 11:33:49AM +0200, Quentin Lambert wrote:
> 
> 
> On 27/09/2016 11:31, Viresh Kumar wrote:
> >On Tue, Sep 27, 2016 at 2:50 PM, Quentin Lambert
> > wrote:
> >>Checkpatch printed a style ERROR concerning a missing space befire '('.
> >>This patch fix this issue.
> >>
> >>Signed-off-by: Quentin Lambert 
> >>---
> >>  drivers/staging/greybus/manifest.c |2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >>--- a/drivers/staging/greybus/manifest.c
> >>+++ b/drivers/staging/greybus/manifest.c
> >>@@ -11,7 +11,7 @@
> >>
> >>  static const char *get_descriptor_type_string(u8 type)
> >>  {
> >>-   switch(type) {
> >>+   switch (type) {
> >> case GREYBUS_TYPE_INVALID:
> >> return "invalid";
> >> case GREYBUS_TYPE_STRING:
> >Acked-by: Viresh Kumar 
> Wow I just noticed the typo: "befire" do you want me to resend ?

No one cares about tiny typos in the patch description, but resend if
you want.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] greybus: manifest: style fix missing space before '('

2016-09-27 Thread Viresh Kumar
On 27 September 2016 at 15:03, Quentin Lambert
 wrote:
>
>
> On 27/09/2016 11:31, Viresh Kumar wrote:
>>
>> On Tue, Sep 27, 2016 at 2:50 PM, Quentin Lambert
>>  wrote:
>>>
>>> Checkpatch printed a style ERROR concerning a missing space befire '('.
>>> This patch fix this issue.
>>>
>>> Signed-off-by: Quentin Lambert 
>>> ---
>>>   drivers/staging/greybus/manifest.c |2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> --- a/drivers/staging/greybus/manifest.c
>>> +++ b/drivers/staging/greybus/manifest.c
>>> @@ -11,7 +11,7 @@
>>>
>>>   static const char *get_descriptor_type_string(u8 type)
>>>   {
>>> -   switch(type) {
>>> +   switch (type) {
>>>  case GREYBUS_TYPE_INVALID:
>>>  return "invalid";
>>>  case GREYBUS_TYPE_STRING:
>>
>> Acked-by: Viresh Kumar 
>
> Wow I just noticed the typo: "befire" do you want me to resend ?

Oops, sorry for missing that.

Yes, please resend the patch as V2 and feel free to add my Ack to it.

--
viresh
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] greybus: manifest: style fix missing space before '('

2016-09-27 Thread Quentin Lambert
Checkpatch printed a style ERROR concerning a missing space before '('.
This patch fixes this issue.

Signed-off-by: Quentin Lambert 
Acked-by: Viresh Kumar 
---
 v2: fixes typos in commit message 

 drivers/staging/greybus/manifest.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/greybus/manifest.c
+++ b/drivers/staging/greybus/manifest.c
@@ -11,7 +11,7 @@
 
 static const char *get_descriptor_type_string(u8 type)
 {
-   switch(type) {
+   switch (type) {
case GREYBUS_TYPE_INVALID:
return "invalid";
case GREYBUS_TYPE_STRING:
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] greybus: manifest: style fix missing space before '('

2016-09-27 Thread Quentin Lambert



On 27/09/2016 11:31, Viresh Kumar wrote:

On Tue, Sep 27, 2016 at 2:50 PM, Quentin Lambert
 wrote:

Checkpatch printed a style ERROR concerning a missing space befire '('.
This patch fix this issue.

Signed-off-by: Quentin Lambert 
---
  drivers/staging/greybus/manifest.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/greybus/manifest.c
+++ b/drivers/staging/greybus/manifest.c
@@ -11,7 +11,7 @@

  static const char *get_descriptor_type_string(u8 type)
  {
-   switch(type) {
+   switch (type) {
 case GREYBUS_TYPE_INVALID:
 return "invalid";
 case GREYBUS_TYPE_STRING:

Acked-by: Viresh Kumar 

Wow I just noticed the typo: "befire" do you want me to resend ?

Quentin

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] greybus: audio: fix uninitialized variable errors found by cppcheck

2016-09-27 Thread Viresh Kumar
On Sat, Sep 24, 2016 at 11:06 PM, Vaibhav Agarwal  wrote:
> Currently, if info is null, the dev_err message is dereferencing an
> uninitialized module pointer.  Instead, it should use codec->dev pointer
> in dev_err call and better align with other err msg in this function.
>
> Also, ret variable might be used uninitialized in a specific case.
> Avoid using it this way.
>
> Found using static analysis with cppcheck:
> Checking drivers/staging/greybus/audio_topology.c...
> [drivers/staging/greybus/audio_topology.c:175]: (error) Uninitialized
> variable: module
> [drivers/staging/greybus/audio_topology.c:495]: (error) Uninitialized
> variable: ret
>
> Reported-by: Colin Ian King 
> Signed-off-by: Vaibhav Agarwal 
> ---
>  drivers/staging/greybus/audio_topology.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/greybus/audio_topology.c 
> b/drivers/staging/greybus/audio_topology.c
> index f9f33817a092..b6251691a33d 100644
> --- a/drivers/staging/greybus/audio_topology.c
> +++ b/drivers/staging/greybus/audio_topology.c
> @@ -172,7 +172,7 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol 
> *kcontrol,
> info = (struct gb_audio_ctl_elem_info *)data->info;
>
> if (!info) {
> -   dev_err(module->dev, "NULL info for %s\n", uinfo->id.name);
> +   dev_err(codec->dev, "NULL info for %s\n", uinfo->id.name);
> return -EINVAL;
> }
>
> @@ -489,10 +489,11 @@ static int gbcodec_mixer_dapm_ctl_put(struct 
> snd_kcontrol *kcontrol,
> dev_err_ratelimited(codec->dev,
> "%d:Error in %s for %s\n", ret,
> __func__, kcontrol->id.name);
> +   return ret;
> }
> }
>
> -   return ret;
> +   return 0;
>  }
>
>  #define SOC_DAPM_MIXER_GB(xname, kcount, data) \

Acked-by: Viresh Kumar 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] greybus: manifest: style fix missing space before '('

2016-09-27 Thread Viresh Kumar
On Tue, Sep 27, 2016 at 2:50 PM, Quentin Lambert
 wrote:
> Checkpatch printed a style ERROR concerning a missing space befire '('.
> This patch fix this issue.
>
> Signed-off-by: Quentin Lambert 
> ---
>  drivers/staging/greybus/manifest.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/staging/greybus/manifest.c
> +++ b/drivers/staging/greybus/manifest.c
> @@ -11,7 +11,7 @@
>
>  static const char *get_descriptor_type_string(u8 type)
>  {
> -   switch(type) {
> +   switch (type) {
> case GREYBUS_TYPE_INVALID:
> return "invalid";
> case GREYBUS_TYPE_STRING:

Acked-by: Viresh Kumar 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers/staging/greybus: gpio.c - Fixed a checkpatch generated warning

2016-09-27 Thread Viresh Kumar
On Mon, Sep 26, 2016 at 2:05 AM, Chase Metzger  wrote:
> Removed braces for single line if statement.
>
> Signed-off-by: Chase Metzger 
> ---
>  drivers/staging/greybus/gpio.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
> index ea8234a..5e06e42 100644
> --- a/drivers/staging/greybus/gpio.c
> +++ b/drivers/staging/greybus/gpio.c
> @@ -561,9 +561,8 @@ static void gb_gpio_irqchip_remove(struct 
> gb_gpio_controller *ggc)
> irq_domain_remove(ggc->irqdomain);
> }
>
> -   if (ggc->irqchip) {
> +   if (ggc->irqchip)
> ggc->irqchip = NULL;
> -   }
>  }
>
>  /**

Acked-by: Viresh Kumar 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] greybus: manifest: style fix missing space before '('

2016-09-27 Thread Quentin Lambert
Checkpatch printed a style ERROR concerning a missing space befire '('.
This patch fix this issue.

Signed-off-by: Quentin Lambert 
---
 drivers/staging/greybus/manifest.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/greybus/manifest.c
+++ b/drivers/staging/greybus/manifest.c
@@ -11,7 +11,7 @@
 
 static const char *get_descriptor_type_string(u8 type)
 {
-   switch(type) {
+   switch (type) {
case GREYBUS_TYPE_INVALID:
return "invalid";
case GREYBUS_TYPE_STRING:
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv4 1/4] staging:android:ion: Fix comparison with NULL

2016-09-27 Thread Yannis Damigos
This patch fixes the following comparison with NULL issues:

CHECK: Comparison to NULL could be written "compatible[i].name"
+   for (i = 0; compatible[i].name != NULL; i++) {

CHECK: Comparison to NULL could be written "!compatible[i].name"
+   if (compatible[i].name == NULL)

Signed-off-by: Yannis Damigos 
---
 drivers/staging/android/ion/ion_of.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/ion/ion_of.c 
b/drivers/staging/android/ion/ion_of.c
index 826e756..a8050c6 100644
--- a/drivers/staging/android/ion/ion_of.c
+++ b/drivers/staging/android/ion/ion_of.c
@@ -31,12 +31,12 @@ static int ion_parse_dt_heap_common(struct device_node 
*heap_node,
 {
int i;
 
-   for (i = 0; compatible[i].name != NULL; i++) {
+   for (i = 0; compatible[i].name; i++) {
if (of_device_is_compatible(heap_node, compatible[i].compat))
break;
}
 
-   if (compatible[i].name == NULL)
+   if (!compatible[i].name)
return -ENODEV;
 
heap->id = compatible[i].heap_id;
-- 
2.10.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv4 3/4] staging:android:ion: Fix blank line issues

2016-09-27 Thread Yannis Damigos
This patch fixes the following blank line issues:

CHECK: Please don't use multiple blank lines

CHECK: Please use a blank line after function/struct/union/enum declarations
+}
+RESERVEDMEM_OF_DECLARE(ion, "ion-region", rmem_ion_setup);

Signed-off-by: Yannis Damigos 
---
 drivers/staging/android/ion/ion_of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_of.c 
b/drivers/staging/android/ion/ion_of.c
index d090c3a..25f688c 100644
--- a/drivers/staging/android/ion/ion_of.c
+++ b/drivers/staging/android/ion/ion_of.c
@@ -119,7 +119,6 @@ struct ion_platform_data *ion_parse_dt(struct 
platform_device *pdev,
i++;
}
 
-
data->heaps = heaps;
data->nr = num_heaps;
return data;
@@ -181,5 +180,6 @@ static int __init rmem_ion_setup(struct reserved_mem *rmem)
rmem->ops = _dma_ops;
return 0;
 }
+
 RESERVEDMEM_OF_DECLARE(ion, "ion-region", rmem_ion_setup);
 #endif
-- 
2.10.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv4 4/4] staging:android:ion: Fix whitespace issue

2016-09-27 Thread Yannis Damigos
This patch fixes the following whitespace issue:

CHECK: spaces preferred around that '*' (ctx:VxV)
FILE: drivers/staging/android/ion/ion_of.c:91:
+sizeof(struct ion_platform_heap)*num_heaps,

Signed-off-by: Yannis Damigos 
---
 drivers/staging/android/ion/ion_of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_of.c 
b/drivers/staging/android/ion/ion_of.c
index 25f688c..15bac92 100644
--- a/drivers/staging/android/ion/ion_of.c
+++ b/drivers/staging/android/ion/ion_of.c
@@ -88,7 +88,7 @@ struct ion_platform_data *ion_parse_dt(struct platform_device 
*pdev,
return ERR_PTR(-EINVAL);
 
heaps = devm_kzalloc(>dev,
-sizeof(struct ion_platform_heap)*num_heaps,
+sizeof(struct ion_platform_heap) * num_heaps,
 GFP_KERNEL);
if (!heaps)
return ERR_PTR(-ENOMEM);
-- 
2.10.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: skein: Remove extra blank lines

2016-09-27 Thread Dan Carpenter
On Mon, Sep 26, 2016 at 11:56:27AM -0300, Martin wrote:
> Fix coding style issue "multiple blank lines" 
> detected by checkpatch.pl in threefish_block.c file.
> 
> Signed-off-by: Martin 

This Signed-off-by are like a legal document.  Use first and last name.
Also fix your from header as well.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: Use __packed over __attribute__((packed))

2016-09-27 Thread Matt Kilgore

This replaces uses of __attribute__((packed)) with __packed, which is
recommended to be used over the direct __attribute__.  This patch then
includes  as necessary to use __packed.

Signed-off-by: Matthew Kilgore 
---
drivers/staging/ks7010/eap_packet.h | 10 ++--
drivers/staging/ks7010/ks_hostif.h  | 99 +++--
drivers/staging/ks7010/ks_wlan.h|  4 +-
3 files changed, 59 insertions(+), 54 deletions(-)

diff --git a/drivers/staging/ks7010/eap_packet.h 
b/drivers/staging/ks7010/eap_packet.h
index 16a392a..373c0fe 100644
--- a/drivers/staging/ks7010/eap_packet.h
+++ b/drivers/staging/ks7010/eap_packet.h
@@ -1,6 +1,8 @@
#ifndef EAP_PACKET_H
#define EAP_PACKET_H

+#include 
+
#define WBIT(n) (1 << (n))

#ifndef ETH_ALEN
@@ -19,14 +21,14 @@ struct ether_hdr {
#define ETHER_PROTOCOL_TYPE_IP  0x0800
#define ETHER_PROTOCOL_TYPE_ARP 0x0806
/* followed by length octets of data */
-} __attribute__ ((packed));
+} __packed;

struct ieee802_1x_hdr {
unsigned char version;
unsigned char type;
unsigned short length;
/* followed by length octets of data */
-} __attribute__ ((packed));
+} __packed;

#define EAPOL_VERSION 2

@@ -69,7 +71,7 @@ struct ieee802_1x_eapol_key {
 * represents the number of least significant octets from
 * MS-MPPE-Send-Key attribute to be used as the keying material;
 * RC4 key used in encryption = Key-IV + MS-MPPE-Recv-Key */
-} __attribute__ ((packed));
+} __packed;

#define WPA_NONCE_LEN 32
#define WPA_REPLAY_COUNTER_LEN 8
@@ -86,7 +88,7 @@ struct wpa_eapol_key {
unsigned char key_mic[16];
unsigned short key_data_length;
/* followed by key_data_length bytes of key_data */
-} __attribute__ ((packed));
+} __packed;

#define WPA_KEY_INFO_TYPE_MASK (WBIT(0) | WBIT(1) | WBIT(2))
#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 WBIT(0)
diff --git a/drivers/staging/ks7010/ks_hostif.h 
b/drivers/staging/ks7010/ks_hostif.h
index dc806b5b..f35c0c51 100644
--- a/drivers/staging/ks7010/ks_hostif.h
+++ b/drivers/staging/ks7010/ks_hostif.h
@@ -11,6 +11,9 @@

#ifndef _KS_HOSTIF_H_
#define _KS_HOSTIF_H_
+
+#include 
+
/*
 * HOST-MAC I/F events
 */
@@ -61,7 +64,7 @@
struct hostif_hdr {
uint16_t size;
uint16_t event;
-} __attribute__ ((packed));
+} __packed;

struct hostif_data_request_t {
struct hostif_hdr header;
@@ -70,7 +73,7 @@ struct hostif_data_request_t {
#define TYPE_AUTH 0x0001
uint16_t reserved;
uint8_t data[0];
-} __attribute__ ((packed));
+} __packed;

struct hostif_data_indication_t {
struct hostif_hdr header;
@@ -81,14 +84,14 @@ struct hostif_data_indication_t {
#define TYPE_GMK2 0x0003
uint16_t reserved;
uint8_t data[0];
-} __attribute__ ((packed));
+} __packed;

#define CHANNEL_LIST_MAX_SIZE 14
struct channel_list_t {
uint8_t size;
uint8_t body[CHANNEL_LIST_MAX_SIZE];
uint8_t pad;
-} __attribute__ ((packed));
+} __packed;

/* MIB Attribute */
#define DOT11_MAC_ADDRESS 0x21010100/* MAC Address (R) */
@@ -141,7 +144,7 @@ struct channel_list_t {
struct hostif_mib_get_request_t {
struct hostif_hdr header;
uint32_t mib_attribute;
-} __attribute__ ((packed));
+} __packed;

struct hostif_mib_value_t {
uint16_t size;
@@ -152,7 +155,7 @@ struct hostif_mib_value_t {
#define MIB_VALUE_TYPE_COUNT32  3
#define MIB_VALUE_TYPE_OSTRING  4
uint8_t body[0];
-} __attribute__ ((packed));
+} __packed;

struct hostif_mib_get_confirm_t {
struct hostif_hdr header;
@@ -163,19 +166,19 @@ struct hostif_mib_get_confirm_t {
#define MIB_WRITE_ONLY 3
uint32_t mib_attribute;
struct hostif_mib_value_t mib_value;
-} __attribute__ ((packed));
+} __packed;

struct hostif_mib_set_request_t {
struct hostif_hdr header;
uint32_t mib_attribute;
struct hostif_mib_value_t mib_value;
-} __attribute__ ((packed));
+} __packed;

struct hostif_mib_set_confirm_t {
struct hostif_hdr header;
uint32_t mib_status;
uint32_t mib_attribute;
-} __attribute__ ((packed));
+} __packed;

struct hostif_power_mngmt_request_t {
struct hostif_hdr header;
@@ -188,7 +191,7 @@ struct hostif_power_mngmt_request_t {
uint32_t receiveDTIMs;
#define DTIM_FALSE 0
#define DTIM_TRUE  1
-} __attribute__ ((packed));
+} __packed;

/* power management mode */
enum {
@@ -206,7 +209,7 @@ enum {
struct hostif_power_mngmt_confirm_t {
struct hostif_hdr header;
uint16_t result_code;
-} __attribute__ ((packed));
+} __packed;

struct hostif_start_request_t {
struct hostif_hdr header;
@@ -215,64 +218,64 @@ struct hostif_start_request_t {
#define MODE_INFRASTRUCTURE 1
#define MODE_AP 2   /* not used */
#define MODE_ADHOC  3
-} __attribute__ ((packed));
+} __packed;

struct hostif_start_confirm_t {
struct hostif_hdr header;
uint16_t result_code;
-}