[PATCH 0/3] staging: emxx_udc: Fix several coding style issues

2015-09-04 Thread Ravi Teja Darbha
Fix several coding style issue as suggested by checkpatch.pl with
--strict option

Ravi Teja Darbha (3):
  staging: emxx_udc: Remove FSF mailing address
  staging: emxx_udc: Avoid using multiple blank lines
  staging: emxx_udc: Fix NULL comparison style

 drivers/staging/emxx_udc/emxx_udc.c | 75 +++--
 drivers/staging/emxx_udc/emxx_udc.h | 30 ---
 2 files changed, 31 insertions(+), 74 deletions(-)

-- 
1.9.1

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


[PATCH 1/3] staging: emxx_udc: Remove FSF mailing address

2015-09-04 Thread Ravi Teja Darbha
FSF mailing address is no longer required to be specified. Hence
removed.

Signed-off-by: Ravi Teja Darbha 
---
 drivers/staging/emxx_udc/emxx_udc.c | 4 
 drivers/staging/emxx_udc/emxx_udc.h | 4 
 2 files changed, 8 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index b6b76ff..a5b9e1e 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -12,10 +12,6 @@
  *  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.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software Foundation,
- *  Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
  */
 
 #include 
diff --git a/drivers/staging/emxx_udc/emxx_udc.h 
b/drivers/staging/emxx_udc/emxx_udc.h
index 0db6b41..5a53186 100644
--- a/drivers/staging/emxx_udc/emxx_udc.h
+++ b/drivers/staging/emxx_udc/emxx_udc.h
@@ -11,10 +11,6 @@
  *  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.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software Foundation,
- *  Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
  */
 
 
-- 
1.9.1

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


[PATCH 2/3] staging: emxx_udc: Avoid using multiple blank lines

2015-09-04 Thread Ravi Teja Darbha
Fixed multiple blank lines warning by checkpatch.pl

Signed-off-by: Ravi Teja Darbha 
---
 drivers/staging/emxx_udc/emxx_udc.c |  9 -
 drivers/staging/emxx_udc/emxx_udc.h | 26 --
 2 files changed, 35 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index a5b9e1e..d57a9ab 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -63,12 +63,10 @@ static void _nbu2ss_fifo_flush(struct nbu2ss_udc *, struct 
nbu2ss_ep *);
 #define_nbu2ss_zero_len_pkt(udc, epnum)\
_nbu2ss_ep_in_end(udc, epnum, 0, 0)
 
-
 /*===*/
 /* Global */
 struct nbu2ss_udc udc_controller;
 
-
 /*-*/
 /* Read */
 static inline u32 _nbu2ss_readl(void *address)
@@ -1394,7 +1392,6 @@ static void _nbu2ss_set_endpoint_stall(
}
 }
 
-
 /*-*/
 /* Device Descriptor */
 static struct usb_device_descriptor device_desc = {
@@ -2195,7 +2192,6 @@ static void _nbu2ss_ep0_enable(struct nbu2ss_udc *udc)
_nbu2ss_writel(&udc->p_regs->EP0_INT_ENA, EP0_INT_EN_BIT);
 }
 
-
 /*-*/
 static int _nbu2ss_nuke(struct nbu2ss_udc *udc,
struct nbu2ss_ep *ep,
@@ -2331,7 +2327,6 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc 
*udc)
return 0;
 }
 
