[PATCH] staging: wlan-ng: use pr_err() instead of KERN_ERR

2014-04-13 Thread Vitaly Osipov
All files in drivers/staging/wlan-ng updated to use pr_err

Signed-off-by: Vitaly Osipov 
---
 drivers/staging/wlan-ng/p80211conv.c   |   24 +--
 drivers/staging/wlan-ng/p80211netdev.c |7 ++-
 drivers/staging/wlan-ng/p80211req.c|3 +-
 drivers/staging/wlan-ng/prism2fw.c |   65 +++-
 drivers/staging/wlan-ng/prism2mgmt.c   |   74 +---
 drivers/staging/wlan-ng/prism2mib.c|2 +-
 6 files changed, 70 insertions(+), 105 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211conv.c 
b/drivers/staging/wlan-ng/p80211conv.c
index 3df753b..7e6c7b6 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -195,8 +195,7 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, ETH_ALEN);
break;
default:
-   printk(KERN_ERR
-  "Error: Converting eth to wlan in unknown mode.\n");
+   pr_err("Error: Converting eth to wlan in unknown mode.\n");
return 1;
break;
}
@@ -310,7 +309,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
} else {
payload_offset = WLAN_HDR_A4_LEN;
if (payload_length < WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN) {
-   printk(KERN_ERR "A4 frame too short!\n");
+   pr_err("A4 frame too short!\n");
return 1;
}
payload_length -= (WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN);
@@ -322,8 +321,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) && WLAN_GET_FC_ISWEP(fc)
&& (wlandev->hostwep & HOSTWEP_DECRYPT)) {
if (payload_length <= 8) {
-   printk(KERN_ERR "WEP frame too short (%u).\n",
-  skb->len);
+   pr_err("WEP frame too short (%u).\n", skb->len);
return 1;
}
foo = wep_decrypt(wlandev, skb->data + payload_offset + 4,
@@ -367,7 +365,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
if (payload_length > (netdev->mtu + WLAN_ETHHDR_LEN)) {
/* A bogus length ethfrm has been encap'd. */
/* Is someone trying an oflow attack? */
-   printk(KERN_ERR "ENCAP frame too large (%d > %d)\n",
+   pr_err("ENCAP frame too large (%d > %d)\n",
   payload_length, netdev->mtu + WLAN_ETHHDR_LEN);
return 1;
}
@@ -396,7 +394,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
if (payload_length > netdev->mtu) {
/* A bogus length ethfrm has been sent. */
/* Is someone trying an oflow attack? */
-   printk(KERN_ERR "SNAP frame too large (%d > %d)\n",
+   pr_err("SNAP frame too large (%d > %d)\n",
   payload_length, netdev->mtu);
return 1;
}
@@ -428,7 +426,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
> netdev->mtu) {
/* A bogus length ethfrm has been sent. */
/* Is someone trying an oflow attack? */
-   printk(KERN_ERR "DIXII frame too large (%ld > %d)\n",
+   pr_err("DIXII frame too large (%ld > %d)\n",
   (long int)(payload_length -
sizeof(struct wlan_llc) -
sizeof(struct wlan_snap)), netdev->mtu);
@@ -463,7 +461,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
if (payload_length > netdev->mtu) {
/* A bogus length ethfrm has been sent. */
/* Is someone trying an oflow attack? */
-   printk(KERN_ERR "OTHER frame too large (%d > %d)\n",
+   pr_err("OTHER frame too large (%d > %d)\n",
   payload_length, netdev->mtu);
return 1;
}
@@ -603,8 +601,7 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, 
struct sk_buff *skb)
 
/* If these already have metadata, we error out! */
if (P80211SKB_RXMETA(skb) != NULL) {
-   printk(KERN_ERR "%s: RXmeta already attached!\n",
-  wlandev->name);
+   pr_err("%s: RXmeta already attached!\n", wlandev->name);
result = 0;
goto exit;
}
@@ -613,8 +610,7 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, 
struct sk_buff *skb)
rxmeta = kzalloc(sizeof(struct p80211_rxmeta)

Re: [PATCH] [media] Prefer gspca_sonixb over sn9c102 for all devices

2014-04-13 Thread Hans de Goede
Hi,

On 04/11/2014 09:15 AM, Jean Delvare wrote:
> The sn9c102 driver is deprecated. It was moved to staging in
> anticipation of its removal in a future kernel version. However, USB
> devices 0C45:6024 and 0C45:6025 are still handled by sn9c102 when
> both sn9c102 and gspca_sonixb are enabled.
> 
> We must migrate all the users of these devices to the gspca_sonixb
> driver now, so that it gets sufficient testing before the sn9c102
> driver is finally phased out.
> 
> Signed-off-by: Jean Delvare 
> Cc: Hans de Goede 
> Cc: Mauro Carvalho Chehab 
> Cc: Luca Risolia 
> Cc: Greg Kroah-Hartman 
> ---
> I consider this a bug fix, I believe it should go upstream ASAP.

Agreed:

Acked-by: Hans de Goede 

Mauro, can you pick this up directly, or do you want a pull-req from me
for this?

Regards,

Hans


> 
>  drivers/media/usb/gspca/sonixb.c |2 --
>  drivers/staging/media/sn9c102/sn9c102_devtable.h |2 --
>  2 files changed, 4 deletions(-)
> 
> --- linux-3.15-rc0.orig/drivers/media/usb/gspca/sonixb.c  2014-04-11 
> 08:57:26.932408285 +0200
> +++ linux-3.15-rc0/drivers/media/usb/gspca/sonixb.c   2014-04-11 
> 09:02:32.151943578 +0200
> @@ -1430,10 +1430,8 @@ static const struct usb_device_id device
>   {USB_DEVICE(0x0c45, 0x600d), SB(PAS106, 101)},
>   {USB_DEVICE(0x0c45, 0x6011), SB(OV6650, 101)},
>   {USB_DEVICE(0x0c45, 0x6019), SB(OV7630, 101)},
> -#if !IS_ENABLED(CONFIG_USB_SN9C102)
>   {USB_DEVICE(0x0c45, 0x6024), SB(TAS5130CXX, 102)},
>   {USB_DEVICE(0x0c45, 0x6025), SB(TAS5130CXX, 102)},
> -#endif
>   {USB_DEVICE(0x0c45, 0x6027), SB(OV7630, 101)}, /* Genius Eye 310 */
>   {USB_DEVICE(0x0c45, 0x6028), SB(PAS202, 102)},
>   {USB_DEVICE(0x0c45, 0x6029), SB(PAS106, 102)},
> --- linux-3.15-rc0.orig/drivers/staging/media/sn9c102/sn9c102_devtable.h  
> 2014-04-11 08:57:26.932408285 +0200
> +++ linux-3.15-rc0/drivers/staging/media/sn9c102/sn9c102_devtable.h   
> 2014-04-11 09:02:32.151943578 +0200
> @@ -48,10 +48,8 @@ static const struct usb_device_id sn9c10
>   { SN9C102_USB_DEVICE(0x0c45, 0x600d, BRIDGE_SN9C102), },
>  /*   { SN9C102_USB_DEVICE(0x0c45, 0x6011, BRIDGE_SN9C102), }, OV6650 */
>   { SN9C102_USB_DEVICE(0x0c45, 0x6019, BRIDGE_SN9C102), },
> -#endif
>   { SN9C102_USB_DEVICE(0x0c45, 0x6024, BRIDGE_SN9C102), },
>   { SN9C102_USB_DEVICE(0x0c45, 0x6025, BRIDGE_SN9C102), },
> -#if !defined CONFIG_USB_GSPCA_SONIXB && !defined 
> CONFIG_USB_GSPCA_SONIXB_MODULE
>   { SN9C102_USB_DEVICE(0x0c45, 0x6028, BRIDGE_SN9C102), },
>   { SN9C102_USB_DEVICE(0x0c45, 0x6029, BRIDGE_SN9C102), },
>   { SN9C102_USB_DEVICE(0x0c45, 0x602a, BRIDGE_SN9C102), },
> 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/4] staging: imx-hdmi: correct connector detect and hotplug

2014-04-13 Thread Russell King - ARM Linux
On Fri, Apr 11, 2014 at 04:13:33PM +0200, Lucas Stach wrote:
> Make sure that we probe for a display on detect regardless
> of previous hotplug events. Don't handle connector
> hotplug state ourselves, but let DRM do the right thing
> for us. This brings our hotplug handling in line with
> what other DRM drivers do.

Why should working setups have to pay the price for faulty setups when we
can adequately detect the hotplug signal on iMX SoCs when it's correctly
wired?

By "price" I mean - if we end up having to poll the connector, we end up
calling the i2c functions, and the i2c functions on iMX use a fixed
timeout of 100ms.  That means the context which runs the
imx_hdmi_connector_detect() function is forced to sleep for 100ms.  If
that's being run as part of a softirq (eg, via a work struct), that's
bad news because that could be any thread in the system.

The "price" should only be paid by those implementations where the hotplug
signal is not correctly wired.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/4] staging: imx-hdmi: clear all hotplug IRQs on bind

2014-04-13 Thread Russell King - ARM Linux
On Fri, Apr 11, 2014 at 04:13:34PM +0200, Lucas Stach wrote:
> Makes sure we don't receive a stray IRQ on startup.
> 
> Signed-off-by: Lucas Stach 
> ---
>  drivers/staging/imx-drm/imx-hdmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/imx-drm/imx-hdmi.c 
> b/drivers/staging/imx-drm/imx-hdmi.c
> index 22cfdfc5ef74..7d407e917786 100644
> --- a/drivers/staging/imx-drm/imx-hdmi.c
> +++ b/drivers/staging/imx-drm/imx-hdmi.c
> @@ -1705,7 +1705,7 @@ static int imx_hdmi_bind(struct device *dev, struct 
> device *master, void *data)
>   hdmi_writeb(hdmi, hdmi->sink_detect_polarity, HDMI_PHY_POL0);
>  
>   /* Clear Hotplug interrupts */
> - hdmi_writeb(hdmi, hdmi->sink_detect_status, HDMI_IH_PHY_STAT0);
> + hdmi_writeb(hdmi, 0x3d, HDMI_IH_PHY_STAT0);

If we are only unmasking "hdmi->sink_detect_status" interrupts via a
write to HDMI_IH_MUTE_PHY_STAT0, then why do we need to clear these other
interrupts?  Please add additional explanation to the commit message
giving the reasoning for this change.

Thanks.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Fix coding style in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Pascal COMBES
From: Pascal COMBES 

Fix alignement issues and two or three other coding style problems in 
drivers/staging/crystalhd/crystalhd_lnx.c.

NB: -I did this for task 10 of Eudyptula challenge 

-I did not address camel case related problem because it would have 
make a big patch.

Signed-off-by: Pascal COMBES 
---
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c 
b/drivers/staging/crystalhd/crystalhd_lnx.c
index 20be957..9f6a9d4 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -28,7 +28,7 @@ static struct crystalhd_adp *g_adp_info;
 
 static irqreturn_t chd_dec_isr(int irq, void *arg)
 {
-   struct crystalhd_adp *adp = (struct crystalhd_adp *) arg;
+   struct crystalhd_adp *adp = (struct crystalhd_adp *)arg;
int rc = 0;
if (adp)
rc = crystalhd_cmd_interrupt(&adp->cmds);
@@ -112,7 +112,7 @@ static void chd_dec_free_iodata(struct crystalhd_adp *adp,
 }
 
 static inline int crystalhd_user_data(void __user *ud, void *dr,
-int size, int set)
+ int size, int set)
 {
int rc;
 
@@ -135,7 +135,9 @@ static inline int crystalhd_user_data(void __user *ud, void 
*dr,
 }
 
 static int chd_dec_fetch_cdata(struct crystalhd_adp *adp,
-struct crystalhd_ioctl_data *io, uint32_t m_sz, unsigned long ua)
+  struct crystalhd_ioctl_data *io,
+  uint32_t m_sz,
+  unsigned long ua)
 {
unsigned long ua_off;
int rc = 0;
@@ -154,7 +156,7 @@ static int chd_dec_fetch_cdata(struct crystalhd_adp *adp,
io->add_cdata_sz = m_sz;
ua_off = ua + sizeof(io->udata);
rc = crystalhd_user_data((void __user *)ua_off, io->add_cdata,
-   io->add_cdata_sz, 0);
+io->add_cdata_sz, 0);
if (rc) {
BCMLOG_ERR("failed to pull add_cdata sz:%x ua_off:%x\n",
   io->add_cdata_sz, (unsigned int)ua_off);
@@ -167,7 +169,8 @@ static int chd_dec_fetch_cdata(struct crystalhd_adp *adp,
 }
 
 static int chd_dec_release_cdata(struct crystalhd_adp *adp,
-struct crystalhd_ioctl_data *io, unsigned long ua)
+struct crystalhd_ioctl_data *io,
+unsigned long ua)
 {
unsigned long ua_off;
int rc;
@@ -180,7 +183,7 @@ static int chd_dec_release_cdata(struct crystalhd_adp *adp,
if (io->cmd != BCM_IOC_FW_DOWNLOAD) {
ua_off = ua + sizeof(io->udata);
rc = crystalhd_user_data((void __user *)ua_off, io->add_cdata,
-   io->add_cdata_sz, 1);
+io->add_cdata_sz, 1);
if (rc) {
BCMLOG_ERR(
"failed to push add_cdata sz:%x ua_off:%x\n",
@@ -210,7 +213,7 @@ static int chd_dec_proc_user_data(struct crystalhd_adp *adp,
}
 
rc = crystalhd_user_data((void __user *)ua, &io->udata,
-   sizeof(io->udata), set);
+sizeof(io->udata), set);
if (rc) {
BCMLOG_ERR("failed to %s iodata\n", (set ? "set" : "get"));
return rc;
@@ -382,7 +385,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp)
}
 
dev = device_create(crystalhd_class, NULL,
-MKDEV(adp->chd_dec_major, 0), NULL, "crystalhd");
+   MKDEV(adp->chd_dec_major, 0), NULL, "crystalhd");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
BCMLOG_ERR("failed to create device\n");
@@ -397,8 +400,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp)
 
/* Allocate general purpose ioctl pool. */
for (i = 0; i < CHD_IODATA_POOL_SZ; i++) {
-   temp = kzalloc(sizeof(struct crystalhd_ioctl_data),
-GFP_KERNEL);
+   temp = kzalloc(sizeof(*temp), GFP_KERNEL);
if (!temp) {
BCMLOG_ERR("ioctl data pool kzalloc failed\n");
rc = -ENOMEM;
@@ -549,11 +551,11 @@ static int chd_dec_pci_probe(struct pci_dev *pdev,
enum BC_STATUS sts = BC_STS_SUCCESS;
 
BCMLOG(BCMLOG_DBG,
-   "PCI_INFO: Vendor:0x%04x Device:0x%04x s_vendor:0x%04x 
s_device: 0x%04x\n",
-   pdev->vendor, pdev->device, pdev->subsystem_vendor,
-   pdev->subsystem_device);
+  "PCI_INFO: Vendor:0x%04x Device:0x%04x s_vendor:0x%04x s_device: 
0x%04x\n",
+  pdev->vendor, pdev->device, pdev->subsystem_vendor,
+  pdev->subsystem_device);
 
-   pinfo = kzalloc(sizeof(struct crystalhd_adp), GFP_KERNEL);
+   pinfo = kzalloc(sizeof(*pinfo), GFP_KERNEL);
i

Re: [PATCH] Fix coding style in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Greg Kroah-Hartman
On Sun, Apr 13, 2014 at 05:35:46PM +0200, Pascal COMBES wrote:
> From: Pascal COMBES 
> 
> Fix alignement issues and two or three other coding style problems in 
> drivers/staging/crystalhd/crystalhd_lnx.c.

Patches need to do one thing, as you are addressing a number of
different things all in one patch, this needs to be broken up into
smaller pieces, and sent as a series of patches.

> 
> NB:   -I did this for task 10 of Eudyptula challenge 
> 
>   -I did not address camel case related problem because it would have 
> make a big patch.

This doesn't belong here, in the patch changelog body, please remove it.
If you want to include comments like this, they need to be below the
"---" line where git will remove them when the patch is applied.

> 
> Signed-off-by: Pascal COMBES 
> ---
> diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c 
> b/drivers/staging/crystalhd/crystalhd_lnx.c
> index 20be957..9f6a9d4 100644
> --- a/drivers/staging/crystalhd/crystalhd_lnx.c
> +++ b/drivers/staging/crystalhd/crystalhd_lnx.c
> @@ -28,7 +28,7 @@ static struct crystalhd_adp *g_adp_info;
>  
>  static irqreturn_t chd_dec_isr(int irq, void *arg)
>  {
> - struct crystalhd_adp *adp = (struct crystalhd_adp *) arg;
> + struct crystalhd_adp *adp = (struct crystalhd_adp *)arg;
>   int rc = 0;
>   if (adp)
>   rc = crystalhd_cmd_interrupt(&adp->cmds);
> @@ -112,7 +112,7 @@ static void chd_dec_free_iodata(struct crystalhd_adp *adp,
>  }
>  
>  static inline int crystalhd_user_data(void __user *ud, void *dr,
> -  int size, int set)
> +   int size, int set)
>  {
>   int rc;
>  
> @@ -135,7 +135,9 @@ static inline int crystalhd_user_data(void __user *ud, 
> void *dr,
>  }
>  
>  static int chd_dec_fetch_cdata(struct crystalhd_adp *adp,
> -  struct crystalhd_ioctl_data *io, uint32_t m_sz, unsigned long ua)
> +struct crystalhd_ioctl_data *io,
> +uint32_t m_sz,
> +unsigned long ua)

Why can't these two lines be on the same line?

thanks,

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


[PATCH] staging: wlan-ng: Fix sparse warnings

2014-04-13 Thread code
From: Sarath Lakshman 

Fixed missed declarations for few non-static functions.

Signed-off-by: Sarath Lakshman 
---
 drivers/staging/wlan-ng/cfg80211.c   | 1 +
 drivers/staging/wlan-ng/prism2mgmt.h | 6 ++
 2 files changed, 7 insertions(+)

diff --git a/drivers/staging/wlan-ng/cfg80211.c 
b/drivers/staging/wlan-ng/cfg80211.c
index f76f95c..662581c 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -1,4 +1,5 @@
 /* cfg80211 Interface for prism2_usb module */
+#include "prism2mgmt.h"
 
 
 /* Prism2 channel/frequency/bitrate declarations */
diff --git a/drivers/staging/wlan-ng/prism2mgmt.h 
b/drivers/staging/wlan-ng/prism2mgmt.h
index 190d390..ad049ad 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.h
+++ b/drivers/staging/wlan-ng/prism2mgmt.h
@@ -60,6 +60,8 @@
 #ifndef _PRISM2MGMT_H
 #define _PRISM2MGMT_H
 
+#include "hfa384x.h"
+
 extern int prism2_reset_holdtime;
 extern int prism2_reset_settletime;
 
@@ -109,4 +111,8 @@ void prism2sta_processing_defer(struct work_struct *data);
 void prism2sta_commsqual_defer(struct work_struct *data);
 void prism2sta_commsqual_timer(unsigned long data);
 
+void prism2_connect_result(wlandevice_t *wlandev, u8 failed);
+void prism2_disconnected(wlandevice_t *wlandev);
+void prism2_roamed(wlandevice_t *wlandev);
+
 #endif
-- 
1.8.3.2

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


[PATCH] staging/rtl8187se fix sparse complaints

2014-04-13 Thread Jake Edge

Fix the following sparse complaints:

drivers/staging/rtl8187se//r8180_wx.c:1399:24: warning: symbol
'r8180_wx_handlers_def' was not declared. Should it be static?

drivers/staging/rtl8187se//ieee80211/ieee80211_crypt.c:201:5: warning:
symbol 'ieee80211_crypto_init' was not declared. Should it be static?

drivers/staging/rtl8187se//ieee80211/ieee80211_crypt.c:222:6: warning:
symbol 'ieee80211_crypto_deinit' was not declared. Should it be static?

drivers/staging/rtl8187se//ieee80211/ieee80211_crypt_ccmp.c:446:5:
warning: symbol 'ieee80211_crypto_ccmp_init' was not declared. Should
it be static?

drivers/staging/rtl8187se//ieee80211/ieee80211_crypt_ccmp.c:452:6:
warning: symbol 'ieee80211_crypto_ccmp_exit' was not declared. Should
it be static?

drivers/staging/rtl8187se//ieee80211/ieee80211_crypt_wep.c:264:5:
warning: symbol 'ieee80211_crypto_wep_init' was not declared. Should it
be static?

drivers/staging/rtl8187se//ieee80211/ieee80211_crypt_wep.c:269:6:
warning: symbol 'ieee80211_crypto_wep_exit' was not declared. Should it
be static?

by adding an include file into source files and moving some
declarations around into the proper header files.

Signed-off-by: Jake Edge 
---

Against next-20140411

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.h 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.h
index 0b4ea43..8fe7873 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.h
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.h
@@ -83,4 +83,13 @@ void ieee80211_crypt_deinit_handler(unsigned long);
 void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
struct ieee80211_crypt_data **crypt);
 
+/* fun with the built-in ieee80211 stack... */
+int ieee80211_crypto_init(void);
+void ieee80211_crypto_deinit(void);
+int ieee80211_crypto_tkip_init(void);
+void ieee80211_crypto_tkip_exit(void);
+int ieee80211_crypto_ccmp_init(void);
+void ieee80211_crypto_ccmp_exit(void);
+int ieee80211_crypto_wep_init(void);
+void ieee80211_crypto_wep_exit(void);
 #endif
diff --git a/drivers/staging/rtl8187se/r8180.h 
b/drivers/staging/rtl8187se/r8180.h
index 9f931db..cf510b6 100644
--- a/drivers/staging/rtl8187se/r8180.h
+++ b/drivers/staging/rtl8187se/r8180.h
@@ -629,12 +629,3 @@ bool MgntActSet_RF_State(struct net_device *dev, enum 
rt_rf_power_state StateToS
 
 #endif
 
-/* fun with the built-in ieee80211 stack... */
-extern int ieee80211_crypto_init(void);
-extern void ieee80211_crypto_deinit(void);
-extern int ieee80211_crypto_tkip_init(void);
-extern void ieee80211_crypto_tkip_exit(void);
-extern int ieee80211_crypto_ccmp_init(void);
-extern void ieee80211_crypto_ccmp_exit(void);
-extern int ieee80211_crypto_wep_init(void);
-extern void ieee80211_crypto_wep_exit(void);
diff --git a/drivers/staging/rtl8187se/r8180_core.c 
b/drivers/staging/rtl8187se/r8180_core.c
index a6022d4..cbdff00 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -47,6 +47,7 @@
 #include "r8180_dm.h"
 
 #include "ieee80211/dot11d.h"
+#include "ieee80211/ieee80211_crypt.h"
 
 static struct pci_device_id rtl8180_pci_id_tbl[] = {
{
diff --git a/drivers/staging/rtl8187se/r8180_wx.c 
b/drivers/staging/rtl8187se/r8180_wx.c
index b552491..57bf01f 100644
--- a/drivers/staging/rtl8187se/r8180_wx.c
+++ b/drivers/staging/rtl8187se/r8180_wx.c
@@ -20,6 +20,7 @@
 
 #include "r8180.h"
 #include "r8180_hw.h"
+#include "r8180_wx.h"
 
 #include 
 #include "ieee80211/dot11d.h"


-- 
Jake Edge - j...@edge2.net - http://www.edge2.net
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] bcm: Fixing a few checkpatch issues in InterfaceMisc.h

2014-04-13 Thread JulianGindi
Just cleaned up a few issues presented by checkpatch in InterfaceMisc.h. I 
converted some spaces to tabs, and removed unnecessary whitespace. The kernel 
version I am using linux-next-20140411.

Signed-off-by: JulianGindi 
---
 drivers/staging/bcm/InterfaceMisc.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceMisc.h 
b/drivers/staging/bcm/InterfaceMisc.h
index bce6869..efb6860 100644
--- a/drivers/staging/bcm/InterfaceMisc.h
+++ b/drivers/staging/bcm/InterfaceMisc.h
@@ -14,13 +14,13 @@ InterfaceWRM(struct bcm_interface_adapter *psIntfAdapter,
INT len);
 
 
-int InterfaceFileDownload( PVOID psIntfAdapter,
-struct file *flp,
-unsigned int on_chip_loc);
+int InterfaceFileDownload(PVOID psIntfAdapter,
+   struct file *flp,
+   unsigned int on_chip_loc);
 
-int InterfaceFileReadbackFromChip( PVOID psIntfAdapter,
-struct file *flp,
-unsigned int on_chip_loc);
+int InterfaceFileReadbackFromChip(PVOID psIntfAdapter,
+   struct file *flp,
+   unsigned int on_chip_loc);
 
 
 int BcmRDM(PVOID arg,
-- 
1.9.0

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


[PATCH v2 1/3] Fix alignement problems in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Pascal COMBES
From: Pascal COMBES 

Fix alignement problems in drivers/staging/crystalhd/crystalhd_lnx.c.

Signed-off-by: Pascal COMBES 
---
As asked I split the patch in three (because I'm addressing 3 types of
problems). I also took into account your last comment: What I did seemmed 
better to me, but as I'm not the reference I discarded it.
Regards,
Pascal COMBES.


diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c 
b/drivers/staging/crystalhd/crystalhd_lnx.c
index 20be957..fd7f08a 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -112,7 +112,7 @@ static void chd_dec_free_iodata(struct crystalhd_adp *adp,
 }
 
 static inline int crystalhd_user_data(void __user *ud, void *dr,
-int size, int set)
+ int size, int set)
 {
int rc;
 
@@ -135,7 +135,8 @@ static inline int crystalhd_user_data(void __user *ud, void 
*dr,
 }
 
 static int chd_dec_fetch_cdata(struct crystalhd_adp *adp,
-struct crystalhd_ioctl_data *io, uint32_t m_sz, unsigned long ua)
+  struct crystalhd_ioctl_data *io, uint32_t m_sz,
+  unsigned long ua)
 {
unsigned long ua_off;
int rc = 0;
@@ -154,7 +155,7 @@ static int chd_dec_fetch_cdata(struct crystalhd_adp *adp,
io->add_cdata_sz = m_sz;
ua_off = ua + sizeof(io->udata);
rc = crystalhd_user_data((void __user *)ua_off, io->add_cdata,
-   io->add_cdata_sz, 0);
+io->add_cdata_sz, 0);
if (rc) {
BCMLOG_ERR("failed to pull add_cdata sz:%x ua_off:%x\n",
   io->add_cdata_sz, (unsigned int)ua_off);
@@ -167,7 +168,8 @@ static int chd_dec_fetch_cdata(struct crystalhd_adp *adp,
 }
 
 static int chd_dec_release_cdata(struct crystalhd_adp *adp,
-struct crystalhd_ioctl_data *io, unsigned long ua)
+struct crystalhd_ioctl_data *io,
+unsigned long ua)
 {
unsigned long ua_off;
int rc;
@@ -180,7 +182,7 @@ static int chd_dec_release_cdata(struct crystalhd_adp *adp,
if (io->cmd != BCM_IOC_FW_DOWNLOAD) {
ua_off = ua + sizeof(io->udata);
rc = crystalhd_user_data((void __user *)ua_off, io->add_cdata,
-   io->add_cdata_sz, 1);
+io->add_cdata_sz, 1);
if (rc) {
BCMLOG_ERR(
"failed to push add_cdata sz:%x ua_off:%x\n",
@@ -210,7 +212,7 @@ static int chd_dec_proc_user_data(struct crystalhd_adp *adp,
}
 
rc = crystalhd_user_data((void __user *)ua, &io->udata,
-   sizeof(io->udata), set);
+sizeof(io->udata), set);
if (rc) {
BCMLOG_ERR("failed to %s iodata\n", (set ? "set" : "get"));
return rc;
@@ -382,7 +384,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp)
}
 
dev = device_create(crystalhd_class, NULL,
-MKDEV(adp->chd_dec_major, 0), NULL, "crystalhd");
+   MKDEV(adp->chd_dec_major, 0), NULL, "crystalhd");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
BCMLOG_ERR("failed to create device\n");
@@ -398,7 +400,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp)
/* Allocate general purpose ioctl pool. */
for (i = 0; i < CHD_IODATA_POOL_SZ; i++) {
temp = kzalloc(sizeof(struct crystalhd_ioctl_data),
-GFP_KERNEL);
+  GFP_KERNEL);
if (!temp) {
BCMLOG_ERR("ioctl data pool kzalloc failed\n");
rc = -ENOMEM;
@@ -549,9 +551,9 @@ static int chd_dec_pci_probe(struct pci_dev *pdev,
enum BC_STATUS sts = BC_STS_SUCCESS;
 
BCMLOG(BCMLOG_DBG,
-   "PCI_INFO: Vendor:0x%04x Device:0x%04x s_vendor:0x%04x 
s_device: 0x%04x\n",
-   pdev->vendor, pdev->device, pdev->subsystem_vendor,
-   pdev->subsystem_device);
+  "PCI_INFO: Vendor:0x%04x Device:0x%04x s_vendor:0x%04x s_device: 
0x%04x\n",
+  pdev->vendor, pdev->device, pdev->subsystem_vendor,
+  pdev->subsystem_device);
 
pinfo = kzalloc(sizeof(struct crystalhd_adp), GFP_KERNEL);
if (!pinfo) {

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


[PATCH v2 2/3] Fix coding style problem (cast with space) in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Pascal COMBES
From: Pascal COMBES 

Fix coding style problem in drivers/staging/crystalhd/crystalhd_lnx.c:
No space needed before a cast.

Signed-off-by: Pascal COMBES 
---
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c 
b/drivers/staging/crystalhd/crystalhd_lnx.c
index fd7f08a..15e8f02 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -28,7 +28,7 @@ static struct crystalhd_adp *g_adp_info;
 
 static irqreturn_t chd_dec_isr(int irq, void *arg)
 {
-   struct crystalhd_adp *adp = (struct crystalhd_adp *) arg;
+   struct crystalhd_adp *adp = (struct crystalhd_adp *)arg;
int rc = 0;
if (adp)
rc = crystalhd_cmd_interrupt(&adp->cmds);

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


[PATCH v2 3/3] Fix coding style problem (sizeof with type) in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Pascal COMBES
From: Pascal COMBES 

Replace sizeof(type) by sizeof(variable) in
drivers/staging/crystalhd/crystalhd_lnx.c.

Signed-off-by: Pascal COMBES 
---
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c
b/drivers/staging/crystalhd/crystalhd_lnx.c
index 15e8f02..7b14b28 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -399,8 +399,7 @@ static int chd_dec_init_chdev(struct crystalhd_adp *adp)

/* Allocate general purpose ioctl pool. */
for (i = 0; i < CHD_IODATA_POOL_SZ; i++) {
-   temp = kzalloc(sizeof(struct crystalhd_ioctl_data),
-  GFP_KERNEL);
+   temp = kzalloc(sizeof(*temp), GFP_KERNEL);
if (!temp) {
BCMLOG_ERR("ioctl data pool kzalloc failed\n");
rc = -ENOMEM;
@@ -555,7 +554,7 @@ static int chd_dec_pci_probe(struct pci_dev *pdev,
   pdev->vendor, pdev->device, pdev->subsystem_vendor,
   pdev->subsystem_device);

-   pinfo = kzalloc(sizeof(struct crystalhd_adp), GFP_KERNEL);
+   pinfo = kzalloc(sizeof(*pinfo), GFP_KERNEL);
if (!pinfo) {
BCMLOG_ERR("Failed to allocate memory\n");
return -ENOMEM;

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


Re: [PATCH] bcm: Fixing a few checkpatch issues in InterfaceMisc.h

2014-04-13 Thread Greg KH
On Sun, Apr 13, 2014 at 02:56:57PM -0400, JulianGindi wrote:
> Just cleaned up a few issues presented by checkpatch in InterfaceMisc.h. I 
> converted some spaces to tabs, and removed unnecessary whitespace. The kernel 
> version I am using linux-next-20140411.

That's a very long line, please wrap them properly.

> Signed-off-by: JulianGindi 

That might be your real name, but odds are, there needs to be a space in
there somewhere, right?

Please read Documentation/SubmittingPatches about what that line means,
and why we need a real name there.

thanks,

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


Re: [PATCH v2 1/3] Fix alignement problems in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Dan Carpenter
The subeject should be:

[PATCH v2 1/3] Staging: crystalhd: Fix alignement in crystalhd_lnx.c

Please resend it.  Also you should use shorter subject lines.

"Fix coding style problem (cast with space) in 
drivers/staging/crystalhd/crystalhd_lnx.c"

This is too long.  Say:

"Remove a stray space character in crystalhd_lnx.c"

On Sun, Apr 13, 2014 at 09:09:18PM +0200, Pascal COMBES wrote:
> From: Pascal COMBES 

Don't include this for your own patches, only when you are sending
someone else's.  We get the From information from the email header.

(This is harmless but it's bad style).

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


Re: [PATCH v2 1/3] Fix alignement problems in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Paul Bolle
On Mon, 2014-04-14 at 00:02 +0300, Dan Carpenter wrote:
> The subeject should be:
> 
> [PATCH v2 1/3] Staging: crystalhd: Fix alignement in crystalhd_lnx.c
> 
> Please resend it.  Also you should use shorter subject lines.
> 
> "Fix coding style problem (cast with space) in 
> drivers/staging/crystalhd/crystalhd_lnx.c"
> 
> This is too long.  Say:
> 
> "Remove a stray space character in crystalhd_lnx.c"

The commit explanation also was a copy of the subject line. That
suggests that the explanation can be dropped. Many trivial fixes can
(and should) be submitted without a commit explanation.


Paul Bolle

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


Re: [PATCH v2 2/3] Fix coding style problem (cast with space) in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Paul Bolle
On Sun, 2014-04-13 at 21:13 +0200, Pascal COMBES wrote:
> From: Pascal COMBES 
> 
> Fix coding style problem in drivers/staging/crystalhd/crystalhd_lnx.c:
> No space needed before a cast.
> 
> Signed-off-by: Pascal COMBES 
> ---
> diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c 
> b/drivers/staging/crystalhd/crystalhd_lnx.c
> index fd7f08a..15e8f02 100644
> --- a/drivers/staging/crystalhd/crystalhd_lnx.c
> +++ b/drivers/staging/crystalhd/crystalhd_lnx.c
> @@ -28,7 +28,7 @@ static struct crystalhd_adp *g_adp_info;
>  
>  static irqreturn_t chd_dec_isr(int irq, void *arg)
>  {
> - struct crystalhd_adp *adp = (struct crystalhd_adp *) arg;
> + struct crystalhd_adp *adp = (struct crystalhd_adp *)arg;

Shouldn't this cast just be dropped instead?

>   int rc = 0;
>   if (adp)
>   rc = crystalhd_cmd_interrupt(&adp->cmds);
> 


Paul Bolle

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


Re: [PATCH v2 1/3] Fix alignement problems in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Dan Carpenter
On Sun, Apr 13, 2014 at 11:26:15PM +0200, Paul Bolle wrote:
> On Mon, 2014-04-14 at 00:02 +0300, Dan Carpenter wrote:
> > The subeject should be:
> > 
> > [PATCH v2 1/3] Staging: crystalhd: Fix alignement in crystalhd_lnx.c
> > 
> > Please resend it.  Also you should use shorter subject lines.
> > 
> > "Fix coding style problem (cast with space) in 
> > drivers/staging/crystalhd/crystalhd_lnx.c"
> > 
> > This is too long.  Say:
> > 
> > "Remove a stray space character in crystalhd_lnx.c"
> 
> The commit explanation also was a copy of the subject line.

Huh?  No it wasn't.

> That
> suggests that the explanation can be dropped.

The long description was fine.  It included a copy of the error message
and everything.

> Many trivial fixes can
> (and should) be submitted without a commit explanation.
> 

Don't encourage people to leave out the commit message.  They can figure
out on their own when that is appropriate.  In my experience people only
err on the other side, by not commenting enough.  I've only rarely been
annoyed by a long description which was too long.

regards,
dan carpenter

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


Re: [PATCH v2 1/3] Fix alignement problems in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Paul Bolle
On Mon, 2014-04-14 at 01:07 +0300, Dan Carpenter wrote:
> The long description was fine.  It included a copy of the error message
> and everything.

This is what I saw in the body of the message above the "---" line:
From: Pascal COMBES 

Fix alignement problems in drivers/staging/crystalhd/crystalhd_lnx.c.

Signed-off-by: Pascal COMBES 

Are you and I looking at different patches?


Paul Bolle

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


[PATCH v2] bcm: Fixing a few checkpatch issues in InterfaceMisc.h

2014-04-13 Thread Julian Gindi
Just cleaned up a few issues presented by checkpatch in InterfaceMisc.h.
I converted some spaces to tabs, and removed unnecessary whitespace. The
kernel version I am using linux-next-20140411.

Signed-off-by: Julian Gindi 
---
 drivers/staging/bcm/InterfaceMisc.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceMisc.h 
b/drivers/staging/bcm/InterfaceMisc.h
index bce6869..efb6860 100644
--- a/drivers/staging/bcm/InterfaceMisc.h
+++ b/drivers/staging/bcm/InterfaceMisc.h
@@ -14,13 +14,13 @@ InterfaceWRM(struct bcm_interface_adapter *psIntfAdapter,
INT len);
 
 
-int InterfaceFileDownload( PVOID psIntfAdapter,
-struct file *flp,
-unsigned int on_chip_loc);
+int InterfaceFileDownload(PVOID psIntfAdapter,
+   struct file *flp,
+   unsigned int on_chip_loc);
 
-int InterfaceFileReadbackFromChip( PVOID psIntfAdapter,
-struct file *flp,
-unsigned int on_chip_loc);
+int InterfaceFileReadbackFromChip(PVOID psIntfAdapter,
+   struct file *flp,
+   unsigned int on_chip_loc);
 
 
 int BcmRDM(PVOID arg,
-- 
1.9.0

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


Re: [PATCH v2 1/3] Fix alignement problems in drivers/staging/crystalhd/crystalhd_lnx.c

2014-04-13 Thread Dan Carpenter
On Mon, Apr 14, 2014 at 12:13:03AM +0200, Paul Bolle wrote:
> On Mon, 2014-04-14 at 01:07 +0300, Dan Carpenter wrote:
> > The long description was fine.  It included a copy of the error message
> > and everything.
> 
> This is what I saw in the body of the message above the "---" line:
> From: Pascal COMBES 
> 
> Fix alignement problems in drivers/staging/crystalhd/crystalhd_lnx.c.
> 
> Signed-off-by: Pascal COMBES 
> 
> Are you and I looking at different patches?


Yeah.  I was looking at patch 2 where the space was removed.

regards,
dan carpenter

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


[PATCH] staging: vt6656: fix sparse warning

2014-04-13 Thread Angus Gibson
This patch fixes the following warning:
drivers/staging/vt6656/aes_ccmp.c:221:6: warning: symbol 'AESbGenCCMP' was not 
declared. Should it be static?

Signed-off-by: Angus Gibson 
---
 drivers/staging/vt6656/aes_ccmp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/vt6656/aes_ccmp.c 
b/drivers/staging/vt6656/aes_ccmp.c
index e2bfa8d..a9d5168 100644
--- a/drivers/staging/vt6656/aes_ccmp.c
+++ b/drivers/staging/vt6656/aes_ccmp.c
@@ -32,6 +32,7 @@
 
 #include "device.h"
 #include "80211hdr.h"
+#include "aes_ccmp.h"
 
 /*
  * SBOX Table
-- 
1.9.2

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


Re: [report] staging: r8723au: rtw_report_sec_ie23a() is buggy

2014-04-13 Thread Jes Sorensen
Dan Carpenter  writes:
> Hello Larry, Jes,
>
> The rtw_report_sec_ie23a() is very buggy.
>
> 1) It uses GFP_KERNEL but the callers are holding a spinlock.
>
>   rtw_select_and_join_from_scanned_queue23a() <- takes lock
>   -> rtw_joinbss_cmd23a()
>-> rtw_restruct_sec_ie23a()
>   -> rtw_report_sec_ie23a()
>
> 2) The sprintf() can overflow because we're putting over 512 characters
>into a IW_CUSTOM_MAX (256) character buffer.
>
> 3) It could actually be far worse than 512.  It could be a forever
>loop!  :P  The "i" variable is declared as u8 so it will always be
>less than IW_CUSTOM_MAX (256).
>
> 4) What is the point of this function?  It doesn't seem to store "buff"
>anywhere or do anything with "wrqu".

Dan,

I fixed it by ripping out the whole function, since it wasn't doing
anything at all.

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