-
 /*-*/
 static void _nbu2ss_reset_controller(struct nbu2ss_udc *udc)
 {
@@ -2985,7 +2980,6 @@ static struct usb_ep_ops nbu2ss_ep_ops = {
.fifo_flush = nbu2ss_ep_fifo_flush,
 };
 
-
 /*-*/
 /* usb_gadget_ops */
 
@@ -3138,7 +3132,6 @@ static int nbu2ss_gad_ioctl(
return 0;
 }
 
-
 static const struct usb_gadget_ops nbu2ss_gadget_ops = {
.get_frame  = nbu2ss_gad_get_frame,
.wakeup = nbu2ss_gad_wakeup,
@@ -3403,7 +3396,6 @@ static int nbu2ss_drv_resume(struct platform_device *pdev)
return 0;
 }
 
-
 static struct platform_driver udc_driver = {
.probe  = nbu2ss_drv_probe,
.shutdown   = nbu2ss_drv_shutdown,
@@ -3421,4 +3413,3 @@ MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_AUTHOR("Renesas Electronics Corporation");
 MODULE_LICENSE("GPL");
 
-
diff --git a/drivers/staging/emxx_udc/emxx_udc.h 
b/drivers/staging/emxx_udc/emxx_udc.h
index 5a53186..4a2cc38 100644
--- a/drivers/staging/emxx_udc/emxx_udc.h
+++ b/drivers/staging/emxx_udc/emxx_udc.h
@@ -13,14 +13,9 @@
  *  GNU General Public License for more details.
  */
 
-
-
-
 #ifndef _LINUX_EMXX_H
 #define _LINUX_EMXX_H
 
-
-
 /*---*/
 /*- Default undef */
 #if 0
@@ -32,14 +27,11 @@
 #defineUSE_DMA 1
 #define USE_SUSPEND_WAIT   1
 
-
-
 #ifndef TRUE
 #define TRUE   1
 #define FALSE  0
 #endif
 
-
 /* Board dependence(Resource) */
 #defineVBUS_VALUE  GPIO_VBUS
 
@@ -54,15 +46,11 @@
 /* DMA Abort wait time ms */
 #define DMA_DISABLE_TIME   10
 
-
-
 /* Controller dependence */
 #define NUM_ENDPOINTS  14  /* Endpoint */
 #define REG_EP_NUM 15  /* Endpoint Register */
 #define DMA_MAX_COUNT  256 /* DMA Block */
 
-
-
 #define EPC_RST_DISABLE_TIME   1   /* 1 usec */
 #define EPC_DIRPD_DISABLE_TIME 1   /* 1 msec */
 #define EPC_PLL_LOCK_COUNT 1000/* 1000 */
@@ -71,12 +59,10 @@
 #define CHATGER_TIME   700 /* 700msec */
 #define USB_SUSPEND_TIME   2000/* 2 sec */
 
-
 /* U2F FLAG */
 #define U2F_ENABLE 1
 #define U2F_DISABLE0
 
-
 /*--- BIT */
 #define BIT00  0x0001
 #define BIT01  0x0002
@@ -456,8 +442,6 @@
 /*--- (0x1118:) EPnTADR Register */
 #define EPn_TADR   0x  /* RW */
 
-
-
 /*===*/
 /* Struct */
 /*--- ep_regs */
@@ -522,13 +506,6 @@ struct fc_regs {
u8 Reserved1200[0x1000-0x200];  /* Reserved */
 } __aligned(32);
 
-
-
-
-
-
-
-
 #define EP0_PACKETSIZE 64
 #define EP_PACKETSIZE  1024
 
@@ -539,10 +516,8 @@ struct fc_regs {
 #define D_FS_RAM_SIZE_BULK 64
 #define D_HS_RAM_SIZE_BULK 512
 
-
 struct nbu2ss_udc;
 
-
 enum ep0_state {
EP0_IDLE,
EP0_IN_DATA_PHASE,
@@ -587,7 +562,6 @@ struct nbu2ss_ep {
dma_addr_t  phys_buf;
 };
 
-
 struct nbu2ss_udc {
struct usb_gadget gadget;
struct usb_gadget_driver *driver;
-- 

[PATCH 3/3] staging: emxx_udc: Fix NULL comparison style

2015-09-04 Thread Ravi Teja Darbha
Fixed NULL comparison style as suggested by checkpatch.pl

Signed-off-by: Ravi Teja Darbha 
---
 drivers/staging/emxx_udc/emxx_udc.c | 62 ++---
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index d57a9ab..8cef08d 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -108,7 +108,7 @@ static void _nbu2ss_dump_register(struct nbu2ss_udc *udc)
 
pr_info("=== %s()\n", __func__);
 
-   if (udc == NULL) {
+   if (!udc) {
pr_err("%s udc == NULL\n", __func__);
return;
}
@@ -149,7 +149,7 @@ static void _nbu2ss_ep0_complete(struct usb_ep *_ep, struct 
usb_request *_req)
struct usb_ctrlrequest  *p_ctrl;
struct nbu2ss_udc *udc;
 
-   if ((_ep == NULL) || (_req == NULL))
+   if ((!_ep) || (!_req))
return;
 
udc = (struct nbu2ss_udc *)_req->context;
@@ -1294,7 +1294,7 @@ static void _nbu2ss_restert_transfer(struct nbu2ss_ep *ep)
else
req = list_entry(ep->queue.next, struct nbu2ss_req, queue);
 
-   if (req == NULL)
+   if (!req)
return;
 
if (ep->epnum > 0) {
@@ -1700,7 +1700,7 @@ static int std_req_set_configuration(struct nbu2ss_udc 
*udc)
 /*-*/
 static inline void _nbu2ss_read_request_data(struct nbu2ss_udc *udc, u32 
*pdata)
 {
-   if ((udc == NULL) && (pdata == NULL))
+   if ((!udc) && (!pdata))
return;
 
*pdata = _nbu2ss_readl(&udc->p_regs->SETUP_DATA0);
@@ -1793,7 +1793,7 @@ static inline int _nbu2ss_ep0_in_data_stage(struct 
nbu2ss_udc *udc)
else
req = list_entry(ep->queue.next, struct nbu2ss_req, queue);
 
-   if (req == NULL)
+   if (!req)
req = &udc->ep0_req;
 
req->req.actual += req->div_len;
@@ -1820,7 +1820,7 @@ static inline int _nbu2ss_ep0_out_data_stage(struct 
nbu2ss_udc *udc)
else
req = list_entry(ep->queue.next, struct nbu2ss_req, queue);
 
-   if (req == NULL)
+   if (!req)
req = &udc->ep0_req;
 
nret = _nbu2ss_ep0_out_transfer(udc, ep, req);
@@ -1847,7 +1847,7 @@ static inline int _nbu2ss_ep0_status_stage(struct 
nbu2ss_udc *udc)
else
req = list_entry(ep->queue.next, struct nbu2ss_req, queue);
 
-   if (req == NULL) {
+   if (!req) {
req = &udc->ep0_req;
if (req->req.complete)
req->req.complete(&ep->ep, &req->req);
@@ -2154,7 +2154,7 @@ static inline void _nbu2ss_epn_int(struct nbu2ss_udc 
*udc, u32 epnum)
else
req = list_entry(ep->queue.next, struct nbu2ss_req, queue);
 
-   if (req == NULL) {
+   if (!req) {
/* pr_warn("=== %s(%d) req == NULL\n", __func__, epnum); */
return;
}
@@ -2559,13 +2559,13 @@ static int nbu2ss_ep_enable(
struct nbu2ss_ep*ep;
struct nbu2ss_udc   *udc;
 
-   if ((_ep == NULL) || (desc == NULL)) {
+   if ((!_ep) || (!desc)) {
pr_err(" *** %s, bad param\n", __func__);
return -EINVAL;
}
 
ep = container_of(_ep, struct nbu2ss_ep, ep);
-   if ((ep == NULL) || (ep->udc == NULL)) {
+   if ((!ep) || (!ep->udc)) {
pr_err(" *** %s, ep == NULL !!\n", __func__);
return -EINVAL;
}
@@ -2582,7 +2582,7 @@ static int nbu2ss_ep_enable(
if (udc->vbus_active == 0)
return -ESHUTDOWN;
 
-   if ((udc->driver == NULL)
+   if ((!udc->driver)
|| (udc->gadget.speed == USB_SPEED_UNKNOWN)) {
 
dev_err(ep->udc->dev, " *** %s, udc !!\n", __func__);
@@ -2619,13 +2619,13 @@ static int nbu2ss_ep_disable(struct usb_ep *_ep)
struct nbu2ss_udc   *udc;
unsigned long   flags;
 
-   if (_ep == NULL) {
+   if (!_ep) {
pr_err(" *** %s, bad param\n", __func__);
return -EINVAL;
}
 
ep = container_of(_ep, struct nbu2ss_ep, ep);
-   if ((ep == NULL) || (ep->udc == NULL)) {
+   if ((!ep) || (!ep->udc)) {
pr_err("udc: *** %s, ep == NULL !!\n", __func__);
return -EINVAL;
}
@@ -2667,7 +2667,7 @@ static void nbu2ss_ep_free_request(
 {
struct nbu2ss_req *req;
 
-   if (_req != NULL) {
+   if (_req) {
req = container_of(_req, struct nbu2ss_req, req);
 
kfree(req);
@@ -2688,11 +2688,11 @@ static int nbu2ss_ep_queue(
int result = -EINVAL;
 
/* catch various bogus parameters */
-   if ((_ep == NULL) || (_req == NULL)) {
-   if (_ep == NULL)
+   if ((!_ep) || (!_req)) {
+   if (!_ep)
  

Re: [PATCH v2 5/7] staging: board: Add support for devices with complex dependencies

2015-09-04 Thread Ulf Hansson
On 3 September 2015 at 15:35, Geert Uytterhoeven  wrote:
> Hi Ulf,
>
> On Thu, Sep 3, 2015 at 2:53 PM, Ulf Hansson  wrote:
>> On 17 June 2015 at 10:38, Geert Uytterhoeven  wrote:
>>> Add support for easy registering of one ore more platform devices that
>>> may:
>>>   - need clocks that are described in DT,
>>>   - be part of a PM Domain.
>
>>> diff --git a/drivers/staging/board/board.c b/drivers/staging/board/board.c
>>> index 8712f566b31196e0..29d456e29f38feac 100644
>>> --- a/drivers/staging/board/board.c
>>> +++ b/drivers/staging/board/board.c
>
>>> +int __init board_staging_register_device(const struct board_staging_dev 
>>> *dev)
>>> +{
>>> +   struct platform_device *pdev = dev->pdev;
>>> +   unsigned int i;
>>> +   int error;
>>> +
>>> +   pr_debug("Trying to register device %s\n", pdev->name);
>>> +   if (board_staging_dt_node_available(pdev->resource,
>>> +   pdev->num_resources)) {
>>> +   pr_warn("Skipping %s, already in DT\n", pdev->name);
>>> +   return -EEXIST;
>>> +   }
>>> +
>>> +   board_staging_gic_fixup_resources(pdev->resource, 
>>> pdev->num_resources);
>>> +
>>> +   for (i = 0; i < dev->nclocks; i++)
>>> +   board_staging_register_clock(&dev->clocks[i]);
>>> +
>>> +   error = platform_device_register(pdev);
>>> +   if (error) {
>>> +   pr_err("Failed to register device %s (%d)\n", pdev->name,
>>> +  error);
>>> +   return error;
>>> +   }
>>> +
>>> +   if (dev->domain)
>>> +   __pm_genpd_name_add_device(dev->domain, &pdev->dev, NULL);
>>
>> Urgh, this managed to slip through my filters.
>>
>> It seems like we almost managed to remove all users of the
>> "..._name_add..." APIs for genpd. If hasn't been for $subject patch.
>> :-)
>>
>> Now, I realize this is already too late here, but let's try to fix
>> this before it turns into a bigger issue.
>>
>> Geert, do you think it's possible to convert into using the non-named
>> bases APIs?
>
> That will be difficult. This code is meant to use drivers that are not yet
> DT-aware on DT-based systems. Hence it uses platform devices with named PM
> domains, while the PM domains are described in DT.
> I don't think there's another way to look up a PM domain by name, is there?

As a matter of fact there are, especially for those genpds that has
been created through DT as in this case. The API to use is
of_genpd_get_from_provider() to find the struct generic_pm_domain.

Yes, I do realize that you need to manage the parsing of the domain
name to make sure it's the one you want, but I would rather keep that
"hack" in this driver than in the generic API.

>
> This code is meant to go away, once all drivers are converted to DT, or
> considered obsolete.

Well, who knows *when* that is going to happen. :-)

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


Re: [PATCH] staging: comedi: kcomedilib: Fixed coding style issue

2015-09-04 Thread Ian Abbott

On 03/09/15 18:44, Nayeemahmed Badebade wrote:

Fixed checkpatch.pl warning in kcomedilib_main.c:
  - Block comments use * on subsequent lines

Signed-off-by: Nayeemahmed Badebade 
---
  .../staging/comedi/kcomedilib/kcomedilib_main.c| 32 +++---
  1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c 
b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
index 76bf561..d0a8a28 100644
--- a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
+++ b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
@@ -1,20 +1,20 @@
  /*
-kcomedilib/kcomedilib.c
-a comedlib interface for kernel modules
-
-COMEDI - Linux Control and Measurement Device Interface
-Copyright (C) 1997-2000 David A. Schleef 
-
-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.
-*/
+ * kcomedilib/kcomedilib.c
+ * a comedlib interface for kernel modules
+ *
+ * COMEDI - Linux Control and Measurement Device Interface
+ * Copyright (C) 1997-2000 David A. Schleef 
+ *
+ * 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 




Thanks!

Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/5] Minor fixes for wlan-ng/rtl/wilc100 drivers

2015-09-04 Thread Anish Bhatt
Patchset covers checkpatch recommendations and code cleanup of
multiple duplicate or unncessary cpp defines. 

Anish Bhatt (5):
  staging/wlan-ng : Prefer ether_addr* functions over mem*
  staging/wlan-ng : Remove duplicated defines from p80211
  staging/rtl* Remove unused macro definitions.
  staging/rtl* Remove duplicated BIT() definitions
  staging/wilc100 : Use BIT() macro where possible

 drivers/staging/rtl8188eu/include/rtl8188e_spec.h |  4 --
 drivers/staging/rtl8188eu/include/wifi.h  | 12 
 drivers/staging/rtl8712/osdep_service.h   |  4 --
 drivers/staging/rtl8712/wifi.h|  9 ---
 drivers/staging/wilc1000/wilc_wlan.c  | 64 ++--
 drivers/staging/wlan-ng/p80211conv.c  | 72 +++
 drivers/staging/wlan-ng/p80211conv.h  |  7 +--
 drivers/staging/wlan-ng/p80211netdev.c|  2 +-
 drivers/staging/wlan-ng/prism2sta.c   | 16 ++---
 9 files changed, 79 insertions(+), 111 deletions(-)

-- 
2.5.1

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


[PATCH 3/5] staging/rtl* Remove unused macro definitions.

2015-09-04 Thread Anish Bhatt
WLAN_ETHHDR_LEN/WLAN_ETHADDR_LEN/WLAN_ADDR_LEN
 are unused, duplicate or unnecessary, remove.

Signed-off-by: Anish Bhatt 
---
 drivers/staging/rtl8188eu/include/wifi.h | 5 -
 drivers/staging/rtl8712/wifi.h   | 4 
 2 files changed, 9 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/wifi.h 
b/drivers/staging/rtl8188eu/include/wifi.h
index dba8af1..6e5fa73 100644
--- a/drivers/staging/rtl8188eu/include/wifi.h
+++ b/drivers/staging/rtl8188eu/include/wifi.h
@@ -27,11 +27,7 @@
 #endif
 #define BIT(x) (1 << (x))
 
-
-#define WLAN_ETHHDR_LEN14
-#define WLAN_ETHADDR_LEN   6
 #define WLAN_IEEE_OUI_LEN  3
-#define WLAN_ADDR_LEN  6
 #define WLAN_CRC_LEN   4
 #define WLAN_BSSID_LEN 6
 #define WLAN_BSS_TS_LEN8
@@ -47,7 +43,6 @@
 
 #define WLAN_MIN_ETHFRM_LEN60
 #define WLAN_MAX_ETHFRM_LEN1514
-#define WLAN_ETHHDR_LEN14
 
 #define P80211CAPTURE_VERSION  0x80211001
 
diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index 17f5131..67c6ebf 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -33,10 +33,7 @@
 #endif
 #define BIT(x) (1 << (x))
 
-#define WLAN_ETHHDR_LEN14
-#define WLAN_ETHADDR_LEN   6
 #define WLAN_IEEE_OUI_LEN  3
-#define WLAN_ADDR_LEN  6
 #define WLAN_CRC_LEN   4
 #define WLAN_BSSID_LEN 6
 #define WLAN_BSS_TS_LEN8
@@ -52,7 +49,6 @@
 
 #define WLAN_MIN_ETHFRM_LEN60
 #define WLAN_MAX_ETHFRM_LEN1514
-#define WLAN_ETHHDR_LEN14
 
 #define P80211CAPTURE_VERSION  0x80211001
 
-- 
2.5.1

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


[PATCH 2/5] staging/wlan-ng : Remove duplicated defines from p80211

2015-09-04 Thread Anish Bhatt
ETH_ALEN/ETH_HLEN can be  used instead of
WLAN_ETHADDR_LEN & WLAN_ETHHDR_LEN, replace directly or
use eth_addr* functions where applicable.

Signed-off-by: Anish Bhatt 
---
 drivers/staging/wlan-ng/p80211conv.c | 50 ++--
 drivers/staging/wlan-ng/p80211conv.h |  7 ++---
 2 files changed, 27 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.c 
b/drivers/staging/wlan-ng/p80211conv.c
index 75f6524..29924b8 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -135,7 +135,7 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
/* it's 802.3, pass ether payload unchanged,  */
 
/* trim off ethernet header */
-   skb_pull(skb, WLAN_ETHHDR_LEN);
+   skb_pull(skb, ETH_HLEN);
 
/*   leave off any PAD octets.  */
skb_trim(skb, proto);
@@ -144,7 +144,7 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
/* it's DIXII, time for some conversion */
 
/* trim off ethernet header */
-   skb_pull(skb, WLAN_ETHHDR_LEN);
+   skb_pull(skb, ETH_HLEN);
 
/* tack on SNAP */
e_snap =
@@ -281,8 +281,8 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
u16 fc;
unsigned int payload_length;
unsigned int payload_offset;
-   u8 daddr[WLAN_ETHADDR_LEN];
-   u8 saddr[WLAN_ETHADDR_LEN];
+   u8 daddr[ETH_ALEN];
+   u8 saddr[ETH_ALEN];
union p80211_hdr *w_hdr;
struct wlan_ethhdr *e_hdr;
struct wlan_llc *e_llc;
@@ -298,16 +298,16 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 
ethconv,
/* setup some vars for convenience */
fc = le16_to_cpu(w_hdr->a3.fc);
if ((WLAN_GET_FC_TODS(fc) == 0) && (WLAN_GET_FC_FROMDS(fc) == 0)) {
-   memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN);
-   memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN);
+   ether_addr_copy(daddr, w_hdr->a3.a1);
+   ether_addr_copy(saddr, w_hdr->a3.a2);
} else if ((WLAN_GET_FC_TODS(fc) == 0)
&& (WLAN_GET_FC_FROMDS(fc) == 1)) {
-   memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN);
-   memcpy(saddr, w_hdr->a3.a3, WLAN_ETHADDR_LEN);
+   ether_addr_copy(daddr, w_hdr->a3.a1);
+   ether_addr_copy(saddr, w_hdr->a3.a3);
} else if ((WLAN_GET_FC_TODS(fc) == 1)
&& (WLAN_GET_FC_FROMDS(fc) == 0)) {
-   memcpy(daddr, w_hdr->a3.a3, WLAN_ETHADDR_LEN);
-   memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN);
+   ether_addr_copy(daddr, w_hdr->a3.a3);
+   ether_addr_copy(saddr, w_hdr->a3.a2);
} else {
payload_offset = WLAN_HDR_A4_LEN;
if (payload_length < WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN) {
@@ -315,8 +315,8 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
return 1;
}
payload_length -= (WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN);
-   memcpy(daddr, w_hdr->a4.a3, WLAN_ETHADDR_LEN);
-   memcpy(saddr, w_hdr->a4.a4, WLAN_ETHADDR_LEN);
+   ether_addr_copy(daddr, w_hdr->a4.a3);
+   ether_addr_copy(saddr, w_hdr->a4.a4);
}
 
/* perform de-wep if necessary.. */
@@ -360,16 +360,16 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 
ethconv,
/* Test for the various encodings */
if ((payload_length >= sizeof(struct wlan_ethhdr)) &&
(e_llc->dsap != 0xaa || e_llc->ssap != 0xaa) &&
-   ((memcmp(daddr, e_hdr->daddr, WLAN_ETHADDR_LEN) == 0) ||
-(memcmp(saddr, e_hdr->saddr, WLAN_ETHADDR_LEN) == 0))) {
+   ((!ether_addr_equal_unaligned(daddr, e_hdr->daddr)) ||
+(!ether_addr_equal_unaligned(saddr, e_hdr->saddr {
pr_debug("802.3 ENCAP len: %d\n", payload_length);
/* 802.3 Encapsulated */
/* Test for an overlength frame */
-   if (payload_length > (netdev->mtu + WLAN_ETHHDR_LEN)) {
+   if (payload_length > (netdev->mtu + ETH_HLEN)) {
/* A bogus length ethfrm has been encap'd. */
/* Is someone trying an oflow attack? */
netdev_err(netdev, "ENCAP frame too large (%d > %d)\n",
-  payload_length, netdev->mtu + WLAN_ETHHDR_LEN);
+  payload_length, netdev->mtu + ETH_HLEN);
return 1;
}
 
@@ -406,9 +406,9 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
skb_pull(skb, payload_offset);
 
/* create 802.3 header at beginning of skb. */
-   

[PATCH 1/5] staging/wlan-ng : Prefer ether_addr* functions over mem*

2015-09-04 Thread Anish Bhatt
Replace memcmp/memcpy(... ETH_ALEN) with ether_addr_copy()/
ether_addr_equal_unaligned()

Signed-off-by: Anish Bhatt 
---
 drivers/staging/wlan-ng/p80211conv.c   | 22 +++---
 drivers/staging/wlan-ng/p80211netdev.c |  2 +-
 drivers/staging/wlan-ng/prism2sta.c| 16 +---
 3 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.c 
b/drivers/staging/wlan-ng/p80211conv.c
index 49f2ef8..75f6524 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -178,21 +178,21 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 
ethconv,
 
switch (wlandev->macmode) {
case WLAN_MACMODE_IBSS_STA:
-   memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a3, wlandev->bssid, ETH_ALEN);
+   ether_addr_copy(p80211_hdr->a3.a1, e_hdr.daddr);
+   ether_addr_copy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr);
+   ether_addr_copy(p80211_hdr->a3.a3, wlandev->bssid);
break;
case WLAN_MACMODE_ESS_STA:
fc |= cpu_to_le16(WLAN_SET_FC_TODS(1));
-   memcpy(p80211_hdr->a3.a1, wlandev->bssid, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a3, &e_hdr.daddr, ETH_ALEN);
+   ether_addr_copy(p80211_hdr->a3.a1, wlandev->bssid);
+   ether_addr_copy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr);
+   ether_addr_copy(p80211_hdr->a3.a3, e_hdr.daddr);
break;
case WLAN_MACMODE_ESS_AP:
fc |= cpu_to_le16(WLAN_SET_FC_FROMDS(1));
-   memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a2, wlandev->bssid, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, ETH_ALEN);
+   ether_addr_copy(p80211_hdr->a3.a1, e_hdr.daddr);
+   ether_addr_copy(p80211_hdr->a3.a2, wlandev->bssid);
+   ether_addr_copy(p80211_hdr->a3.a3, e_hdr.saddr);
break;
default:
netdev_err(wlandev->netdev,
@@ -242,8 +242,8 @@ static void orinoco_spy_gather(wlandevice_t *wlandev, char 
*mac,
 
for (i = 0; i < wlandev->spy_number; i++) {
 
-   if (!memcmp(wlandev->spy_address[i], mac, ETH_ALEN)) {
-   memcpy(wlandev->spy_address[i], mac, ETH_ALEN);
+   if (!ether_addr_equal_unaligned(wlandev->spy_address[i], mac)) {
+   ether_addr_copy(wlandev->spy_address[i], mac);
wlandev->spy_stat[i].level = rxmeta->signal;
wlandev->spy_stat[i].noise = rxmeta->noise;
wlandev->spy_stat[i].qual =
diff --git a/drivers/staging/wlan-ng/p80211netdev.c 
b/drivers/staging/wlan-ng/p80211netdev.c
index a9c1e0b..a1bb726 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -644,7 +644,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, 
void *addr)
macaddr->status = P80211ENUM_msgitem_status_data_ok;
macaddr->len = sizeof(macaddr->data);
macaddr->data.len = ETH_ALEN;
-   memcpy(&macaddr->data.data, new_addr->sa_data, ETH_ALEN);
+   ether_addr_copy(macaddr->data.data, new_addr->sa_data);
 
/* Set up the resultcode argument */
resultcode->did = DIDmsg_dot11req_mibset_resultcode;
diff --git a/drivers/staging/wlan-ng/prism2sta.c 
b/drivers/staging/wlan-ng/prism2sta.c
index 0329c52..3085563 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -1483,7 +1483,8 @@ static void prism2sta_inf_assocstatus(wlandevice_t 
*wlandev,
 */
 
for (i = 0; i < hw->authlist.cnt; i++)
-   if (memcmp(rec.sta_addr, hw->authlist.addr[i], ETH_ALEN) == 0)
+   if (!ether_addr_equal_unaligned(rec.sta_addr,
+   hw->authlist.addr[i]))
break;
 
if (i >= hw->authlist.cnt) {
@@ -1565,8 +1566,9 @@ static void prism2sta_inf_authreq_defer(wlandevice_t 
*wlandev,
 */
 
for (i = 0; i < hw->authlist.cnt; i++)
-   if (memcmp(rec.address, hw->authlist.addr[i],
-  ETH_ALEN) == 0) {
+   if (!ether_addr_equal_unaligned(rec.address,
+   hw->authlist.addr[i])
+  ) {
rec.status = P80211ENUM_status_successful;
break;
}
@@ -1603,7 +1605,7 @@ static void prism2sta_inf_authreq_defer(wlandevice_t 
*wlandev,
}
 
for (i = 0; i < cnt; i++, addr += ETH_ALEN)

[PATCH 4/5] staging/rtl* Remove duplicated BIT() definitions

2015-09-04 Thread Anish Bhatt
The BIT() macro is already defined in bitops.h,
remove duplicate definitions.

Signed-off-by: Anish Bhatt 
---
 drivers/staging/rtl8188eu/include/rtl8188e_spec.h | 4 
 drivers/staging/rtl8188eu/include/wifi.h  | 7 ---
 drivers/staging/rtl8712/osdep_service.h   | 4 
 drivers/staging/rtl8712/wifi.h| 5 -
 4 files changed, 20 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_spec.h 
b/drivers/staging/rtl8188eu/include/rtl8188e_spec.h
index 2c33eb3..e99179a 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_spec.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_spec.h
@@ -19,10 +19,6 @@
 #ifndef __RTL8188E_SPEC_H__
 #define __RTL8188E_SPEC_H__
 
-#ifndef BIT
-#define BIT(x) (1 << (x))
-#endif
-
 #define BIT0   0x0001
 #define BIT1   0x0002
 #define BIT2   0x0004
diff --git a/drivers/staging/rtl8188eu/include/wifi.h 
b/drivers/staging/rtl8188eu/include/wifi.h
index 6e5fa73..6cb5bec 100644
--- a/drivers/staging/rtl8188eu/include/wifi.h
+++ b/drivers/staging/rtl8188eu/include/wifi.h
@@ -20,13 +20,6 @@
 #ifndef _WIFI_H_
 #define _WIFI_H_
 
-
-#ifdef BIT
-/* error   "BIT define occurred earlier elsewhere!\n" */
-#undef BIT
-#endif
-#define BIT(x) (1 << (x))
-
 #define WLAN_IEEE_OUI_LEN  3
 #define WLAN_CRC_LEN   4
 #define WLAN_BSSID_LEN 6
diff --git a/drivers/staging/rtl8712/osdep_service.h 
b/drivers/staging/rtl8712/osdep_service.h
index 0a7f58c..076d508 100644
--- a/drivers/staging/rtl8712/osdep_service.h
+++ b/drivers/staging/rtl8712/osdep_service.h
@@ -60,10 +60,6 @@ struct   __queue {
 #define LIST_CONTAINOR(ptr, type, member) \
((type *)((char *)(ptr)-(SIZE_T)(&((type *)0)->member)))
 
-#ifndef BIT
-   #define BIT(x)  (1 << (x))
-#endif
-
 static inline u32 _down_sema(struct semaphore *sema)
 {
if (down_interruptible(sema))
diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index 67c6ebf..7a352c4 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -28,11 +28,6 @@
 
 #include 
 
-#ifdef BIT
-#undef BIT
-#endif
-#define BIT(x) (1 << (x))
-
 #define WLAN_IEEE_OUI_LEN  3
 #define WLAN_CRC_LEN   4
 #define WLAN_BSSID_LEN 6
-- 
2.5.1

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


[PATCH 5/5] staging/wilc100 : Use BIT() macro where possible

2015-09-04 Thread Anish Bhatt
Replace (1 << x) by BIT(x) as recommended by
checkpatch.pl

Signed-off-by: Anish Bhatt 
---
 drivers/staging/wilc1000/wilc_wlan.c | 64 +---
 1 file changed, 31 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 7c53a2b..0202b37 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -306,9 +306,6 @@ typedef struct {
 struct Ack_session_info *Free_head;
 struct Ack_session_info *Alloc_head;
 
-#define TCP_FIN_MASK   (1 << 0)
-#define TCP_SYN_MASK   (1 << 1)
-#define TCP_Ack_MASK   (1 << 4)
 #define NOT_TCP_ACK(-1)
 
 #define MAX_TCP_SESSION25
@@ -709,7 +706,7 @@ INLINE void chip_allow_sleep(void)
/* Clear bit 1 */
g_wlan.hif_func.hif_read_reg(0xf0, ®);
 
-   g_wlan.hif_func.hif_write_reg(0xf0, reg & ~(1 << 0));
+   g_wlan.hif_func.hif_write_reg(0xf0, reg & ~BIT(0));
 }
 
 INLINE void chip_wakeup(void)
@@ -721,10 +718,10 @@ INLINE void chip_wakeup(void)
do {
g_wlan.hif_func.hif_read_reg(1, ®);
/* Set bit 1 */
-   g_wlan.hif_func.hif_write_reg(1, reg | (1 << 1));
+   g_wlan.hif_func.hif_write_reg(1, reg | BIT(1));
 
/* Clear bit 1*/
-   g_wlan.hif_func.hif_write_reg(1, reg & ~(1 << 1));
+   g_wlan.hif_func.hif_write_reg(1, reg & ~BIT(1));
 
do {
/* Wait for the chip to stabilize*/
@@ -741,7 +738,7 @@ INLINE void chip_wakeup(void)
g_wlan.hif_func.hif_read_reg(0xf0, ®);
do {
/* Set bit 1 */
-   g_wlan.hif_func.hif_write_reg(0xf0, reg | (1 << 0));
+   g_wlan.hif_func.hif_write_reg(0xf0, reg | BIT(0));
 
/* Check the clock status */
g_wlan.hif_func.hif_read_reg(0xf1, &clk_status_reg);
@@ -764,7 +761,8 @@ INLINE void chip_wakeup(void)
/* in case of failure, Reset the wakeup bit to 
introduce a new edge on the next loop */
if ((clk_status_reg & 0x1) == 0) {
/* Reset bit 0 */
-   g_wlan.hif_func.hif_write_reg(0xf0, reg & (~(1 
<< 0)));
+   g_wlan.hif_func.hif_write_reg(0xf0, reg &
+ (~BIT(0)));
}
} while ((clk_status_reg & 0x1) == 0);
}
@@ -772,18 +770,18 @@ INLINE void chip_wakeup(void)
 
if (genuChipPSstate == CHIP_SLEEPING_MANUAL) {
g_wlan.hif_func.hif_read_reg(0x1C0C, ®);
-   reg &= ~(1 << 0);
+   reg &= ~BIT(0);
g_wlan.hif_func.hif_write_reg(0x1C0C, reg);
 
if (wilc_get_chipid(false) >= 0x1002b0) {
/* Enable PALDO back right after wakeup */
uint32_t val32;
g_wlan.hif_func.hif_read_reg(0x1e1c, &val32);
-   val32 |= (1 << 6);
+   val32 |= BIT(6);
g_wlan.hif_func.hif_write_reg(0x1e1c, val32);
 
g_wlan.hif_func.hif_read_reg(0x1e9c, &val32);
-   val32 |= (1 << 6);
+   val32 |= BIT(6);
g_wlan.hif_func.hif_write_reg(0x1e9c, val32);
}
}
@@ -797,19 +795,19 @@ INLINE void chip_wakeup(void)
if ((g_wlan.io_func.io_type & 0x1) == HIF_SPI) {
g_wlan.hif_func.hif_read_reg(1, ®);
/* Make sure bit 1 is 0 before we start. */
-   g_wlan.hif_func.hif_write_reg(1, reg & ~(1 << 1));
+   g_wlan.hif_func.hif_write_reg(1, reg & ~BIT(1));
/* Set bit 1 */
-   g_wlan.hif_func.hif_write_reg(1, reg | (1 << 1));
+   g_wlan.hif_func.hif_write_reg(1, reg | BIT(1));
/* Clear bit 1*/
-   g_wlan.hif_func.hif_write_reg(1, reg  & ~(1 << 1));
+   g_wlan.hif_func.hif_write_reg(1, reg  & ~BIT(1));
} else if ((g_wlan.io_func.io_type & 0x1) == HIF_SDIO)   {
/* Make sure bit 0 is 0 before we start. */
g_wlan.hif_func.hif_read_reg(0xf0, ®);
-   g_wlan.hif_func.hif_write_reg(0xf0, reg & ~(1 << 0));
+   g_wlan.hif_func.hif_write_reg(0xf0, reg & ~BIT(0));
/* Set bit 1 */
-   g_wlan.hif_func.hif_write_reg(0xf0, reg | (1 << 0));
+   g_wlan.hif_func.hif_write_reg(0xf0, reg | BIT(0));
/* Clear bit

[PATCH] staging: wilc1000: fix freeing of ERR_PTR

2015-09-04 Thread Sudip Mukherjee
If memdup_user() fails then it will return the error code in ERR_PTR. We
were checking it with IS_ERR but then again trying to free it on the
error path.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/wilc1000/linux_wlan.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index c90c459..020ed03 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2116,10 +2116,8 @@ int mac_ioctl(struct net_device *ndev, struct ifreq 
*req, int cmd)
if (size && wrq->u.data.pointer) {
 
buff = memdup_user(wrq->u.data.pointer, 
wrq->u.data.length);
-   if (IS_ERR(buff)) {
-   s32Error = PTR_ERR(buff);
-   goto done;
-   }
+   if (IS_ERR(buff))
+   return PTR_ERR(buff);
 
if (strncasecmp(buff, "RSSI", length) == 0) {
 
-- 
1.9.1

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


Re: [PATCH 5/5] staging/wilc100 : Use BIT() macro where possible

2015-09-04 Thread Sudip Mukherjee
On Fri, Sep 04, 2015 at 02:08:08AM -0700, Anish Bhatt wrote:
> Replace (1 << x) by BIT(x) as recommended by
> checkpatch.pl
> 
> Signed-off-by: Anish Bhatt 
> ---
You need to refresh your tree. This patch is not applying because of
some other changes.

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


Re: [PATCH 4/5] staging/rtl* Remove duplicated BIT() definitions

2015-09-04 Thread Sudip Mukherjee
On Fri, Sep 04, 2015 at 02:08:07AM -0700, Anish Bhatt wrote:
> The BIT() macro is already defined in bitops.h,
> remove duplicate definitions.
> 
> Signed-off-by: Anish Bhatt 
> ---
This patch is adding new build warnings.

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


[PATCH 1/5] staging: most: remove always true comparison

2015-09-04 Thread Sudip Mukherjee
channel->dev has already been checked for NULL and if it was NULL then
we have returned with -EPIPE. So at this point it can not be NULL.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/most/aim-cdev/cdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/aim-cdev/cdev.c 
b/drivers/staging/most/aim-cdev/cdev.c
index b0a9a4a..1a17e2a 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -166,7 +166,7 @@ static ssize_t aim_write(struct file *filp, const char 
__user *buf,
 
mbo = most_get_mbo(channel->iface, channel->channel_id);
 
-   if (!mbo && channel->dev) {
+   if (!mbo) {
if ((filp->f_flags & O_NONBLOCK))
return -EAGAIN;
if (wait_event_interruptible(
-- 
1.9.1

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


[PATCH 2/5] staging: most: return NULL instead of integer

2015-09-04 Thread Sudip Mukherjee
The return type of get_aim_dev() is a pointer but we were returning 0
incase of failure.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/most/aim-v4l2/video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/aim-v4l2/video.c 
b/drivers/staging/most/aim-v4l2/video.c
index d968791..8333245 100644
--- a/drivers/staging/most/aim-v4l2/video.c
+++ b/drivers/staging/most/aim-v4l2/video.c
@@ -430,7 +430,7 @@ static struct most_video_dev *get_aim_dev(
}
}
spin_unlock(&list_lock);
-   return 0;
+   return NULL;
 }
 
 static int aim_rx_data(struct mbo *mbo)
-- 
1.9.1

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


[PATCH 5/5] staging: most: style of bool comparison

2015-09-04 Thread Sudip Mukherjee
BOOLEAN tests do not need any comparison to TRUE or FALSE.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 10 +-
 drivers/staging/most/mostcore/core.c   |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c 
b/drivers/staging/most/hdm-usb/hdm_usb.c
index 34843b0..9bbefaa 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -308,7 +308,7 @@ static int hdm_poison_channel(struct most_interface *iface, 
int channel)
 
mutex_lock(&mdev->io_mutex);
free_anchored_buffers(mdev, channel);
-   if (mdev->padding_active[channel] == true)
+   if (mdev->padding_active[channel])
mdev->padding_active[channel] = false;
 
if (mdev->conf[channel].data_type == MOST_CH_ASYNC) {
@@ -411,7 +411,7 @@ static void hdm_write_completion(struct urb *urb)
dev = &mdev->usb_device->dev;
 
if ((urb->status == -ENOENT) || (urb->status == -ECONNRESET) ||
-   (mdev->is_channel_healthy[channel] == false)) {
+   (!mdev->is_channel_healthy[channel])) {
complete(&anchor->urb_compl);
return;
}
@@ -576,7 +576,7 @@ static void hdm_read_completion(struct urb *urb)
dev = &mdev->usb_device->dev;
 
if ((urb->status == -ENOENT) || (urb->status == -ECONNRESET) ||
-   (mdev->is_channel_healthy[channel] == false)) {
+   (!mdev->is_channel_healthy[channel])) {
complete(&anchor->urb_compl);
return;
}
@@ -605,7 +605,7 @@ static void hdm_read_completion(struct urb *urb)
}
} else {
mbo->processed_length = urb->actual_length;
-   if (mdev->padding_active[channel] == false) {
+   if (!mdev->padding_active[channel]) {
mbo->status = MBO_SUCCESS;
} else {
if (hdm_remove_padding(mdev, channel, mbo)) {
@@ -685,7 +685,7 @@ static int hdm_enqueue(struct most_interface *iface, int 
channel, struct mbo *mb
list_add_tail(&anchor->list, &mdev->anchor_list[channel]);
spin_unlock_irqrestore(&mdev->anchor_list_lock[channel], flags);
 
-   if ((mdev->padding_active[channel] == true) &&
+   if ((mdev->padding_active[channel]) &&
(conf->direction & MOST_CH_TX))
if (hdm_add_padding(mdev, channel, mbo)) {
retval = -EIO;
diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index 87f950f..eb4e159 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -1339,7 +1339,7 @@ static void most_write_completion(struct mbo *mbo)
c = mbo->context;
if (mbo->status == MBO_E_INVAL)
pr_info("WARN: Tx MBO status: invalid\n");
-   if (unlikely((c->is_poisoned == true) || (mbo->status == MBO_E_CLOSE)))
+   if (unlikely(c->is_poisoned || (mbo->status == MBO_E_CLOSE)))
trash_mbo(mbo);
else
arm_mbo(mbo);
@@ -1444,7 +1444,7 @@ static void most_read_completion(struct mbo *mbo)
struct most_c_obj *c;
 
c = mbo->context;
-   if (unlikely((c->is_poisoned == true) || (mbo->status == MBO_E_CLOSE)))
+   if (unlikely(c->is_poisoned || (mbo->status == MBO_E_CLOSE)))
goto release_mbo;
 
if (mbo->status == MBO_E_INVAL) {
-- 
1.9.1

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


[PATCH 4/5] staging: most: remove unneeded NULL check

2015-09-04 Thread Sudip Mukherjee
The loop cursor of list_for_each_entry_safe() can never be NULL.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/most/mostcore/core.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index 7bb16db..87f950f 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -190,8 +190,7 @@ static void flush_channel_fifos(struct most_c_obj *c)
list_for_each_entry_safe(mbo, tmp, &c->fifo, list) {
list_del(&mbo->list);
spin_unlock_irqrestore(&c->fifo_lock, flags);
-   if (likely(mbo))
-   most_free_mbo_coherent(mbo);
+   most_free_mbo_coherent(mbo);
spin_lock_irqsave(&c->fifo_lock, flags);
}
spin_unlock_irqrestore(&c->fifo_lock, flags);
@@ -200,8 +199,7 @@ static void flush_channel_fifos(struct most_c_obj *c)
list_for_each_entry_safe(mbo, tmp, &c->halt_fifo, list) {
list_del(&mbo->list);
spin_unlock_irqrestore(&c->fifo_lock, hf_flags);
-   if (likely(mbo))
-   most_free_mbo_coherent(mbo);
+   most_free_mbo_coherent(mbo);
spin_lock_irqsave(&c->fifo_lock, hf_flags);
}
spin_unlock_irqrestore(&c->fifo_lock, hf_flags);
-- 
1.9.1

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


[PATCH 3/5] staging: most: remove driver owner

2015-09-04 Thread Sudip Mukherjee
The platform driver core will set the owner value, we do not need to do
it in the module.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/most/hdm-dim2/dim2_hdm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c 
b/drivers/staging/most/hdm-dim2/dim2_hdm.c
index 5b0a588..4481a0b 100644
--- a/drivers/staging/most/hdm-dim2/dim2_hdm.c
+++ b/drivers/staging/most/hdm-dim2/dim2_hdm.c
@@ -923,7 +923,6 @@ static struct platform_driver dim2_driver = {
.id_table = dim2_id,
.driver = {
.name = "hdm_dim2",
-   .owner = THIS_MODULE,
},
 };
 
-- 
1.9.1

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


Re: [PATCH 1/2] staging: mt29f_spinand: Fix module autoload for OF platform driver

2015-09-04 Thread Luis de Bethencourt
On Fri, Sep 04, 2015 at 11:42:37AM +0530, Sudip Mukherjee wrote:
> On Thu, Sep 03, 2015 at 01:13:14PM +0200, Luis de Bethencourt wrote:
> > This platform driver has a OF device ID table but the OF module
> > alias information is not created so module autoloading won't work.
> > 
> > Signed-off-by: Luis de Bethencourt 
> > ---
> I think you need to refresh your tree. This has already been done by:
> ddaaa82ef93d ("staging: mt29f_spinand: Export OF module alias information");
> 
> regards
> sudip

Javier asked me to help him with the autoloading of Open Firmware driving.
We have clashed 3 times.

Sorry about that and thanks for the review Sudip,
Luis
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/8] staging: unisys: visornic/visorbus fixes

2015-09-04 Thread Ben Romer

On 09/02/2015 08:40 PM, Greg KH wrote:

These aren't all "fixes" so I can't just add them to the 4.3-final
release, but some look like they should go there.  So please split this
into two different series and resend, one for 4.3-final and one for
4.4-rc1.


Greg,

We've been running and testing with all of these patches for a week or 
two now, and my team and I all feel that the entire set is safe to 
include in the new release. I'm not sure what your criteria are for 
inclusion in 4.3, so if you could let me know what those are, I'd be 
happy to split them up and send two sets, of course with the per-patch 
comments addressed. :)


Thanks!

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


[PATCH] staging: slicoss: remove unused variables

2015-09-04 Thread Sudip Mukherjee
These variables were only assigned some values but they were never used.

Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/slicoss/slicoss.c | 27 ++-
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index 8585970..1536ca0 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -199,10 +199,8 @@ static void slic_mcast_set_mask(struct adapter *adapter)
 static void slic_timer_ping(ulong dev)
 {
struct adapter *adapter;
-   struct sliccard *card;
 
adapter = netdev_priv((struct net_device *)dev);
-   card = adapter->card;
 
adapter->pingtimer.expires = jiffies + (PING_TIMER_INTERVAL * HZ);
add_timer(&adapter->pingtimer);
@@ -1719,7 +1717,6 @@ static u32 slic_rcvqueue_reinsert(struct adapter 
*adapter, struct sk_buff *skb)
  */
 static void slic_link_event_handler(struct adapter *adapter)
 {
-   int status;
struct slic_shmem *pshmem;
 
if (adapter->state != ADAPT_UP) {
@@ -1730,15 +1727,13 @@ static void slic_link_event_handler(struct adapter 
*adapter)
pshmem = (struct slic_shmem *)(unsigned long)adapter->phys_shmem;
 
 #if BITS_PER_LONG == 64
-   status = slic_upr_request(adapter,
- SLIC_UPR_RLSR,
- SLIC_GET_ADDR_LOW(&pshmem->linkstatus),
- SLIC_GET_ADDR_HIGH(&pshmem->linkstatus),
- 0, 0);
+   slic_upr_request(adapter, SLIC_UPR_RLSR,
+SLIC_GET_ADDR_LOW(&pshmem->linkstatus),
+SLIC_GET_ADDR_HIGH(&pshmem->linkstatus), 0, 0);
 #else
-   status = slic_upr_request(adapter, SLIC_UPR_RLSR,
-   (u32) &pshmem->linkstatus,  /* no 4GB wrap guaranteed */
- 0, 0, 0);
+   slic_upr_request(adapter, SLIC_UPR_RLSR,
+(u32)&pshmem->linkstatus, /* no 4GB wrap guaranteed */
+0, 0, 0);
 #endif
 }
 
@@ -2078,8 +2073,6 @@ static void slic_interrupt_card_up(u32 isr, struct 
adapter *adapter,
adapter->error_interrupts++;
if (isr & ISR_RMISS) {
int count;
-   int pre_count;
-   int errors;
 
struct slic_rcvqueue *rcvq =
&adapter->rcvqueue;
@@ -2088,8 +2081,6 @@ static void slic_interrupt_card_up(u32 isr, struct 
adapter *adapter,
 
if (!rcvq->errors)
rcv_count = rcvq->count;
-   pre_count = rcvq->count;
-   errors = rcvq->errors;
 
while (rcvq->count < SLIC_RCVQ_FILLTHRESH) {
count = slic_rcvqueue_fill(adapter);
@@ -2650,9 +2641,7 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
ushort calc_chksum;
struct slic_config_mac *pmac;
unsigned char fruformat;
-   unsigned char oemfruformat;
struct atk_fru *patkfru;
-   union oemfru *poemfru;
unsigned long flags;
 
/* Reset everything except PCI configuration space */
@@ -2742,8 +2731,6 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
pmac = pOeeprom->MacInfo;
fruformat = pOeeprom->FruFormat;
patkfru = &pOeeprom->AtkFru;
-   oemfruformat = pOeeprom->OemFruFormat;
-   poemfru = &pOeeprom->OemFru;
macaddrs = 2;
/* Minor kludge for Oasis card
 get 2 MAC addresses from the
@@ -2757,8 +2744,6 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
pmac = peeprom->u2.mac.MacInfo;
fruformat = peeprom->FruFormat;
patkfru = &peeprom->AtkFru;
-   oemfruformat = peeprom->OemFruFormat;
-   poemfru = &peeprom->OemFru;
break;
}
 
-- 
1.9.1

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


Re: [PATCH 0/8] staging: unisys: visornic/visorbus fixes

2015-09-04 Thread Sudip Mukherjee
On Fri, Sep 04, 2015 at 09:20:23AM -0400, Ben Romer wrote:
> On 09/02/2015 08:40 PM, Greg KH wrote:
> >These aren't all "fixes" so I can't just add them to the 4.3-final
> >release, but some look like they should go there.  So please split this
> >into two different series and resend, one for 4.3-final and one for
> >4.4-rc1.
> 
> Greg,
> 
> We've been running and testing with all of these patches for a week
> or two now, and my team and I all feel that the entire set is safe
> to include in the new release. I'm not sure what your criteria are
> for inclusion in 4.3, so if you could let me know what those are,
> I'd be happy to split them up and send two sets, of course with the
> per-patch comments addressed. :)
Any new developments can only go in rc1 release. 4.3 merge window is
already open so new developments cannot be added to 4.3-rc1. New codes
has to go to 4.4-rc1.
4.3-rc2 - 4.3-rc7 (or 8) can only have fixes.

Greg please correct me if I am wrong. I should not have replied here but
this is a good opportunity to test my understanding of the release
cycle. :)

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


Re: [PATCH 0/8] staging: unisys: visornic/visorbus fixes

2015-09-04 Thread Ben Romer

On 09/04/2015 09:41 AM, Sudip Mukherjee wrote:

Any new developments can only go in rc1 release. 4.3 merge window is
already open so new developments cannot be added to 4.3-rc1. New codes
has to go to 4.4-rc1.
4.3-rc2 - 4.3-rc7 (or 8) can only have fixes.
I don't think any of the patches in this set specifically were adding 
new features, though I suppose the patches to remove list_all, 
devnum_pool, and devnum could be seen as not being *bug* fixes. It 
depends on if eliminating redundant code counts or not.


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


Re: [PATCH 2/2] android, lmk: Reverse the order of setting TIF_MEMDIE and sending SIGKILL.

2015-09-04 Thread Michal Hocko
On Wed 02-09-15 18:06:20, Greg KH wrote:
[...]
> And if we aren't taking patch 1/2, I guess this one isn't needed either?

Unlike the patch1 which was pretty much cosmetic this fixes a real
issue.
-- 
Michal Hocko
SUSE Labs
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/8] staging: unisys: visornic/visorbus fixes

2015-09-04 Thread Greg KH
On Fri, Sep 04, 2015 at 09:58:10AM -0400, Ben Romer wrote:
> On 09/04/2015 09:41 AM, Sudip Mukherjee wrote:
> >Any new developments can only go in rc1 release. 4.3 merge window is
> >already open so new developments cannot be added to 4.3-rc1. New codes
> >has to go to 4.4-rc1.
> >4.3-rc2 - 4.3-rc7 (or 8) can only have fixes.
> I don't think any of the patches in this set specifically were adding new
> features, though I suppose the patches to remove list_all, devnum_pool, and
> devnum could be seen as not being *bug* fixes. It depends on if eliminating
> redundant code counts or not.

It does not.  That's not a "bug" or "regression" that is needing to be
fixed as it is causing a problem for people.  It's a "cleanup" and that
type of patch can only be added in -rc1.

hope this helps,

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


Re: [PATCH 0/8] staging: unisys: visornic/visorbus fixes

2015-09-04 Thread Sudip Mukherjee
On Fri, Sep 04, 2015 at 09:58:10AM -0400, Ben Romer wrote:
> On 09/04/2015 09:41 AM, Sudip Mukherjee wrote:
> >Any new developments can only go in rc1 release. 4.3 merge window is
> >already open so new developments cannot be added to 4.3-rc1. New codes
> >has to go to 4.4-rc1.
> >4.3-rc2 - 4.3-rc7 (or 8) can only have fixes.
> I don't think any of the patches in this set specifically were
> adding new features, though I suppose the patches to remove
> list_all, devnum_pool, and devnum could be seen as not being *bug*
> fixes. It depends on if eliminating redundant code counts or not.
Eliminating redundant codes is considered as development and not bug
fix and should go to 4.4-rc1. The fixes like the one 0 day bot pointed
out should be for 4.3.

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


Re: [PATCH v2 5/7] staging: board: Add support for devices with complex dependencies

2015-09-04 Thread Geert Uytterhoeven
Hi Ulf,

On Fri, 4 Sep 2015, Ulf Hansson wrote:
> On 3 September 2015 at 15:35, Geert Uytterhoeven  wrote:
> > On Thu, Sep 3, 2015 at 2:53 PM, Ulf Hansson  wrote:
> >> On 17 June 2015 at 10:38, Geert Uytterhoeven  
> >> wrote:
> >>> Add support for easy registering of one ore more platform devices that
> >>> may:
> >>>   - need clocks that are described in DT,
> >>>   - be part of a PM Domain.
> >
> >>> diff --git a/drivers/staging/board/board.c b/drivers/staging/board/board.c
> >>> index 8712f566b31196e0..29d456e29f38feac 100644
> >>> --- a/drivers/staging/board/board.c
> >>> +++ b/drivers/staging/board/board.c
> >
> >>> +int __init board_staging_register_device(const struct board_staging_dev 
> >>> *dev)
> >>> +{
> >>> +   struct platform_device *pdev = dev->pdev;
> >>> +   unsigned int i;
> >>> +   int error;
> >>> +
> >>> +   pr_debug("Trying to register device %s\n", pdev->name);
> >>> +   if (board_staging_dt_node_available(pdev->resource,
> >>> +   pdev->num_resources)) {
> >>> +   pr_warn("Skipping %s, already in DT\n", pdev->name);
> >>> +   return -EEXIST;
> >>> +   }
> >>> +
> >>> +   board_staging_gic_fixup_resources(pdev->resource, 
> >>> pdev->num_resources);
> >>> +
> >>> +   for (i = 0; i < dev->nclocks; i++)
> >>> +   board_staging_register_clock(&dev->clocks[i]);
> >>> +
> >>> +   error = platform_device_register(pdev);
> >>> +   if (error) {
> >>> +   pr_err("Failed to register device %s (%d)\n", pdev->name,
> >>> +  error);
> >>> +   return error;
> >>> +   }
> >>> +
> >>> +   if (dev->domain)
> >>> +   __pm_genpd_name_add_device(dev->domain, &pdev->dev, NULL);
> >>
> >> Urgh, this managed to slip through my filters.
> >>
> >> It seems like we almost managed to remove all users of the
> >> "..._name_add..." APIs for genpd. If hasn't been for $subject patch.
> >> :-)
> >>
> >> Now, I realize this is already too late here, but let's try to fix
> >> this before it turns into a bigger issue.
> >>
> >> Geert, do you think it's possible to convert into using the non-named
> >> bases APIs?
> >
> > That will be difficult. This code is meant to use drivers that are not yet
> > DT-aware on DT-based systems. Hence it uses platform devices with named PM
> > domains, while the PM domains are described in DT.
> > I don't think there's another way to look up a PM domain by name, is there?
> 
> As a matter of fact there are, especially for those genpds that has
> been created through DT as in this case. The API to use is
> of_genpd_get_from_provider() to find the struct generic_pm_domain.

Thanks!

> Yes, I do realize that you need to manage the parsing of the domain
> name to make sure it's the one you want, but I would rather keep that
> "hack" in this driver than in the generic API.

OK. It turned out not to be that complex, cfr. the patch below.
For now this supports PM domains with "#power-domain-cells = <0>" only,
but of course it can be extended if the need arises.

I've also tried:

np = of_find_compatible_node(NULL, NULL, "renesas,sysc-rmobile");
np = of_find_node_by_name(np, "a4lc");

(the second step is needed because of the domain hierarchy in DT), but that
would require adding the compatible string to struct board_staging_dev,
and doesn't work if you have multiple identical power providers.

I hope you like it?

>From 5fb11904845eb929a5b3382a9d5153c151cde1cf Mon Sep 17 00:00:00 2001
From: Geert Uytterhoeven 
Date: Fri, 4 Sep 2015 16:52:33 +0200
Subject: [PATCH/RFC] staging: board: Migrate away from
 __pm_genpd_name_add_device()

The named genpd APIs are deprecated. Hence convert the board staging
code from using genpd names to DT node paths.

For now this supports PM domains with "#power-domain-cells = <0>" only.

Signed-off-by: Geert Uytterhoeven 
---
 drivers/staging/board/armadillo800eva.c |  2 +-
 drivers/staging/board/board.c   | 36 -
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/board/armadillo800eva.c 
b/drivers/staging/board/armadillo800eva.c
index 0165591a52443c46..912c96b0536def7c 100644
--- a/drivers/staging/board/armadillo800eva.c
+++ b/drivers/staging/board/armadillo800eva.c
@@ -91,7 +91,7 @@ static const struct board_staging_dev 
armadillo800eva_devices[] __initconst = {
.pdev   = &lcdc0_device,
.clocks = lcdc0_clocks,
.nclocks= ARRAY_SIZE(lcdc0_clocks),
-   .domain = "a4lc",
+   .domain = 
"/system-controller@e618/pm-domains/c5/a4lc@1"
},
 };
 
diff --git a/drivers/staging/board/board.c b/drivers/staging/board/board.c
index 29d456e29f38feac..3eb5eb8f069c236d 100644
--- a/drivers/staging/board/board.c
+++ b/drivers/staging/board/board.c
@@ -135,6 +135,40 @@ int __init board_staging_regist

Re: [staging:staging-testing 158/158] drivers/staging/wilc1000/host_interface.c:2084:13: warning: passing argument 5 of 'SendConfigPkt' makes integer from pointer without a cast

2015-09-04 Thread Greg Kroah-Hartman
On Fri, Sep 04, 2015 at 02:44:08PM +0800, kbuild test robot wrote:
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
> staging-testing
> head:   20aaa13f9b1de5756512cb1680329648406340a2
> commit: 20aaa13f9b1de5756512cb1680329648406340a2 [158/158] staging: wilc1000: 
> remove spinlock wrappers
> config: mn10300-allyesconfig (attached as .config)
> reproduce:
>   wget 
> https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
>  -O ~/bin/make.cross
>   chmod +x ~/bin/make.cross
>   git checkout 20aaa13f9b1de5756512cb1680329648406340a2
>   # save the attached .config to linux build tree
>   make.cross ARCH=mn10300 
> 
> All warnings (new ones prefixed by >>):

Oops, my fault, now fixed by marking the driver as BROKEN again.  Sorry
about that.

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


[PATCH 0/5] visornic/visorbus fixes for 4.3-final

2015-09-04 Thread Benjamin Romer
This set of patches contains fixes for bugs found in testing, and by the
kernel release bot.

Benjamin Romer (2):
  staging: unisys: stop device registration before visorbus registration
  staging: unisys: visornic: handle error return from device
registration

David Kershner (3):
  staging: unisys: unregister netdev when create debugfs fails
  staging: unisys: visornic: Fix receive bytes statistics
  staging: unisys: visorbus: Unregister driver on error

 drivers/staging/unisys/visorbus/visorbus_main.c | 13 +
 drivers/staging/unisys/visornic/visornic_main.c | 18 +++---
 2 files changed, 20 insertions(+), 11 deletions(-)

-- 
2.1.4

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


[PATCH 5/5] staging: unisys: visornic: handle error return from device registration

2015-09-04 Thread Benjamin Romer
There is no code to handle an error return in visornic, when it tries to
register with visorbus. This patch handles an error return from
visorbus_register_visor_driver() by dropping out of initialization.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visornic/visornic_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 7b08a89..9d3c1e2 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -2131,8 +2131,9 @@ static int visornic_init(void)
if (!dev_num_pool)
goto cleanup_workqueue;
 
-   visorbus_register_visor_driver(&visornic_driver);
-   return 0;
+   err = visorbus_register_visor_driver(&visornic_driver);
+   if (!err)
+   return 0;
 
 cleanup_workqueue:
if (visornic_timeout_reset_workqueue) {
-- 
2.1.4

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


[PATCH 4/5] staging: unisys: stop device registration before visorbus registration

2015-09-04 Thread Benjamin Romer
In cases where visorbus is compiled directly into the kernel, if
visorbus registration fails for any reason, it is still possible for
other drivers to call visorbus_register_visor_driver(), which could
cause an oops. Prevent this by saving the result of the call to
create_bus() in a static variable, and return an error code when the bus
hasn't been registered successfully.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 7905ea9..a272b48 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -37,6 +37,8 @@ static int visorbus_debugref;
 #define POLLJIFFIES_TESTWORK 100
 #define POLLJIFFIES_NORMALCHANNEL 10
 
+static int busreg_rc = -ENODEV; /* stores the result from bus registration */
+
 static int visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env);
 static int visorbus_match(struct device *xdev, struct device_driver *xdrv);
 static void fix_vbus_dev_info(struct visor_device *visordev);
@@ -863,6 +865,9 @@ int visorbus_register_visor_driver(struct visor_driver *drv)
 {
int rc = 0;
 
+   if (busreg_rc < 0)
+   return -ENODEV; /*can't register on a nonexistent bus*/
+
drv->driver.name = drv->name;
drv->driver.bus = &visorbus_type;
drv->driver.probe = visordriver_probe_device;
@@ -1262,10 +1267,8 @@ remove_bus_instance(struct visor_device *dev)
 static int
 create_bus_type(void)
 {
-   int rc = 0;
-
-   rc = bus_register(&visorbus_type);
-   return rc;
+   busreg_rc = bus_register(&visorbus_type);
+   return busreg_rc;
 }
 
 /** Remove the one-and-only one instance of the visor bus type (visorbus_type).
-- 
2.1.4

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


[PATCH 3/5] staging: unisys: visorbus: Unregister driver on error

2015-09-04 Thread Benjamin Romer
From: David Kershner 

If there is an error in registering driver attributes, unregister
the driver as well.

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

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 2309f5f..7905ea9 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -885,6 +885,8 @@ int visorbus_register_visor_driver(struct visor_driver *drv)
if (rc < 0)
return rc;
rc = register_driver_attributes(drv);
+   if (rc < 0)
+   driver_unregister(&drv->driver);
return rc;
 }
 EXPORT_SYMBOL_GPL(visorbus_register_visor_driver);
-- 
2.1.4

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


[PATCH 1/5] staging: unisys: unregister netdev when create debugfs fails

2015-09-04 Thread Benjamin Romer
From: David Kershner 

Noticed we were not unregistering the netdevice if we failed to
create the debugfs entries. This patch fixes that problem.

Signed-off-by: David Kershner 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visornic/visornic_main.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 8c9da7e..bacf1af 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -1924,13 +1924,16 @@ static int visornic_probe(struct visor_device *dev)
"%s debugfs_create_dir %s failed\n",
__func__, netdev->name);
err = -ENOMEM;
-   goto cleanup_xmit_cmdrsp;
+   goto cleanup_register_netdev;
}
 
dev_info(&dev->device, "%s success netdev=%s\n",
 __func__, netdev->name);
return 0;
 
+cleanup_register_netdev:
+   unregister_netdev(netdev);
+
 cleanup_napi_add:
del_timer_sync(&devdata->irq_poll_timer);
netif_napi_del(&devdata->napi);
-- 
2.1.4

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


[PATCH 2/5] staging: unisys: visornic: Fix receive bytes statistics

2015-09-04 Thread Benjamin Romer
From: David Kershner 

The receive byte statistics was wrong in /proc/net/dev.

Move the collection of statistics after the proper amount
of bytes has been calculated and make sure you add it to
rx_bytes instead of just replacing it.

Signed-off-by: David Kershner 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visornic/visornic_main.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index bacf1af..7b08a89 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -1189,16 +1189,16 @@ visornic_rx(struct uiscmdrsp *cmdrsp)
spin_lock_irqsave(&devdata->priv_lock, flags);
atomic_dec(&devdata->num_rcvbuf_in_iovm);
 
-   /* update rcv stats - call it with priv_lock held */
-   devdata->net_stats.rx_packets++;
-   devdata->net_stats.rx_bytes = skb->len;
-
/* set length to how much was ACTUALLY received -
 * NOTE: rcv_done_len includes actual length of data rcvd
 * including ethhdr
 */
skb->len = cmdrsp->net.rcv.rcv_done_len;
 
+   /* update rcv stats - call it with priv_lock held */
+   devdata->net_stats.rx_packets++;
+   devdata->net_stats.rx_bytes += skb->len;
+
/* test enabled while holding lock */
if (!(devdata->enabled && devdata->enab_dis_acked)) {
/* don't process it unless we're in enable mode and until
-- 
2.1.4

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


[PATCH] staging: unisys: documentation and TODO tweaks

2015-09-04 Thread Benjamin Romer
From: Tim Sell 

Update documentation (including TODO) to reflect the current state of
the drivers.

Signed-off-by: Tim Sell 
Signed-off-by: Benjamin Romer 
---
 .../Documentation/ABI/sysfs-platform-visorchipset  |   2 +
 drivers/staging/unisys/Documentation/overview.txt  | 458 ++---
 drivers/staging/unisys/TODO|  25 +-
 3 files changed, 332 insertions(+), 153 deletions(-)

diff --git 
a/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset 
b/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
index 28f8f12..b0498ff 100644
--- a/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
+++ b/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
@@ -1,3 +1,5 @@
+This file describes sysfs entries beneath /devices/platform/visorchipset.
+
 What:  install/error
 Date:  7/18/2014
 KernelVersion: TBD
diff --git a/drivers/staging/unisys/Documentation/overview.txt 
b/drivers/staging/unisys/Documentation/overview.txt
index 8d078e4..25f93f2 100644
--- a/drivers/staging/unisys/Documentation/overview.txt
+++ b/drivers/staging/unisys/Documentation/overview.txt
@@ -1,76 +1,282 @@
+1. Overview
+---
 
-Overview
-
-This document describes the driver set for Unisys Secure Partitioning (s-Par®).
+This document describes the driver set for Unisys Secure Partitioning
+(s-Par(R)).
 
 s-Par is firmware that provides hardware partitioning capabilities for
 splitting large-scale Intel x86 servers into multiple isolated
 partitions. s-Par provides a set of para-virtualized device drivers to
 allow guest partitions on the same server to share devices that would
-normally be unsharable; specifically, PCI network interfaces and host
-bus adapters that do not support shared access via SR-IOV. The shared
-device is owned and managed by a small, single-purpose service
-partition, which communicates with each guest partition sharing that
-device through an area of shared memory called a channel. Additional
-drivers provide support interfaces for communicating with s-Par
-services, logging and diagnostics, and accessing the Linux console
-from the s-Par user interface.
-
-The driver stack consists of a set of support modules, a set of bus
-modules, and a set of device driver modules. The support modules
-handle a number of common functions across each of the other
-drivers. The bus modules provide organization for the device driver
-modules, which provide the shared device functionality.
-
-These drivers are for the Unisys virtual PCI hardware model where the
-hypervisor need not intervene (other than normal interrupt handling)
-in the interactions between the client drivers and the virtual adapter
-firmware in the adapter service partition.
-
-Driver Descriptions
-
-Device Modules
-
-The modules in this section handle shared devices and the virtual
-buses required to support them. These modules use functions in and
-depend on the modules described in the support modules section.
-
-visorchipset
-
-The visorchipset module receives device creation and destruction
-events from the Command service partition of s-Par, as well as
-controlling registration of shared device drivers with the s-Par
-driver core. The events received are used to populate other s-Par
-modules with their assigned shared devices. Visorchipset is required
-for shared device drivers to function properly. Visorchipset also
-stores information for handling dump disk device creation during
-kdump.
-
-In operation, the visorchipset module processes device creation and
-destruction messages sent by s-Par's Command service partition through
-a channel. These messages result in creation (or destruction) of each
-virtual bus and virtual device. Each bus and device is also associated
-with a communication channel, which is used to communicate with one or
-more IO service partitions to perform device IO on behalf of the
-guest.
-
-virthba
-
-The virthba module provides access to a shared SCSI host bus adapter
-and one or more disk devices, by proxying SCSI commands between the
-guest and the service partition that owns the shared SCSI adapter,
-using a channel between the guest and the service partition. The disks
-that appear on the shared bus are defined by the s-Par configuration
-and enforced by the service partition, while the guest driver handles
-sending commands and handling responses. Each disk is shared as a
-whole to a guest. Sharing the bus adapter in this way provides
-resiliency; should the device encounter an error, only the service
+normally be unsharable, specifically:
+
+* visornic - network interface
+* visorhba - scsi disk adapter
+* visorhid - keyboard and mouse
+
+These drivers conform to the standard Linux bus/device model described
+within Documentation/driver-model/, and utilize a driver named visorbus to
+present the virtual busses involved. Drivers in the 'visor*' driver set are
+commonly referred to as "guest drivers" or "cli

Re: [PATCH] staging: unisys: documentation and TODO tweaks

2015-09-04 Thread Greg KH
On Fri, Sep 04, 2015 at 12:13:26PM -0400, Benjamin Romer wrote:
> From: Tim Sell 
> 
> Update documentation (including TODO) to reflect the current state of
> the drivers.
> 
> Signed-off-by: Tim Sell 
> Signed-off-by: Benjamin Romer 
> ---
>  .../Documentation/ABI/sysfs-platform-visorchipset  |   2 +
>  drivers/staging/unisys/Documentation/overview.txt  | 458 
> ++---
>  drivers/staging/unisys/TODO|  25 +-
>  3 files changed, 332 insertions(+), 153 deletions(-)

As this is a "v2" patch, you need to say what you changed in it from the
last one to keep people with no short-term memory (i.e. me) to know what
happened.

Please fix up and resend.

thanks,

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


Re: [PATCH 3/5] staging: wilc1000: use id value as argument

2015-09-04 Thread Greg KH
On Fri, Sep 04, 2015 at 03:01:55PM +0900, johnny.kim wrote:
> 
> 
> On 2015년 09월 04일 12:51, Greg KH wrote:
> >On Fri, Sep 04, 2015 at 12:24:29PM +0900, johnny.kim wrote:
> >>
> >>On 2015년 09월 04일 00:47, Greg KH wrote:
> >>>On Thu, Sep 03, 2015 at 04:00:08PM +0900, johnny.kim wrote:
> Hello Greg.
> 
> On 2015년 09월 03일 10:33, Greg KH wrote:
> >On Thu, Aug 20, 2015 at 04:32:52PM +0900, Tony Cho wrote:
> >>From: Johnny Kim 
> >>
> >>The driver communicates with the chipset via the address of handlers
> >>to distinguish async data frame. The SendConfigPkt function gets the
> >>pointer address indicating the handlers as the last argument, but this
> >>requires redundant typecasting and does not support the 64 bit machine.
> >>
> >>This patch adds the function which assigns ID values instead of pointer
> >>representing the driver handler to the address and then uses the ID
> >>instead of pointer as the last argument of SendConfigPkt. The driver
> >>also gets the handler's address from the ID in the data frame when it
> >>receives them.
> >>
> >I don't understand this code at all.  You are randomly adding values to
> >a list, and then assuming that you can use the index into that list for
> >some type of representation?  As this is a local list, why not just use
> >the real variables instead of having a list and dealing with them in
> >this very ackward manner?
> >
> >In other words, I don't see the need for the list at all, just use the
> >real types here, you have all the needed information (hint, if you know
> >the index, you really know the data as well...)
> >
> The value is needed to send it to chipset and to distinguish async data
> packet mutually.
> >>>What is the value, the index or some random pointer?
> >>The value of current patch substitutes the corresponding index for
> >>some random pointer(= address of device handler).
> >Ok.
> >
> The length of the data field is 4byte and the data field has been
> filled with the address of pointer so far.
> >>>So the data field can just be any random number, as long as it is
> >>>consistent?  What does the chip do with the random number?
> >>Current driver normally create a couple of network interface.
> >Multiple network interfaces for the same hardware?
> Yes. A chipset supports multiple network interface.
> >>The driver can send some commands(data frame) to the network
> >>interfaces at the same time and wait the results. Both driver and
> >>chipset need unique value to distinguish whom the interface owner
> >>of the commands is.
> >>And the value always has same value while the interface is alive.
> >But as you created the interfaces, just use a unique number for each.
> >It could be a #define, as you know how many interfaces you will create,
> >that's not a dynamic thing.  No need to keep looking up something in an
> >index and converting to a structure.
> I think your opinion is right only if the driver send some commands to
> chipset. The driver should look for the network interface corresponding
> to the #define value to know owner of data frame which received from
> chipset. Network interface structure dynamically is allocated as 'ifconfig
> up'
> command of shell. As a result, look-up table is needed.
> 
> But this patch changes it to unique index value corresponding to the 
> address
> for 64bit address machine. If real type is used as your opinion, new patch
> will have the same meaning with current code.
> >>>index now, but was using a pointer before?  That sounds like you are
> >>>changing the functionality.
> >>>
> >>>confused,
> >>There is a reserved field to distinguish the data frames in chipset.
> >>Because the field has 4byte space, this patch creates the index
> >>corresponding to the pointer and uses the index to input the identifier
> >>in the size instead of the pointer value.
> >>
> >>I'm sorry, too. It's not easy to explain it in English.
> >It's not easy to explain that in any language :)
> Thanks for your generous mind.
> >As you "know" the interfaces you create, just use a "fixed" number for
> >them, and refer to them that way.  No need to have an array and iterate
> >over the whole array every time.
> >
> >There are lots of wrapper functions and pointers in this driver that
> >need to be stripped away.  I think you will find the end result of all
> >of that work to be much simpler, and smaller.  See the patches that I
> >did for the driver this evening as an example, it removed code, and in
> >doing so, also fixed a long-time bug.  There's a lot of work to be done
> >here still...
> >
> >
> I know current driver has a lot of stripping code and is heavy . My members
> is waiting to send patches after x64bit issue is closed. And I improve this
> driver continuously.

Ok, I really think this can be solved in a "cleaner" way, but due to all
of the different layers in the code, it's hard to see how t

[PATCH v2] staging: unisys: documentation and TODO tweaks

2015-09-04 Thread Benjamin Romer
From: Tim Sell 

Update documentation (including TODO) to reflect the current state of
the drivers.

Signed-off-by: Tim Sell 
Signed-off-by: Benjamin Romer 

---

v2: resend due to patch corruption
---
 .../Documentation/ABI/sysfs-platform-visorchipset  |   2 +
 drivers/staging/unisys/Documentation/overview.txt  | 458 ++---
 drivers/staging/unisys/TODO|  25 +-
 3 files changed, 332 insertions(+), 153 deletions(-)

diff --git 
a/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset 
b/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
index 28f8f12..b0498ff 100644
--- a/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
+++ b/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
@@ -1,3 +1,5 @@
+This file describes sysfs entries beneath /devices/platform/visorchipset.
+
 What:  install/error
 Date:  7/18/2014
 KernelVersion: TBD
diff --git a/drivers/staging/unisys/Documentation/overview.txt 
b/drivers/staging/unisys/Documentation/overview.txt
index 8d078e4..25f93f2 100644
--- a/drivers/staging/unisys/Documentation/overview.txt
+++ b/drivers/staging/unisys/Documentation/overview.txt
@@ -1,76 +1,282 @@
+1. Overview
+---
 
-Overview
-
-This document describes the driver set for Unisys Secure Partitioning (s-Par®).
+This document describes the driver set for Unisys Secure Partitioning
+(s-Par(R)).
 
 s-Par is firmware that provides hardware partitioning capabilities for
 splitting large-scale Intel x86 servers into multiple isolated
 partitions. s-Par provides a set of para-virtualized device drivers to
 allow guest partitions on the same server to share devices that would
-normally be unsharable; specifically, PCI network interfaces and host
-bus adapters that do not support shared access via SR-IOV. The shared
-device is owned and managed by a small, single-purpose service
-partition, which communicates with each guest partition sharing that
-device through an area of shared memory called a channel. Additional
-drivers provide support interfaces for communicating with s-Par
-services, logging and diagnostics, and accessing the Linux console
-from the s-Par user interface.
-
-The driver stack consists of a set of support modules, a set of bus
-modules, and a set of device driver modules. The support modules
-handle a number of common functions across each of the other
-drivers. The bus modules provide organization for the device driver
-modules, which provide the shared device functionality.
-
-These drivers are for the Unisys virtual PCI hardware model where the
-hypervisor need not intervene (other than normal interrupt handling)
-in the interactions between the client drivers and the virtual adapter
-firmware in the adapter service partition.
-
-Driver Descriptions
-
-Device Modules
-
-The modules in this section handle shared devices and the virtual
-buses required to support them. These modules use functions in and
-depend on the modules described in the support modules section.
-
-visorchipset
-
-The visorchipset module receives device creation and destruction
-events from the Command service partition of s-Par, as well as
-controlling registration of shared device drivers with the s-Par
-driver core. The events received are used to populate other s-Par
-modules with their assigned shared devices. Visorchipset is required
-for shared device drivers to function properly. Visorchipset also
-stores information for handling dump disk device creation during
-kdump.
-
-In operation, the visorchipset module processes device creation and
-destruction messages sent by s-Par's Command service partition through
-a channel. These messages result in creation (or destruction) of each
-virtual bus and virtual device. Each bus and device is also associated
-with a communication channel, which is used to communicate with one or
-more IO service partitions to perform device IO on behalf of the
-guest.
-
-virthba
-
-The virthba module provides access to a shared SCSI host bus adapter
-and one or more disk devices, by proxying SCSI commands between the
-guest and the service partition that owns the shared SCSI adapter,
-using a channel between the guest and the service partition. The disks
-that appear on the shared bus are defined by the s-Par configuration
-and enforced by the service partition, while the guest driver handles
-sending commands and handling responses. Each disk is shared as a
-whole to a guest. Sharing the bus adapter in this way provides
-resiliency; should the device encounter an error, only the service
+normally be unsharable, specifically:
+
+* visornic - network interface
+* visorhba - scsi disk adapter
+* visorhid - keyboard and mouse
+
+These drivers conform to the standard Linux bus/device model described
+within Documentation/driver-model/, and utilize a driver named visorbus to
+present the virtual busses involved. Drivers in the 'visor*' driver set are
+common

Re: [PATCH 2/2] android, lmk: Reverse the order of setting TIF_MEMDIE and sending SIGKILL.

2015-09-04 Thread Greg KH
On Fri, Sep 04, 2015 at 04:05:59PM +0200, Michal Hocko wrote:
> On Wed 02-09-15 18:06:20, Greg KH wrote:
> [...]
> > And if we aren't taking patch 1/2, I guess this one isn't needed either?
> 
> Unlike the patch1 which was pretty much cosmetic this fixes a real
> issue.

Ok, then it would be great to get this in a format that I can apply it
in :)

thanks,

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


Re: [PATCH 2/2] android, lmk: Reverse the order of setting TIF_MEMDIE and sending SIGKILL.

2015-09-04 Thread Tetsuo Handa
Greg KH wrote:
> On Fri, Sep 04, 2015 at 04:05:59PM +0200, Michal Hocko wrote:
> > On Wed 02-09-15 18:06:20, Greg KH wrote:
> > [...]
> > > And if we aren't taking patch 1/2, I guess this one isn't needed either?
> > 
> > Unlike the patch1 which was pretty much cosmetic this fixes a real
> > issue.
> 
> Ok, then it would be great to get this in a format that I can apply it
> in :)

I see. Here is a minimal patch.
(Acked-by: from http://lkml.kernel.org/r/20150827084443.ge14...@dhcp22.suse.cz )

>From 118609fa25700af11791b1b7e8349f8973a9e7e4 Mon Sep 17 00:00:00 2001
From: Tetsuo Handa 
Date: Sat, 5 Sep 2015 02:58:12 +0900
Subject: [PATCH] android, lmk: Send SIGKILL before setting TIF_MEMDIE.

It was observed that setting TIF_MEMDIE before sending SIGKILL at
oom_kill_process() allows memory reserves to be depleted by allocations
which are not needed for terminating the OOM victim.

This patch reverts commit 6bc2b856bb7c ("staging: android: lowmemorykiller:
set TIF_MEMDIE before send kill sig"), for oom_kill_process() was updated
to send SIGKILL before setting TIF_MEMDIE.

Signed-off-by: Tetsuo Handa 
Acked-by: Michal Hocko 
---
 drivers/staging/android/lowmemorykiller.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/android/lowmemorykiller.c 
b/drivers/staging/android/lowmemorykiller.c
index 872bd60..569d12c 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -157,26 +157,22 @@ static unsigned long lowmem_scan(struct shrinker *s, 
struct shrink_control *sc)
}
if (selected) {
task_lock(selected);
-   if (!selected->mm) {
-   /* Already exited, cannot do mark_tsk_oom_victim() */
-   task_unlock(selected);
-   goto out;
-   }
+   send_sig(SIGKILL, selected, 0);
/*
 * FIXME: lowmemorykiller shouldn't abuse global OOM killer
 * infrastructure. There is no real reason why the selected
 * task should have access to the memory reserves.
 */
-   mark_oom_victim(selected);
+   if (selected->mm)
+   mark_oom_victim(selected);
task_unlock(selected);
lowmem_print(1, "send sigkill to %d (%s), adj %hd, size %d\n",
 selected->pid, selected->comm,
 selected_oom_score_adj, selected_tasksize);
lowmem_deathpending_timeout = jiffies + HZ;
-   send_sig(SIGKILL, selected, 0);
rem += selected_tasksize;
}
-out:
+
lowmem_print(4, "lowmem_scan %lu, %x, return %lu\n",
 sc->nr_to_scan, sc->gfp_mask, rem);
rcu_read_unlock();
-- 
1.8.3.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: emxx_udc: Remove cleanup1 label

2015-09-04 Thread Ravi Teja Darbha
The cleanup1 label does nothing but return. Better way is to return
immediately instead of using goto. Hence, removed.

Signed-off-by: Ravi Teja Darbha 
---
 drivers/staging/emxx_udc/emxx_udc.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 8cef08d..ffb8a3d 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -3284,14 +3284,14 @@ static int nbu2ss_drv_probe(struct platform_device 
*pdev)
/* USB Function Controller Interrupt */
if (status != 0) {
dev_err(udc->dev, "request_irq(USB_UDC_IRQ_1) failed\n");
-   goto cleanup1;
+   return status;
}
 
/* Driver Initialization */
status = nbu2ss_drv_contest_init(pdev, udc);
if (status < 0) {
/* Error */
-   goto cleanup1;
+   return status;
}
 
/* VBUS Interrupt */
@@ -3304,13 +3304,10 @@ static int nbu2ss_drv_probe(struct platform_device 
*pdev)
 
if (status != 0) {
dev_err(udc->dev, "request_irq(INT_VBUS) failed\n");
-   goto cleanup1;
+   return status;
}
 
return status;
-
-cleanup1:
-   return status;
 }
 
 /*-*/
-- 
1.9.1

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


[PATCH 1/3] [media] staging: lirc: remove unnecessary braces

2015-09-04 Thread Maciek Borzecki
Remove unnecessary braces where appropriate.

This removes the following checkpatch warnings:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Maciek Borzecki 
---
 drivers/staging/media/lirc/lirc_imon.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_imon.c 
b/drivers/staging/media/lirc/lirc_imon.c
index 
62ec9f70dae4cd87dcf6fb60b1dd81df3d568b19..05d47dc8ffb8a987dc65287d36096a78cd5f96cd
 100644
--- a/drivers/staging/media/lirc/lirc_imon.c
+++ b/drivers/staging/media/lirc/lirc_imon.c
@@ -785,13 +785,13 @@ static int imon_probe(struct usb_interface *interface,
}
 
driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
-   if (!driver) {
+   if (!driver)
goto free_context;
-   }
+
rbuf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL);
-   if (!rbuf) {
+   if (!rbuf)
goto free_driver;
-   }
+
if (lirc_buffer_init(rbuf, BUF_CHUNK_SIZE, BUF_SIZE)) {
dev_err(dev, "%s: lirc_buffer_init failed\n", __func__);
goto free_rbuf;
-- 
2.5.1

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


[PATCH 3/3] [media] staging: lirc: lirc_serial: use dynamic debugs

2015-09-04 Thread Maciek Borzecki
Replace custom debug macro dprintk() with pr_debug() or
dev_dbg(). Remove unused module param `debug`.

This removes the following checkpatch warning:
WARNING: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then 
dev_dbg(dev, ... then pr_debug(...  to printk(KERN_DEBUG ...
+   printk(KERN_DEBUG LIRC_DRIVER_NAME ": " \

Signed-off-by: Maciek Borzecki 
---
 drivers/staging/media/lirc/lirc_serial.c | 32 ++--
 1 file changed, 10 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_serial.c 
b/drivers/staging/media/lirc/lirc_serial.c
index 
465796a686c417f2c23716c8fcc32e9d51489eed..64a7b2fc5289b6c1c0c0cabfa865756fb92208ed
 100644
--- a/drivers/staging/media/lirc/lirc_serial.c
+++ b/drivers/staging/media/lirc/lirc_serial.c
@@ -109,17 +109,9 @@ static bool iommap;
 static int ioshift;
 static bool softcarrier = true;
 static bool share_irq;
-static bool debug;
 static int sense = -1; /* -1 = auto, 0 = active high, 1 = active low */
 static bool txsense;   /* 0 = active high, 1 = active low */
 
-#define dprintk(fmt, args...)  \
-   do {\
-   if (debug)  \
-   printk(KERN_DEBUG LIRC_DRIVER_NAME ": " \
-  fmt, ## args);   \
-   } while (0)
-
 /* forward declarations */
 static long send_pulse_irdeo(unsigned long length);
 static long send_pulse_homebrew(unsigned long length);
@@ -352,10 +344,9 @@ static int init_timing_params(unsigned int new_duty_cycle,
/* Derive pulse and space from the period */
pulse_width = period * duty_cycle / 100;
space_width = period - pulse_width;
-   dprintk("in init_timing_params, freq=%d, duty_cycle=%d, "
-   "clk/jiffy=%ld, pulse=%ld, space=%ld\n",
-   freq, duty_cycle, __this_cpu_read(cpu_info.loops_per_jiffy),
-   pulse_width, space_width);
+   pr_debug("in init_timing_params, freq=%d, duty_cycle=%d, clk/jiffy=%ld, 
pulse=%ld, space=%ld, conv_us_to_clocks=%ld\n",
+freq, duty_cycle, __this_cpu_read(cpu_info.loops_per_jiffy),
+pulse_width, space_width, conv_us_to_clocks);
return 0;
 }
 #else /* ! USE_RDTSC */
@@ -377,8 +368,8 @@ static int init_timing_params(unsigned int new_duty_cycle,
period = 256 * 100L / freq;
pulse_width = period * duty_cycle / 100;
space_width = period - pulse_width;
-   dprintk("in init_timing_params, freq=%d pulse=%ld, space=%ld\n",
-   freq, pulse_width, space_width);
+   pr_debug("in init_timing_params, freq=%d pulse=%ld, space=%ld\n",
+freq, pulse_width, space_width);
return 0;
 }
 #endif /* USE_RDTSC */
@@ -500,7 +491,7 @@ static void rbwrite(int l)
 {
if (lirc_buffer_full(&rbuf)) {
/* no new signals will be accepted */
-   dprintk("Buffer overrun\n");
+   pr_debug("Buffer overrun\n");
return;
}
lirc_buffer_write(&rbuf, (void *)&l);
@@ -790,7 +781,7 @@ static int lirc_serial_probe(struct platform_device *dev)
dev_info(&dev->dev, "Manually using active %s receiver\n",
 sense ? "low" : "high");
 
-   dprintk("Interrupt %d, port %04x obtained\n", irq, io);
+   dev_dbg(&dev->dev, "Interrupt %d, port %04x obtained\n", irq, io);
return 0;
 }
 
@@ -895,7 +886,7 @@ static long lirc_ioctl(struct file *filep, unsigned int 
cmd, unsigned long arg)
return -ENOIOCTLCMD;
 
case LIRC_SET_SEND_DUTY_CYCLE:
-   dprintk("SET_SEND_DUTY_CYCLE\n");
+   pr_debug("SET_SEND_DUTY_CYCLE\n");
if (!(hardware[type].features&LIRC_CAN_SET_SEND_DUTY_CYCLE))
return -ENOIOCTLCMD;
 
@@ -907,7 +898,7 @@ static long lirc_ioctl(struct file *filep, unsigned int 
cmd, unsigned long arg)
return init_timing_params(value, freq);
 
case LIRC_SET_SEND_CARRIER:
-   dprintk("SET_SEND_CARRIER\n");
+   pr_debug("SET_SEND_CARRIER\n");
if (!(hardware[type].features&LIRC_CAN_SET_SEND_CARRIER))
return -ENOIOCTLCMD;
 
@@ -1102,7 +1093,7 @@ static void __exit lirc_serial_exit_module(void)
 {
lirc_unregister_driver(driver.minor);
lirc_serial_exit();
-   dprintk("cleaned up module\n");
+   pr_debug("cleaned up module\n");
 }
 
 
@@ -1153,6 +1144,3 @@ MODULE_PARM_DESC(txsense, "Sense of transmitter circuit"
 
 module_param(softcarrier, bool, S_IRUGO);
 MODULE_PARM_DESC(softcarrier, "Software carrier (0 = off, 1 = on, default 
on)");
-
-module_param(debug, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(debug, "Enable debugging messages");
-- 
2.5.1

___
devel mailing list
de...@linuxdriverpr

[PATCH 2/3] [media] staging: lirc: fix indentation

2015-09-04 Thread Maciek Borzecki
Fix non-tab indentation.

This resolves the following checkpatch problem:
ERROR: code indent should use tabs where possible

Signed-off-by: Maciek Borzecki 
---
 drivers/staging/media/lirc/lirc_sasem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_sasem.c 
b/drivers/staging/media/lirc/lirc_sasem.c
index 
9e5674341abe7368e5ec228f737e4c2d766f7d80..904a4667bbb8bebe3cb43bf5201be9d533ada07a
 100644
--- a/drivers/staging/media/lirc/lirc_sasem.c
+++ b/drivers/staging/media/lirc/lirc_sasem.c
@@ -181,10 +181,10 @@ static void deregister_from_lirc(struct sasem_context 
*context)
if (retval)
dev_err(&context->dev->dev,
"%s: unable to deregister from lirc (%d)\n",
-  __func__, retval);
+   __func__, retval);
else
dev_info(&context->dev->dev,
-"Deregistered Sasem driver (minor:%d)\n", minor);
+"Deregistered Sasem driver (minor:%d)\n", minor);
 
 }
 
-- 
2.5.1

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


[PATCH 0/3] [media] staging: lirc: mostly checkpatch cleanups

2015-09-04 Thread Maciek Borzecki
A tiny patch series that addresses warnings or errors identified by
checkpatch.

The patches were first submitted to driver-devel sometime in June.
While on driver-devel, Sudip Mukherjee helped to cleanup all
issues. I'm resending the set to linux-media so that they can be
picked up for the media tree.

The first patch fixes minor warning with unnecessary brakes around
single statement block. The second fixes non-tab indentation. The
third patch does away with a custom dprintk() in favor of dev_dbg and
pr_debug().


Maciek Borzecki (3):
  [media] staging: lirc: remove unnecessary braces
  [media] staging: lirc: fix indentation
  [media] staging: lirc: lirc_serial: use dynamic debugs

 drivers/staging/media/lirc/lirc_imon.c   |  8 
 drivers/staging/media/lirc/lirc_sasem.c  |  4 ++--
 drivers/staging/media/lirc/lirc_serial.c | 32 ++--
 3 files changed, 16 insertions(+), 28 deletions(-)

-- 
2.5.1

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


Re: [PATCH 2/2] android, lmk: Reverse the order of setting TIF_MEMDIE and sending SIGKILL.

2015-09-04 Thread Greg KH
On Sat, Sep 05, 2015 at 03:06:46AM +0900, Tetsuo Handa wrote:
> Greg KH wrote:
> > On Fri, Sep 04, 2015 at 04:05:59PM +0200, Michal Hocko wrote:
> > > On Wed 02-09-15 18:06:20, Greg KH wrote:
> > > [...]
> > > > And if we aren't taking patch 1/2, I guess this one isn't needed either?
> > > 
> > > Unlike the patch1 which was pretty much cosmetic this fixes a real
> > > issue.
> > 
> > Ok, then it would be great to get this in a format that I can apply it
> > in :)
> 
> I see. Here is a minimal patch.
> (Acked-by: from 
> http://lkml.kernel.org/r/20150827084443.ge14...@dhcp22.suse.cz )
> 
> >From 118609fa25700af11791b1b7e8349f8973a9e7e4 Mon Sep 17 00:00:00 2001
> From: Tetsuo Handa 
> Date: Sat, 5 Sep 2015 02:58:12 +0900
> Subject: [PATCH] android, lmk: Send SIGKILL before setting TIF_MEMDIE.
> 
> It was observed that setting TIF_MEMDIE before sending SIGKILL at
> oom_kill_process() allows memory reserves to be depleted by allocations
> which are not needed for terminating the OOM victim.
> 
> This patch reverts commit 6bc2b856bb7c ("staging: android: lowmemorykiller:
> set TIF_MEMDIE before send kill sig"), for oom_kill_process() was updated
> to send SIGKILL before setting TIF_MEMDIE.
> 
> Signed-off-by: Tetsuo Handa 
> Acked-by: Michal Hocko 
> ---
>  drivers/staging/android/lowmemorykiller.c | 12 
>  1 file changed, 4 insertions(+), 8 deletions(-)

Please send this in a format that I can apply it in that doesn't require
me to hand-edit the email :(

thanks,

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


[PATCH v2 2/5] staging/wlan-ng : Remove duplicated defines from p80211

2015-09-04 Thread Anish Bhatt
ETH_ALEN/ETH_HLEN can be  used instead of
WLAN_ETHADDR_LEN & WLAN_ETHHDR_LEN, replace directly or
use eth_addr* functions where applicable.

Signed-off-by: Anish Bhatt 
---
 drivers/staging/wlan-ng/p80211conv.c | 50 ++--
 drivers/staging/wlan-ng/p80211conv.h |  7 ++---
 2 files changed, 27 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.c 
b/drivers/staging/wlan-ng/p80211conv.c
index 75f6524..29924b8 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -135,7 +135,7 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
/* it's 802.3, pass ether payload unchanged,  */
 
/* trim off ethernet header */
-   skb_pull(skb, WLAN_ETHHDR_LEN);
+   skb_pull(skb, ETH_HLEN);
 
/*   leave off any PAD octets.  */
skb_trim(skb, proto);
@@ -144,7 +144,7 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
/* it's DIXII, time for some conversion */
 
/* trim off ethernet header */
-   skb_pull(skb, WLAN_ETHHDR_LEN);
+   skb_pull(skb, ETH_HLEN);
 
/* tack on SNAP */
e_snap =
@@ -281,8 +281,8 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
u16 fc;
unsigned int payload_length;
unsigned int payload_offset;
-   u8 daddr[WLAN_ETHADDR_LEN];
-   u8 saddr[WLAN_ETHADDR_LEN];
+   u8 daddr[ETH_ALEN];
+   u8 saddr[ETH_ALEN];
union p80211_hdr *w_hdr;
struct wlan_ethhdr *e_hdr;
struct wlan_llc *e_llc;
@@ -298,16 +298,16 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 
ethconv,
/* setup some vars for convenience */
fc = le16_to_cpu(w_hdr->a3.fc);
if ((WLAN_GET_FC_TODS(fc) == 0) && (WLAN_GET_FC_FROMDS(fc) == 0)) {
-   memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN);
-   memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN);
+   ether_addr_copy(daddr, w_hdr->a3.a1);
+   ether_addr_copy(saddr, w_hdr->a3.a2);
} else if ((WLAN_GET_FC_TODS(fc) == 0)
&& (WLAN_GET_FC_FROMDS(fc) == 1)) {
-   memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN);
-   memcpy(saddr, w_hdr->a3.a3, WLAN_ETHADDR_LEN);
+   ether_addr_copy(daddr, w_hdr->a3.a1);
+   ether_addr_copy(saddr, w_hdr->a3.a3);
} else if ((WLAN_GET_FC_TODS(fc) == 1)
&& (WLAN_GET_FC_FROMDS(fc) == 0)) {
-   memcpy(daddr, w_hdr->a3.a3, WLAN_ETHADDR_LEN);
-   memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN);
+   ether_addr_copy(daddr, w_hdr->a3.a3);
+   ether_addr_copy(saddr, w_hdr->a3.a2);
} else {
payload_offset = WLAN_HDR_A4_LEN;
if (payload_length < WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN) {
@@ -315,8 +315,8 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
return 1;
}
payload_length -= (WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN);
-   memcpy(daddr, w_hdr->a4.a3, WLAN_ETHADDR_LEN);
-   memcpy(saddr, w_hdr->a4.a4, WLAN_ETHADDR_LEN);
+   ether_addr_copy(daddr, w_hdr->a4.a3);
+   ether_addr_copy(saddr, w_hdr->a4.a4);
}
 
/* perform de-wep if necessary.. */
@@ -360,16 +360,16 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 
ethconv,
/* Test for the various encodings */
if ((payload_length >= sizeof(struct wlan_ethhdr)) &&
(e_llc->dsap != 0xaa || e_llc->ssap != 0xaa) &&
-   ((memcmp(daddr, e_hdr->daddr, WLAN_ETHADDR_LEN) == 0) ||
-(memcmp(saddr, e_hdr->saddr, WLAN_ETHADDR_LEN) == 0))) {
+   ((!ether_addr_equal_unaligned(daddr, e_hdr->daddr)) ||
+(!ether_addr_equal_unaligned(saddr, e_hdr->saddr {
pr_debug("802.3 ENCAP len: %d\n", payload_length);
/* 802.3 Encapsulated */
/* Test for an overlength frame */
-   if (payload_length > (netdev->mtu + WLAN_ETHHDR_LEN)) {
+   if (payload_length > (netdev->mtu + ETH_HLEN)) {
/* A bogus length ethfrm has been encap'd. */
/* Is someone trying an oflow attack? */
netdev_err(netdev, "ENCAP frame too large (%d > %d)\n",
-  payload_length, netdev->mtu + WLAN_ETHHDR_LEN);
+  payload_length, netdev->mtu + ETH_HLEN);
return 1;
}
 
@@ -406,9 +406,9 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
skb_pull(skb, payload_offset);
 
/* create 802.3 header at beginning of skb. */
-   

[PATCH v2 0/5] Minor fixes for wlan-ng/rtl/wilc100 drivers

2015-09-04 Thread Anish Bhatt
Patchset covers checkpatch recommendations and code cleanup of
multiple duplicate or unncessary cpp defines.

v2 : Rebase on top for staging-testing instead of master
 Silence build warnings 

Anish Bhatt (5):
  staging/wlan-ng : Prefer ether_addr* functions over mem*
  staging/wlan-ng : Remove duplicated defines from p80211
  staging/rtl* Remove unused macro definitions.
  staging/rtl* Remove duplicated BIT() definitions
  staging/wilc100 : Use BIT() macro where possible

 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c |  7 ++-
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c|  6 +-
 drivers/staging/rtl8188eu/include/rtl8188e_spec.h |  4 --
 drivers/staging/rtl8188eu/include/wifi.h  | 12 
 drivers/staging/rtl8712/osdep_service.h   |  4 --
 drivers/staging/rtl8712/wifi.h|  9 ---
 drivers/staging/wilc1000/wilc_wlan.c  | 72 +++
 drivers/staging/wlan-ng/p80211conv.c  | 72 +++
 drivers/staging/wlan-ng/p80211conv.h  |  7 +--
 drivers/staging/wlan-ng/p80211netdev.c|  2 +-
 drivers/staging/wlan-ng/prism2sta.c   | 16 ++---
 11 files changed, 92 insertions(+), 119 deletions(-)

-- 
2.5.1

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


[PATCH v2 4/5] staging/rtl* Remove duplicated BIT() definitions

2015-09-04 Thread Anish Bhatt
The BIT() macro is already defined in bitops.h,
remove duplicate definitions. Fix any resultant build or
checkpatch warnings.

Signed-off-by: Anish Bhatt 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 7 +--
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c| 6 --
 drivers/staging/rtl8188eu/include/rtl8188e_spec.h | 4 
 drivers/staging/rtl8188eu/include/wifi.h  | 7 ---
 drivers/staging/rtl8712/osdep_service.h   | 4 
 drivers/staging/rtl8712/wifi.h| 5 -
 6 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 5dae7de..dd82018 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -4177,10 +4177,13 @@ void mgt_dispatcher(struct adapter *padapter, struct 
recv_frame *precv_frame)
 
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
 ("+mgt_dispatcher: type(0x%x) subtype(0x%x)\n",
- GetFrameType(pframe), GetFrameSubType(pframe)));
+ (unsigned int)GetFrameType(pframe),
+ (unsigned int)GetFrameSubType(pframe)));
 
if (GetFrameType(pframe) != WIFI_MGT_TYPE) {
-   RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("mgt_dispatcher: 
type(0x%x) error!\n", GetFrameType(pframe)));
+   RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_,
+("mgt_dispatcher: type(0x%x) error!\n",
+ (unsigned int)GetFrameType(pframe)));
return;
}
 
diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c 
b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 077b39a..3bb40a7fe 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -1414,13 +1414,15 @@ void update_IOT_info(struct adapter *padapter)
pmlmeinfo->turboMode_cts2self = 0;
pmlmeinfo->turboMode_rtsen = 1;
/* disable high power */
-   Switch_DM_Func(padapter, (~DYNAMIC_BB_DYNAMIC_TXPWR), false);
+   Switch_DM_Func(padapter, (u32)(~DYNAMIC_BB_DYNAMIC_TXPWR),
+  false);
break;
case HT_IOT_PEER_REALTEK:
/* rtw_write16(padapter, 0x4cc, 0x); */
/* rtw_write16(padapter, 0x546, 0x01c0); */
/* disable high power */
-   Switch_DM_Func(padapter, (~DYNAMIC_BB_DYNAMIC_TXPWR), false);
+   Switch_DM_Func(padapter, (u32)(~DYNAMIC_BB_DYNAMIC_TXPWR),
+  false);
break;
default:
pmlmeinfo->turboMode_cts2self = 0;
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_spec.h 
b/drivers/staging/rtl8188eu/include/rtl8188e_spec.h
index 2c33eb3..e99179a 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_spec.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_spec.h
@@ -19,10 +19,6 @@
 #ifndef __RTL8188E_SPEC_H__
 #define __RTL8188E_SPEC_H__
 
-#ifndef BIT
-#define BIT(x) (1 << (x))
-#endif
-
 #define BIT0   0x0001
 #define BIT1   0x0002
 #define BIT2   0x0004
diff --git a/drivers/staging/rtl8188eu/include/wifi.h 
b/drivers/staging/rtl8188eu/include/wifi.h
index 6e5fa73..6cb5bec 100644
--- a/drivers/staging/rtl8188eu/include/wifi.h
+++ b/drivers/staging/rtl8188eu/include/wifi.h
@@ -20,13 +20,6 @@
 #ifndef _WIFI_H_
 #define _WIFI_H_
 
-
-#ifdef BIT
-/* error   "BIT define occurred earlier elsewhere!\n" */
-#undef BIT
-#endif
-#define BIT(x) (1 << (x))
-
 #define WLAN_IEEE_OUI_LEN  3
 #define WLAN_CRC_LEN   4
 #define WLAN_BSSID_LEN 6
diff --git a/drivers/staging/rtl8712/osdep_service.h 
b/drivers/staging/rtl8712/osdep_service.h
index 0a7f58c..076d508 100644
--- a/drivers/staging/rtl8712/osdep_service.h
+++ b/drivers/staging/rtl8712/osdep_service.h
@@ -60,10 +60,6 @@ struct   __queue {
 #define LIST_CONTAINOR(ptr, type, member) \
((type *)((char *)(ptr)-(SIZE_T)(&((type *)0)->member)))
 
-#ifndef BIT
-   #define BIT(x)  (1 << (x))
-#endif
-
 static inline u32 _down_sema(struct semaphore *sema)
 {
if (down_interruptible(sema))
diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index 67c6ebf..7a352c4 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -28,11 +28,6 @@
 
 #include 
 
-#ifdef BIT
-#undef BIT
-#endif
-#define BIT(x) (1 << (x))
-
 #define WLAN_IEEE_OUI_LEN  3
 #define WLAN_CRC_LEN   4
 #define WLAN_BSSID_LEN 6
-- 
2.5.1

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


[PATCH v2 1/5] staging/wlan-ng : Prefer ether_addr* functions over mem*

2015-09-04 Thread Anish Bhatt
Replace memcmp/memcpy(... ETH_ALEN) with ether_addr_copy()/
ether_addr_equal_unaligned()

Signed-off-by: Anish Bhatt 
---
 drivers/staging/wlan-ng/p80211conv.c   | 22 +++---
 drivers/staging/wlan-ng/p80211netdev.c |  2 +-
 drivers/staging/wlan-ng/prism2sta.c| 16 +---
 3 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.c 
b/drivers/staging/wlan-ng/p80211conv.c
index 49f2ef8..75f6524 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -178,21 +178,21 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 
ethconv,
 
switch (wlandev->macmode) {
case WLAN_MACMODE_IBSS_STA:
-   memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a3, wlandev->bssid, ETH_ALEN);
+   ether_addr_copy(p80211_hdr->a3.a1, e_hdr.daddr);
+   ether_addr_copy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr);
+   ether_addr_copy(p80211_hdr->a3.a3, wlandev->bssid);
break;
case WLAN_MACMODE_ESS_STA:
fc |= cpu_to_le16(WLAN_SET_FC_TODS(1));
-   memcpy(p80211_hdr->a3.a1, wlandev->bssid, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a3, &e_hdr.daddr, ETH_ALEN);
+   ether_addr_copy(p80211_hdr->a3.a1, wlandev->bssid);
+   ether_addr_copy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr);
+   ether_addr_copy(p80211_hdr->a3.a3, e_hdr.daddr);
break;
case WLAN_MACMODE_ESS_AP:
fc |= cpu_to_le16(WLAN_SET_FC_FROMDS(1));
-   memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a2, wlandev->bssid, ETH_ALEN);
-   memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, ETH_ALEN);
+   ether_addr_copy(p80211_hdr->a3.a1, e_hdr.daddr);
+   ether_addr_copy(p80211_hdr->a3.a2, wlandev->bssid);
+   ether_addr_copy(p80211_hdr->a3.a3, e_hdr.saddr);
break;
default:
netdev_err(wlandev->netdev,
@@ -242,8 +242,8 @@ static void orinoco_spy_gather(wlandevice_t *wlandev, char 
*mac,
 
for (i = 0; i < wlandev->spy_number; i++) {
 
-   if (!memcmp(wlandev->spy_address[i], mac, ETH_ALEN)) {
-   memcpy(wlandev->spy_address[i], mac, ETH_ALEN);
+   if (!ether_addr_equal_unaligned(wlandev->spy_address[i], mac)) {
+   ether_addr_copy(wlandev->spy_address[i], mac);
wlandev->spy_stat[i].level = rxmeta->signal;
wlandev->spy_stat[i].noise = rxmeta->noise;
wlandev->spy_stat[i].qual =
diff --git a/drivers/staging/wlan-ng/p80211netdev.c 
b/drivers/staging/wlan-ng/p80211netdev.c
index a9c1e0b..a1bb726 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -644,7 +644,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, 
void *addr)
macaddr->status = P80211ENUM_msgitem_status_data_ok;
macaddr->len = sizeof(macaddr->data);
macaddr->data.len = ETH_ALEN;
-   memcpy(&macaddr->data.data, new_addr->sa_data, ETH_ALEN);
+   ether_addr_copy(macaddr->data.data, new_addr->sa_data);
 
/* Set up the resultcode argument */
resultcode->did = DIDmsg_dot11req_mibset_resultcode;
diff --git a/drivers/staging/wlan-ng/prism2sta.c 
b/drivers/staging/wlan-ng/prism2sta.c
index 0329c52..3085563 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -1483,7 +1483,8 @@ static void prism2sta_inf_assocstatus(wlandevice_t 
*wlandev,
 */
 
for (i = 0; i < hw->authlist.cnt; i++)
-   if (memcmp(rec.sta_addr, hw->authlist.addr[i], ETH_ALEN) == 0)
+   if (!ether_addr_equal_unaligned(rec.sta_addr,
+   hw->authlist.addr[i]))
break;
 
if (i >= hw->authlist.cnt) {
@@ -1565,8 +1566,9 @@ static void prism2sta_inf_authreq_defer(wlandevice_t 
*wlandev,
 */
 
for (i = 0; i < hw->authlist.cnt; i++)
-   if (memcmp(rec.address, hw->authlist.addr[i],
-  ETH_ALEN) == 0) {
+   if (!ether_addr_equal_unaligned(rec.address,
+   hw->authlist.addr[i])
+  ) {
rec.status = P80211ENUM_status_successful;
break;
}
@@ -1603,7 +1605,7 @@ static void prism2sta_inf_authreq_defer(wlandevice_t 
*wlandev,
}
 
for (i = 0; i < cnt; i++, addr += ETH_ALEN)

[PATCH v2 3/5] staging/rtl* Remove unused macro definitions.

2015-09-04 Thread Anish Bhatt
WLAN_ETHHDR_LEN/WLAN_ETHADDR_LEN/WLAN_ADDR_LEN
 are unused, duplicate or unnecessary, remove.

Signed-off-by: Anish Bhatt 
---
 drivers/staging/rtl8188eu/include/wifi.h | 5 -
 drivers/staging/rtl8712/wifi.h   | 4 
 2 files changed, 9 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/wifi.h 
b/drivers/staging/rtl8188eu/include/wifi.h
index dba8af1..6e5fa73 100644
--- a/drivers/staging/rtl8188eu/include/wifi.h
+++ b/drivers/staging/rtl8188eu/include/wifi.h
@@ -27,11 +27,7 @@
 #endif
 #define BIT(x) (1 << (x))
 
-
-#define WLAN_ETHHDR_LEN14
-#define WLAN_ETHADDR_LEN   6
 #define WLAN_IEEE_OUI_LEN  3
-#define WLAN_ADDR_LEN  6
 #define WLAN_CRC_LEN   4
 #define WLAN_BSSID_LEN 6
 #define WLAN_BSS_TS_LEN8
@@ -47,7 +43,6 @@
 
 #define WLAN_MIN_ETHFRM_LEN60
 #define WLAN_MAX_ETHFRM_LEN1514
-#define WLAN_ETHHDR_LEN14
 
 #define P80211CAPTURE_VERSION  0x80211001
 
diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index 17f5131..67c6ebf 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -33,10 +33,7 @@
 #endif
 #define BIT(x) (1 << (x))
 
-#define WLAN_ETHHDR_LEN14
-#define WLAN_ETHADDR_LEN   6
 #define WLAN_IEEE_OUI_LEN  3
-#define WLAN_ADDR_LEN  6
 #define WLAN_CRC_LEN   4
 #define WLAN_BSSID_LEN 6
 #define WLAN_BSS_TS_LEN8
@@ -52,7 +49,6 @@
 
 #define WLAN_MIN_ETHFRM_LEN60
 #define WLAN_MAX_ETHFRM_LEN1514
-#define WLAN_ETHHDR_LEN14
 
 #define P80211CAPTURE_VERSION  0x80211001
 
-- 
2.5.1

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


[PATCH v2 5/5] staging/wilc100 : Use BIT() macro where possible

2015-09-04 Thread Anish Bhatt
Replace (1 << x) by BIT(x) as recommended by
checkpatch.pl. Fix any resultant build warnings.

Signed-off-by: Anish Bhatt 
---
 drivers/staging/wilc1000/wilc_wlan.c | 72 ++--
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 4b37de5..7397aa2 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -305,9 +305,6 @@ typedef struct {
 struct Ack_session_info *Free_head;
 struct Ack_session_info *Alloc_head;
 
-#define TCP_FIN_MASK   (1 << 0)
-#define TCP_SYN_MASK   (1 << 1)
-#define TCP_Ack_MASK   (1 << 4)
 #define NOT_TCP_ACK(-1)
 
 #define MAX_TCP_SESSION25
@@ -713,7 +710,7 @@ INLINE void chip_allow_sleep(void)
/* Clear bit 1 */
g_wlan.hif_func.hif_read_reg(0xf0, ®);
 
-   g_wlan.hif_func.hif_write_reg(0xf0, reg & ~(1 << 0));
+   g_wlan.hif_func.hif_write_reg(0xf0, reg & ~BIT(0));
 }
 
 INLINE void chip_wakeup(void)
@@ -725,10 +722,10 @@ INLINE void chip_wakeup(void)
do {
g_wlan.hif_func.hif_read_reg(1, ®);
/* Set bit 1 */
-   g_wlan.hif_func.hif_write_reg(1, reg | (1 << 1));
+   g_wlan.hif_func.hif_write_reg(1, reg | BIT(1));
 
/* Clear bit 1*/
-   g_wlan.hif_func.hif_write_reg(1, reg & ~(1 << 1));
+   g_wlan.hif_func.hif_write_reg(1, reg & ~BIT(1));
 
do {
/* Wait for the chip to stabilize*/
@@ -745,7 +742,7 @@ INLINE void chip_wakeup(void)
g_wlan.hif_func.hif_read_reg(0xf0, ®);
do {
/* Set bit 1 */
-   g_wlan.hif_func.hif_write_reg(0xf0, reg | (1 << 0));
+   g_wlan.hif_func.hif_write_reg(0xf0, reg | BIT(0));
 
/* Check the clock status */
g_wlan.hif_func.hif_read_reg(0xf1, &clk_status_reg);
@@ -768,7 +765,8 @@ INLINE void chip_wakeup(void)
/* in case of failure, Reset the wakeup bit to 
introduce a new edge on the next loop */
if ((clk_status_reg & 0x1) == 0) {
/* Reset bit 0 */
-   g_wlan.hif_func.hif_write_reg(0xf0, reg & (~(1 
<< 0)));
+   g_wlan.hif_func.hif_write_reg(0xf0, reg &
+ (~BIT(0)));
}
} while ((clk_status_reg & 0x1) == 0);
}
@@ -776,7 +774,7 @@ INLINE void chip_wakeup(void)
 
if (genuChipPSstate == CHIP_SLEEPING_MANUAL) {
g_wlan.hif_func.hif_read_reg(0x1C0C, ®);
-   reg &= ~(1 << 0);
+   reg &= ~BIT(0);
g_wlan.hif_func.hif_write_reg(0x1C0C, reg);
 
if (wilc_get_chipid(false) >= 0x1002b0) {
@@ -784,11 +782,11 @@ INLINE void chip_wakeup(void)
uint32_t val32;
 
g_wlan.hif_func.hif_read_reg(0x1e1c, &val32);
-   val32 |= (1 << 6);
+   val32 |= (uint32_t)BIT(6);
g_wlan.hif_func.hif_write_reg(0x1e1c, val32);
 
g_wlan.hif_func.hif_read_reg(0x1e9c, &val32);
-   val32 |= (1 << 6);
+   val32 |= (uint32_t)BIT(6);
g_wlan.hif_func.hif_write_reg(0x1e9c, val32);
}
}
@@ -803,19 +801,19 @@ INLINE void chip_wakeup(void)
if ((g_wlan.io_func.io_type & 0x1) == HIF_SPI) {
g_wlan.hif_func.hif_read_reg(1, ®);
/* Make sure bit 1 is 0 before we start. */
-   g_wlan.hif_func.hif_write_reg(1, reg & ~(1 << 1));
+   g_wlan.hif_func.hif_write_reg(1, reg & ~BIT(1));
/* Set bit 1 */
-   g_wlan.hif_func.hif_write_reg(1, reg | (1 << 1));
+   g_wlan.hif_func.hif_write_reg(1, reg | BIT(1));
/* Clear bit 1*/
-   g_wlan.hif_func.hif_write_reg(1, reg  & ~(1 << 1));
+   g_wlan.hif_func.hif_write_reg(1, reg  & ~BIT(1));
} else if ((g_wlan.io_func.io_type & 0x1) == HIF_SDIO)   {
/* Make sure bit 0 is 0 before we start. */
g_wlan.hif_func.hif_read_reg(0xf0, ®);
-   g_wlan.hif_func.hif_write_reg(0xf0, reg & ~(1 << 0));
+   g_wlan.hif_func.hif_write_reg(0xf0, reg & ~BIT(0));
/* Set bit 1 */
-   g_wlan.hif_func.hif_write_reg(0xf0, reg | (1 << 0));
+   g_wlan.hif_func.hif_write_reg(0xf0, reg | BIT(0

[PATCH] Staging: rtl18192u: fix style issues in ieee80211_softmac_wx.c

2015-09-04 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that corrects several
 checkpatch.pl warnings and errors.
Signed-off-by: Mike Dupuis 

---
 .../rtl8192u/ieee80211/ieee80211_softmac_wx.c  |  114 ++--
 1 file changed, 54 insertions(+), 60 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 3e502520..a8acd17 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -28,11 +28,11 @@ const long ieee80211_wlan_frequencies[] = {
 };
 EXPORT_SYMBOL(ieee80211_wlan_frequencies);
 
-int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct 
iw_request_info *a,
-union iwreq_data *wrqu, char *b)
+int ieee80211_wx_set_freq(struct ieee80211_device *ieee,
+   struct iw_request_info *a, union iwreq_data *wrqu, char *b)
 {
int ret;
-   struct iw_freq *fwrq = & wrqu->freq;
+   struct iw_freq *fwrq = &wrqu->freq;
 
down(&ieee->wx_sem);
 
@@ -57,11 +57,11 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
}
}
 
-   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1 ){
+   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1) {
ret = -EOPNOTSUPP;
goto out;
 
-   }else { /* Set the channel */
+   } else { /* Set the channel */
 
if (!(GET_DOT11D_INFO(ieee)->channel_map)[fwrq->m]) {
ret = -EINVAL;
@@ -70,11 +70,10 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
ieee->current_network.channel = fwrq->m;
ieee->set_chan(ieee->dev, ieee->current_network.channel);
 
-   if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
-   if(ieee->state == IEEE80211_LINKED){
-
-   ieee80211_stop_send_beacons(ieee);
-   ieee80211_start_send_beacons(ieee);
+   if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
+   if (ieee->state == IEEE80211_LINKED) {
+   ieee80211_stop_send_beacons(ieee);
+   ieee80211_start_send_beacons(ieee);
}
}
 
@@ -89,15 +88,15 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee,
 struct iw_request_info *a,
 union iwreq_data *wrqu, char *b)
 {
-   struct iw_freq *fwrq = & wrqu->freq;
+   struct iw_freq *fwrq = &wrqu->freq;
 
if (ieee->current_network.channel == 0)
return -1;
-   //NM 0.7.0 will not accept channel any more.
+   /* NM 0.7.0 will not accept channel any more. */
fwrq->m = ieee80211_wlan_frequencies[ieee->current_network.channel-1] * 
10;
fwrq->e = 1;
-// fwrq->m = ieee->current_network.channel;
-// fwrq->e = 0;
+/* fwrq->m = ieee->current_network.channel; */
+/* fwrq->e = 0; */
 
return 0;
 }
@@ -141,7 +140,7 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
int ret = 0;
unsigned long flags;
 
-   short ifup = ieee->proto_started;//dev->flags & IFF_UP;
+   short ifup = ieee->proto_started; /* dev->flags & IFF_UP; */
struct sockaddr *temp = (struct sockaddr *)awrq;
 
ieee->sync_scan_hurryup = 1;
@@ -179,7 +178,8 @@ out:
 }
 EXPORT_SYMBOL(ieee80211_wx_set_wap);
 
- int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,union iwreq_data *wrqu,char *b)
+int ieee80211_wx_get_essid(struct ieee80211_device *ieee,
+   struct iw_request_info *a, union iwreq_data *wrqu, char *b)
 {
int len, ret = 0;
unsigned long flags;
@@ -223,7 +223,7 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee,
u32 target_rate = wrqu->bitrate.value;
 
ieee->rate = target_rate/10;
-   //FIXME: we might want to limit rate also in management protocols.
+   /* FIXME: we might want to limit rate also in management protocols. */
return 0;
 }
 EXPORT_SYMBOL(ieee80211_wx_set_rate);
@@ -233,6 +233,7 @@ int ieee80211_wx_get_rate(struct ieee80211_device *ieee,
 union iwreq_data *wrqu, char *extra)
 {
u32 tmp_rate;
+
tmp_rate = TxCountToDataRate(ieee, 
ieee->softmac_stats.CurrentShowTxate);
 
wrqu->bitrate.value = tmp_rate * 50;
@@ -247,8 +248,7 @@ int ieee80211_wx_set_rts(struct ieee80211_device *ieee,
 {
if (wrqu->rts.disabled || !wrqu->rts.fixed)
ieee->rts = DEFAULT_RTS_THRESHOLD;
-   else
-   {
+   else {
if (wrqu->rts.value < MIN_RTS_THRESHOLD ||
wrqu->rts.value > MAX_RTS_THRESHOLD)
return -EINVAL;
@@ -269,

Re: [PATCH] Staging: rtl18192u: fix style issues in ieee80211_softmac_wx.c

2015-09-04 Thread Greg KH
On Fri, Sep 04, 2015 at 11:00:06PM +, Mike Dupuis wrote:
> This is a patch to the ieee80211_softmac_wx.c file that corrects several
>  checkpatch.pl warnings and errors.
> Signed-off-by: Mike Dupuis 

You need a blank line before the signed-off-by line.

Also, please break this up into multiple patches, each one only doing
one type of cleanup.  As it is, I can't take it, sorry.

thanks,

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