[PATCH 1/1] Octeon: Staging Driver: Remove coding warnings

2014-10-12 Thread Akshay Sarode
Checkpatch coding warnings of 'Missing a blank line after declaration'

Signed-off-by: Akshay Sarode 
---
 drivers/staging/octeon/ethernet-tx.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/staging/octeon/ethernet-tx.c 
b/drivers/staging/octeon/ethernet-tx.c
index 4e54d85..b7a7854 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -77,6 +77,7 @@ static DECLARE_TASKLET(cvm_oct_tx_cleanup_tasklet, 
cvm_oct_tx_do_cleanup, 0);
 static inline int32_t cvm_oct_adjust_skb_to_free(int32_t skb_to_free, int fau)
 {
int32_t undo;
+
undo = skb_to_free > 0 ? MAX_SKB_TO_FREE : skb_to_free +
   MAX_SKB_TO_FREE;
if (undo > 0)
@@ -89,6 +90,7 @@ static inline int32_t cvm_oct_adjust_skb_to_free(int32_t 
skb_to_free, int fau)
 static void cvm_oct_kick_tx_poll_watchdog(void)
 {
union cvmx_ciu_timx ciu_timx;
+
ciu_timx.u64 = 0;
ciu_timx.s.one_shot = 1;
ciu_timx.s.len = cvm_oct_tx_poll_interval;
@@ -118,9 +120,11 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev)
total_freed += skb_to_free;
if (skb_to_free > 0) {
struct sk_buff *to_free_list = NULL;
+
spin_lock_irqsave(&priv->tx_free_list[qos].lock, flags);
while (skb_to_free > 0) {
struct sk_buff *t;
+
t = __skb_dequeue(&priv->tx_free_list[qos]);
t->next = to_free_list;
to_free_list = t;
@@ -131,6 +135,7 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev)
/* Do the actual freeing outside of the lock. */
while (to_free_list) {
struct sk_buff *t = to_free_list;
+
to_free_list = to_free_list->next;
dev_kfree_skb_any(t);
}
@@ -258,6 +263,7 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device 
*dev)
cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface));
if (gmx_prt_cfg.s.duplex == 0) {
int add_bytes = 64 - skb->len;
+
if ((skb_tail_pointer(skb) + add_bytes) <=
skb_end_pointer(skb))
memset(__skb_put(skb, add_bytes), 0,
@@ -289,6 +295,7 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device 
*dev)
CVM_OCT_SKB_CB(skb)[0] = hw_buffer.u64;
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
struct skb_frag_struct *fs = skb_shinfo(skb)->frags + i;
+
hw_buffer.s.addr = XKPHYS_TO_PHYS(
(u64)(page_address(fs->page.p) +
fs->page_offset));
@@ -495,6 +502,7 @@ skip_xmit:

while (skb_to_free > 0) {
struct sk_buff *t = __skb_dequeue(&priv->tx_free_list[qos]);
+
t->next = to_free_list;
to_free_list = t;
skb_to_free--;
@@ -505,6 +513,7 @@ skip_xmit:
/* Do the actual freeing outside of the lock. */
while (to_free_list) {
struct sk_buff *t = to_free_list;
+
to_free_list = to_free_list->next;
dev_kfree_skb_any(t);
}
@@ -550,6 +559,7 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device 
*dev)

/* Get a work queue entry */
cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL);
+
if (unlikely(work == NULL)) {
printk_ratelimited("%s: Failed to allocate a work queue 
entry\n",
   dev->name);
@@ -713,6 +723,7 @@ static void cvm_oct_tx_do_cleanup(unsigned long arg)
for (port = 0; port < TOTAL_NUMBER_OF_PORTS; port++) {
if (cvm_oct_device[port]) {
struct net_device *dev = cvm_oct_device[port];
+
cvm_oct_free_tx_skbs(dev);
}
}
--
1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 00/15] staging: rtl8723au: Fixes and cleanups

2014-10-12 Thread Jes Sorensen
Greg KH  writes:
> On Fri, Oct 10, 2014 at 09:41:23PM +0200, jes.soren...@redhat.com wrote:
>> From: Jes Sorensen 
>> 
>> Hi,
>> 
>> Please find attached a couple of fixes and cleanups for the rtl8723au
>> driver. This includes a fix for the mac_addr alignment reported by Dan
>> Carpenter and two patches from Greg Donald.
>
> Should any of these go into 3.18-final, or are all ok for 3.19-rc1?

The first one would be good for 3.18-final since it fixes the alignment
issue for ether_addr_copy()

The rest can wait for 3.19.

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


Re: [PATCH 11/15] staging: rtl8723au: Remove a stack of write only counters

2014-10-12 Thread Jes Sorensen
Greg KH  writes:
> On Sat, Oct 11, 2014 at 05:32:49AM -0700, Greg KH wrote:
>> On Fri, Oct 10, 2014 at 09:41:34PM +0200, jes.soren...@redhat.com wrote:
>> > From: Jes Sorensen 
>> > 
>> > We don't do anything with these, so get rid of them
>> > 
>> > Signed-off-by: Jes Sorensen 
>> > ---
>> >  drivers/staging/rtl8723au/core/rtw_xmit.c|  6 --
>> >  drivers/staging/rtl8723au/include/rtw_xmit.h |  5 -
>> >  drivers/staging/rtl8723au/os_dep/usb_ops_linux.c | 16 
>> >  3 files changed, 27 deletions(-)
>> 
>> This one didn't apply to my tree for some reason, let me see if I can do
>> it by hand...
>
> Got it, all now applied, thanks.

Thanks for taking care of this!

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


[PATCH v2] Staging: lustre: llite: fix some sparse warnings about userspace pointer

2014-10-12 Thread Anh Le
Add __user macro to the function declarations that accept userspace pointers as
arguments.

Signed-off-by: Anh Le 
---
v2: Fixed checkpatch's parenthesis alignment warnings, noted by Sudip Mukherjee 
.

 .../staging/lustre/lustre/include/lprocfs_status.h |  6 +--
 drivers/staging/lustre/lustre/llite/lproc_llite.c  | 56 +-
 .../lustre/lustre/obdclass/lprocfs_status.c|  4 +-
 3 files changed, 38 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index ccb6cd4..54c5226 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -374,8 +374,8 @@ static inline void s2dhms(struct dhms *ts, time_t secs)
 #define JOBSTATS_PROCNAME_UID  "procname_uid"
 #define JOBSTATS_NODELOCAL "nodelocal"
 
-extern int lprocfs_write_frac_helper(const char *buffer, unsigned long count,
-int *val, int mult);
+extern int lprocfs_write_frac_helper(const char __user *buffer,
+unsigned long count, int *val, int mult);
 extern int lprocfs_read_frac_helper(char *buffer, unsigned long count,
long val, int mult);
 #if defined (CONFIG_PROC_FS)
@@ -647,7 +647,7 @@ extern int lprocfs_rd_kbytesavail(struct seq_file *m, void 
*data);
 extern int lprocfs_rd_filestotal(struct seq_file *m, void *data);
 extern int lprocfs_rd_filesfree(struct seq_file *m, void *data);
 
-extern int lprocfs_write_helper(const char *buffer, unsigned long count,
+extern int lprocfs_write_helper(const char __user *buffer, unsigned long count,
int *val);
 extern int lprocfs_seq_read_frac_helper(struct seq_file *m, long val, int 
mult);
 extern int lprocfs_write_u64_helper(const char *buffer, unsigned long count,
diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c 
b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 3b3df9f..dd52b81 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -227,8 +227,9 @@ static int ll_max_readahead_mb_seq_show(struct seq_file *m, 
void *v)
return lprocfs_seq_read_frac_helper(m, pages_number, mult);
 }
 
-static ssize_t ll_max_readahead_mb_seq_write(struct file *file, const char 
*buffer,
-size_t count, loff_t *off)
+static ssize_t ll_max_readahead_mb_seq_write(struct file *file,
+const char __user *buffer,
+size_t count, loff_t *off)
 {
struct super_block *sb = ((struct seq_file 
*)file->private_data)->private;
struct ll_sb_info *sbi = ll_s2sbi(sb);
@@ -269,7 +270,7 @@ static int ll_max_readahead_per_file_mb_seq_show(struct 
seq_file *m, void *v)
 }
 
 static ssize_t ll_max_readahead_per_file_mb_seq_write(struct file *file,
- const char *buffer,
+ const char __user *buffer,
  size_t count, loff_t *off)
 {
struct super_block *sb = ((struct seq_file 
*)file->private_data)->private;
@@ -313,7 +314,7 @@ static int ll_max_read_ahead_whole_mb_seq_show(struct 
seq_file *m, void *unused)
 }
 
 static ssize_t ll_max_read_ahead_whole_mb_seq_write(struct file *file,
-   const char *buffer,
+   const char __user *buffer,
size_t count, loff_t *off)
 {
struct super_block *sb = ((struct seq_file 
*)file->private_data)->private;
@@ -469,8 +470,9 @@ static int ll_checksum_seq_show(struct seq_file *m, void *v)
return seq_printf(m, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
 }
 
-static ssize_t ll_checksum_seq_write(struct file *file, const char *buffer,
-size_t count, loff_t *off)
+static ssize_t ll_checksum_seq_write(struct file *file,
+const char __user *buffer,
+size_t count, loff_t *off)
 {
struct super_block *sb = ((struct seq_file 
*)file->private_data)->private;
struct ll_sb_info *sbi = ll_s2sbi(sb);
@@ -504,8 +506,9 @@ static int ll_max_rw_chunk_seq_show(struct seq_file *m, 
void *v)
return seq_printf(m, "%lu\n", ll_s2sbi(sb)->ll_max_rw_chunk);
 }
 
-static ssize_t ll_max_rw_chunk_seq_write(struct file *file, const char *buffer,
-size_t count, loff_t *off)
+static ssize_t ll_max_rw_chunk_seq_write(struct file *file,
+const char __user *buffer,
+size_t count, loff_t *off)
 {
struct super_block *sb = ((st

[PATCH] staging: comedi: drivers: comedi_bond.c: Changed from using strncat to strlcat

2014-10-12 Thread Rickard Strandqvist
Changed from using strncat to strlcat to simplify the code

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/comedi/drivers/comedi_bond.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_bond.c 
b/drivers/staging/comedi/drivers/comedi_bond.c
index 8450c99..5d19861 100644
--- a/drivers/staging/comedi/drivers/comedi_bond.c
+++ b/drivers/staging/comedi/drivers/comedi_bond.c
@@ -262,12 +262,10 @@ static int do_dev_config(struct comedi_device *dev, 
struct comedi_devconfig *it)
{
/* Append dev:subdev to devpriv->name */
char buf[20];
-   int left =
-   MAX_BOARD_NAME - strlen(devpriv->name) - 1;
snprintf(buf, sizeof(buf), "%u:%u ",
 bdev->minor, bdev->subdev);
-   buf[sizeof(buf) - 1] = 0;
-   strncat(devpriv->name, buf, left);
+   strlcat(devpriv->name, buf,
+   sizeof(devpriv->name));
}
 
}
-- 
1.7.10.4

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


哪些因素与价格没有关系

2014-10-12 Thread 陈翊雪


83陈翊雪l.xls
Description: Binary data
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: lustre: ptlrpc: sec.c: Replacing strncat with strlcat to avoid overwrite size

2014-10-12 Thread Rickard Strandqvist
Changed from using strncat with strlcat to avoid overwrite the max size.
Take the opportunity to change a snprint to strlcpy.

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/lustre/lustre/ptlrpc/sec.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c 
b/drivers/staging/lustre/lustre/ptlrpc/sec.c
index 5cff7ee..d276e98 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/sec.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c
@@ -209,7 +209,7 @@ EXPORT_SYMBOL(sptlrpc_flavor2name_bulk);
 
 char *sptlrpc_flavor2name(struct sptlrpc_flavor *sf, char *buf, int bufsize)
 {
-   snprintf(buf, bufsize, "%s", sptlrpc_flavor2name_base(sf->sf_rpc));
+   strlcpy(buf, sptlrpc_flavor2name_base(sf->sf_rpc), bufsize);
 
/*
 * currently we don't support customized bulk specification for
@@ -220,10 +220,9 @@ char *sptlrpc_flavor2name(struct sptlrpc_flavor *sf, char 
*buf, int bufsize)
 
bspec[0] = '-';
sptlrpc_flavor2name_bulk(sf, &bspec[1], sizeof(bspec) - 1);
-   strncat(buf, bspec, bufsize);
+   strlcat(buf, bspec, bufsize);
}
 
-   buf[bufsize - 1] = '\0';
return buf;
 }
 EXPORT_SYMBOL(sptlrpc_flavor2name);
-- 
1.7.10.4

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


Re: [PATCH] staging: quickstart: remove driver

2014-10-12 Thread Angelo Arrifano
Hi all,

I cannot maintain the driver anymore since my only machine with support
to the "quickstart" hardware died quite some time ago.
I would be happy if someone else could continue maintaining the driver
though. :)

Best regards,
- Angelo Arrifano

On Thu, 2014-07-24 at 21:58 +0300, Kristina Martšenko wrote:
> The driver hasn't been cleaned up and it doesn't look like anyone is
> working on it anymore (including the original author). So remove the
> driver from the kernel. If someone wants to work on cleaning it up and
> moving it out of staging, this commit can be reverted.
> 
> Signed-off-by: Kristina Martšenko 
> Cc: Angelo Arrifano 
> ---
> To be applied after "staging: phison: remove driver".
> 
>  drivers/staging/Kconfig |   2 -
>  drivers/staging/Makefile|   1 -
>  drivers/staging/quickstart/Kconfig  |  10 -
>  drivers/staging/quickstart/Makefile |   1 -
>  drivers/staging/quickstart/quickstart.c | 458 
> 
>  5 files changed, 472 deletions(-)
>  delete mode 100644 drivers/staging/quickstart/Kconfig
>  delete mode 100644 drivers/staging/quickstart/Makefile
>  delete mode 100644 drivers/staging/quickstart/quickstart.c
> 
> diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
> index be3f91c..b08394c 100644
> --- a/drivers/staging/Kconfig
> +++ b/drivers/staging/Kconfig
> @@ -70,8 +70,6 @@ source "drivers/staging/iio/Kconfig"
>  
>  source "drivers/staging/xgifb/Kconfig"
>  
> -source "drivers/staging/quickstart/Kconfig"
> -
>  source "drivers/staging/emxx_udc/Kconfig"
>  
>  source "drivers/staging/bcm/Kconfig"
> diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
> index a4408a8..9623308 100644
> --- a/drivers/staging/Makefile
> +++ b/drivers/staging/Makefile
> @@ -29,7 +29,6 @@ obj-$(CONFIG_VME_BUS)   += vme/
>  obj-$(CONFIG_DX_SEP)+= sep/
>  obj-$(CONFIG_IIO)+= iio/
>  obj-$(CONFIG_FB_XGI) += xgifb/
> -obj-$(CONFIG_ACPI_QUICKSTART)+= quickstart/
>  obj-$(CONFIG_USB_EMXX)   += emxx_udc/
>  obj-$(CONFIG_BCM_WIMAX)  += bcm/
>  obj-$(CONFIG_FT1000) += ft1000/
> diff --git a/drivers/staging/quickstart/Kconfig 
> b/drivers/staging/quickstart/Kconfig
> deleted file mode 100644
> index 5bea487..000
> --- a/drivers/staging/quickstart/Kconfig
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -config ACPI_QUICKSTART
> - tristate "ACPI Quickstart key driver"
> - depends on ACPI && INPUT
> - help
> -   Say Y here if you have a platform that supports the ACPI
> -   quickstart key protocol.
> -
> -   To compile this driver as a module, choose M here: the module will be
> -   called quickstart.
> -
> diff --git a/drivers/staging/quickstart/Makefile 
> b/drivers/staging/quickstart/Makefile
> deleted file mode 100644
> index 290e0e4..000
> --- a/drivers/staging/quickstart/Makefile
> +++ /dev/null
> @@ -1 +0,0 @@
> -obj-$(CONFIG_ACPI_QUICKSTART)+= quickstart.o
> diff --git a/drivers/staging/quickstart/quickstart.c 
> b/drivers/staging/quickstart/quickstart.c
> deleted file mode 100644
> index a85c3d6..000
> --- a/drivers/staging/quickstart/quickstart.c
> +++ /dev/null
> @@ -1,458 +0,0 @@
> -/*
> - *  quickstart.c - ACPI Direct App Launch driver
> - *
> - *
> - *  Copyright (C) 2007-2010 Angelo Arrifano 
> - *
> - *  Information gathered from disassembled dsdt and from here:
> - *  
> 
> - *
> - *  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.
> - *
> - *  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> - *
> - */
> -
> -#define QUICKSTART_VERSION "1.04"
> -
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -MODULE_AUTHOR("Angelo Arrifano");
> -MODULE_DESCRIPTION("ACPI Direct App Launch driver");
> -MODULE_LICENSE("GPL");
> -
> -#define QUICKSTART_ACPI_DEVICE_NAME  "quickstart"
> -#define QUICKSTART_ACPI_CLASS"quickstart"
> -#define QUICKSTART_ACPI_HID  "PNP0C32"
> -
> -#define QUICKSTART_PF_DRIVER_NAME"quickstart"
> -#define QUICKSTART_PF_DEVICE_NAME"quickstart"
> -
> -/*
> - * There will be two events:
> - * 0x02 - A hot button was pressed while device was 

[PATCH] Staging: wlan-ng: prism2 simple style modifications

2014-10-12 Thread Erich Cordoba Malibran
From: Erich Cordoba 

prism2fw.c
prism2sta.c
Fixed style warning reported by checkpatch.pl
prism2mib.c
Renamed function prism2mib_framenthreshold to
meet style guidelines.

Signed-off-by: Erich Cordoba Malibran 
---
 drivers/staging/wlan-ng/prism2fw.c  | 10 +++---
 drivers/staging/wlan-ng/prism2mib.c | 26 +-
 drivers/staging/wlan-ng/prism2sta.c | 18 --
 3 files changed, 32 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c 
b/drivers/staging/wlan-ng/prism2fw.c
index 6c38f79..8641f97 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -238,7 +238,8 @@ static int prism2_fwtry(struct usb_device *udev, 
wlandevice_t *wlandev)
 *  0   - success
 *  ~0  - failure
 */
-static int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t 
*wlandev)
+static int prism2_fwapply(const struct ihex_binrec *rfptr,
+ wlandevice_t *wlandev)
 {
signed int result = 0;
struct p80211msg_dot11req_mibget getmsg;
@@ -707,7 +708,9 @@ static int plugimage(struct imgchunk *fchunk, unsigned int 
nfchunks,
continue;
}
 
-   /* Validate plug address against chunk data and identify chunk 
*/
+   /* Validate plug address against
+* chunk data and identify chunk
+*/
for (c = 0; c < nfchunks; c++) {
cstart = fchunk[c].addr;
cend = fchunk[c].addr + fchunk[c].len;
@@ -922,7 +925,8 @@ static int read_fwfile(const struct ihex_binrec *record)
  rcnt,
  s3info[ns3info].len,
  s3info[ns3info].type);
-   if (((s3info[ns3info].len - 1) * sizeof(u16)) > 
sizeof(s3info[ns3info].info)) {
+   if (((s3info[ns3info].len - 1) * sizeof(u16)) >
+   sizeof(s3info[ns3info].info)) {
pr_err("S3 inforec length too long - 
aborting\n");
return 1;
}
diff --git a/drivers/staging/wlan-ng/prism2mib.c 
b/drivers/staging/wlan-ng/prism2mib.c
index 0163e06..30d224f 100644
--- a/drivers/staging/wlan-ng/prism2mib.c
+++ b/drivers/staging/wlan-ng/prism2mib.c
@@ -132,12 +132,12 @@ static int prism2mib_excludeunencrypted(struct mibrec 
*mib,
struct p80211msg_dot11req_mibset *msg,
void *data);
 
-static int prism2mib_fragmentationthreshold(struct mibrec *mib,
-   int isget,
-   wlandevice_t *wlandev,
-   hfa384x_t *hw,
-   struct p80211msg_dot11req_mibset 
*msg,
-   void *data);
+static int prism2mib_fragmenthreshold(struct mibrec *mib,
+ int isget,
+ wlandevice_t *wlandev,
+ hfa384x_t *hw,
+ struct p80211msg_dot11req_mibset *msg,
+ void *data);
 
 static int prism2mib_priv(struct mibrec *mib,
  int isget,
@@ -198,7 +198,7 @@ static struct mibrec mibtab[] = {
{DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
 F_STA | F_READ | F_WRITE,
 HFA384x_RID_FRAGTHRESH, 0, 0,
-prism2mib_fragmentationthreshold},
+prism2mib_fragmenthreshold},
{DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime,
 F_STA | F_READ,
 HFA384x_RID_MAXTXLIFETIME, 0, 0,
@@ -660,12 +660,12 @@ static int prism2mib_excludeunencrypted(struct mibrec 
*mib,
 *
 */
 
-static int prism2mib_fragmentationthreshold(struct mibrec *mib,
-   int isget,
-   wlandevice_t *wlandev,
-   hfa384x_t *hw,
-   struct p80211msg_dot11req_mibset 
*msg,
-   void *data)
+static int prism2mib_fragmenthreshold(struct mibrec *mib,
+ int isget,
+ wlandevice_t *wlandev,
+ hfa384x_t *hw,
+ struct p80211msg_dot11req_mibset *msg,
+ void *data)
 {
int result;
u32 *uint32 = (u32 *) data;
diff --git a/drivers/staging/wlan-ng/prism2sta.c 
b/drivers/staging/wlan-ng/pr

[PATCH 1/2] staging: rtl8192u: Fix sparse warnings of r8182U_core

2014-10-12 Thread Koray Gulcu
This patch fixes the following endianness warnings found by sparse running with 
CF=-D__CHECK_ENDIAN__:

drivers/staging/rtl8192u/r8192U_core.c:1794:10: warning: incorrect type in 
initializer (different base types)
drivers/staging/rtl8192u/r8192U_core.c:1794:10:expected restricted __le16
drivers/staging/rtl8192u/r8192U_core.c:1794:10:got int
drivers/staging/rtl8192u/r8192U_core.c:1794:13: warning: incorrect type in 
initializer (different base types)
drivers/staging/rtl8192u/r8192U_core.c:1794:13:expected restricted __le16
drivers/staging/rtl8192u/r8192U_core.c:1794:13:got int
drivers/staging/rtl8192u/r8192U_core.c:1794:16: warning: incorrect type in 
initializer (different base types)
drivers/staging/rtl8192u/r8192U_core.c:1794:16:expected restricted __le16
drivers/staging/rtl8192u/r8192U_core.c:1794:16:got int
drivers/staging/rtl8192u/r8192U_core.c:1794:19: warning: incorrect type in 
initializer (different base types)
drivers/staging/rtl8192u/r8192U_core.c:1794:19:expected restricted __le16
drivers/staging/rtl8192u/r8192U_core.c:1794:19:got int
drivers/staging/rtl8192u/r8192U_core.c:1795:10: warning: incorrect type in 
initializer (different base types)
drivers/staging/rtl8192u/r8192U_core.c:1795:10:expected restricted __le16
drivers/staging/rtl8192u/r8192U_core.c:1795:10:got int
drivers/staging/rtl8192u/r8192U_core.c:1795:13: warning: incorrect type in 
initializer (different base types)
drivers/staging/rtl8192u/r8192U_core.c:1795:13:expected restricted __le16
drivers/staging/rtl8192u/r8192U_core.c:1795:13:got int
drivers/staging/rtl8192u/r8192U_core.c:1795:16: warning: incorrect type in 
initializer (different base types)
drivers/staging/rtl8192u/r8192U_core.c:1795:16:expected restricted __le16
drivers/staging/rtl8192u/r8192U_core.c:1795:16:got int
drivers/staging/rtl8192u/r8192U_core.c:1795:19: warning: incorrect type in 
initializer (different base types)
drivers/staging/rtl8192u/r8192U_core.c:1795:19:expected restricted __le16
drivers/staging/rtl8192u/r8192U_core.c:1795:19:got int
drivers/staging/rtl8192u/r8192U_core.c:1838:34: warning: cast from restricted 
__le16
drivers/staging/rtl8192u/r8192U_core.c:1839:34: warning: cast from restricted 
__le16
drivers/staging/rtl8192u/r8192U_core.c:1840:34: warning: cast from restricted 
__le16

Signed-off-by: Koray Gulcu 
---
 drivers/staging/rtl8192u/r8192U_core.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 929ac29..49b40ea 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1791,8 +1791,8 @@ static void rtl8192_link_change(struct net_device *dev)
 }
 
 static struct ieee80211_qos_parameters def_qos_parameters = {
-   {3, 3, 3, 3},/* cw_min */
-   {7, 7, 7, 7},/* cw_max */
+   {cpu_to_le16(3), cpu_to_le16(3), cpu_to_le16(3), cpu_to_le16(3)},
+   {cpu_to_le16(7), cpu_to_le16(7), cpu_to_le16(7), cpu_to_le16(7)},
{2, 2, 2, 2},/* aifs */
{0, 0, 0, 0},/* flags */
{0, 0, 0, 0} /* tx_op_limit */
@@ -1835,9 +1835,9 @@ static void rtl8192_qos_activate(struct work_struct *work)
for (i = 0; i <  QOS_QUEUE_NUM; i++) {
//Mode G/A: slotTimeTimer = 9; Mode B: 20
u1bAIFS = qos_parameters->aifs[i] * ((mode&(IEEE_G|IEEE_N_24G)) 
? 9 : 20) + aSifsTime;
-   u4bAcParam = u32)(qos_parameters->tx_op_limit[i]))<< 
AC_PARAM_TXOP_LIMIT_OFFSET)|
- (((u32)(qos_parameters->cw_max[i]))<< 
AC_PARAM_ECW_MAX_OFFSET)|
- (((u32)(qos_parameters->cw_min[i]))<< 
AC_PARAM_ECW_MIN_OFFSET)|
+   u4bAcParam = 
u32)(le16_to_cpu(qos_parameters->tx_op_limit[i]))) << 
AC_PARAM_TXOP_LIMIT_OFFSET)|
+ (((u32)(le16_to_cpu(qos_parameters->cw_max[i]))) 
<< AC_PARAM_ECW_MAX_OFFSET)|
+ (((u32)(le16_to_cpu(qos_parameters->cw_min[i]))) 
<< AC_PARAM_ECW_MIN_OFFSET)|
  ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET));
 
write_nic_dword(dev, WDCAPARA_ADD[i], u4bAcParam);
-- 
1.7.10.4

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


[PATCH 2/2] staging: rtl8192u: Fix checkpatch.pl warnings

2014-10-12 Thread Koray Gulcu
This patch fixes "line over 80 characters" warnings found in the first patch by 
breaking u4bAcParam's calculation down into a few steps.

Signed-off-by: Koray Gulcu 
---
 drivers/staging/rtl8192u/r8192U_core.c |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 49b40ea..e031a25 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1821,8 +1821,11 @@ static void rtl8192_qos_activate(struct work_struct 
*work)
struct net_device *dev = priv->ieee80211->dev;
struct ieee80211_qos_parameters *qos_parameters = 
&priv->ieee80211->current_network.qos_data.parameters;
u8 mode = priv->ieee80211->current_network.mode;
-   u8  u1bAIFS;
+   u32  u1bAIFS;
u32 u4bAcParam;
+   u32 op_limit;
+   u32 cw_max;
+   u32 cw_min;
int i;
 
mutex_lock(&priv->mutex);
@@ -1835,11 +1838,14 @@ static void rtl8192_qos_activate(struct work_struct 
*work)
for (i = 0; i <  QOS_QUEUE_NUM; i++) {
//Mode G/A: slotTimeTimer = 9; Mode B: 20
u1bAIFS = qos_parameters->aifs[i] * ((mode&(IEEE_G|IEEE_N_24G)) 
? 9 : 20) + aSifsTime;
-   u4bAcParam = 
u32)(le16_to_cpu(qos_parameters->tx_op_limit[i]))) << 
AC_PARAM_TXOP_LIMIT_OFFSET)|
- (((u32)(le16_to_cpu(qos_parameters->cw_max[i]))) 
<< AC_PARAM_ECW_MAX_OFFSET)|
- (((u32)(le16_to_cpu(qos_parameters->cw_min[i]))) 
<< AC_PARAM_ECW_MIN_OFFSET)|
- ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET));
-
+   u1bAIFS <<= AC_PARAM_AIFS_OFFSET;
+   op_limit = (u32)le16_to_cpu(qos_parameters->tx_op_limit[i]);
+   op_limit <<= AC_PARAM_TXOP_LIMIT_OFFSET;
+   cw_max = (u32)le16_to_cpu(qos_parameters->cw_max[i]);
+   cw_max <<= AC_PARAM_ECW_MAX_OFFSET;
+   cw_min = (u32)le16_to_cpu(qos_parameters->cw_min[i]);
+   cw_min <<= AC_PARAM_ECW_MIN_OFFSET;
+   u4bAcParam = op_limit | cw_max | cw_min | u1bAIFS;
write_nic_dword(dev, WDCAPARA_ADD[i], u4bAcParam);
}
 
-- 
1.7.10.4

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


[PATCH 0/2] staging: rtl8192u: Fix sparse warnings

2014-10-12 Thread Koray Gulcu
The first patch fixes some endianness warnings detected by sparse. The second 
patch amends lines with more than 80 characters in the firs patch.

Koray Gulcu (2):
  staging:rtl8192u: Fix sparse warnings of r8182U_core
  staging:rtl8192u: Fix checkpatch.pl warnings

 drivers/staging/rtl8192u/r8192U_core.c |   22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

-- 
1.7.10.4

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


Re: [PATCH resend] staging, lustre: fix a sparse error

2014-10-12 Thread Al Viro
On Fri, Oct 10, 2014 at 11:21:16AM +0800, WANG Chao wrote:

> I think __user annotation is for no dereferencing in kernel space. In
> this case, I think it's fine to override this error by __force. Because
> they're pointers with identical target types.

Umm...  The real question seems to be whether iovec is the right type in
the first place.  Does ->tx_iov ever contain a vector with _userland_
pointers?  If not, it ought to be struct kvec * instead.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: wlan-ng: prism2 simple style modifications

2014-10-12 Thread Greg KH
On Sun, Oct 12, 2014 at 11:44:07AM -0500, Erich Cordoba Malibran wrote:
> From: Erich Cordoba 
> 
> prism2fw.c
> prism2sta.c
>   Fixed style warning reported by checkpatch.pl
> prism2mib.c
>   Renamed function prism2mib_framenthreshold to
>   meet style guidelines.

You are doing multiple different things here in one patch.  Please break
it up into "one logical thing per patch" and resend them.

thanks,

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


Re: [PATCH] staging: dgap: re-arrange functions for removing forward declarations.

2014-10-12 Thread Greg KH
On Mon, Oct 13, 2014 at 11:34:25AM +0900, Daeseok Youn wrote:
> Re-arrange the functions for removing forward declarations.
> 
> Signed-off-by: Daeseok Youn 
> ---
> This patch has too many changes for re-arranging the functions.
> So I wonder that I should break this up into smaller patches.

Are the .o files identical before and after this patch?  If so, it's
fine.

thanks,

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


Re: [PATCH] staging: wlan-ng: Renamed prism2_fragmenthreshold in prism2mib.c

2014-10-12 Thread Greg KH
On Sun, Oct 12, 2014 at 09:29:32PM -0500, Erich Cordoba Malibran wrote:
> From: Erich Cordoba Malibran 
> 
> Renamed function to fix style issues.

Why is changing a name, to a misspelled one, a "style issue fix"?


> 
> Signed-off-by: Erich Cordoba Malibran 
> ---
>  drivers/staging/wlan-ng/prism2mib.c | 26 +-
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/prism2mib.c 
> b/drivers/staging/wlan-ng/prism2mib.c
> index 0163e06..30d224f 100644
> --- a/drivers/staging/wlan-ng/prism2mib.c
> +++ b/drivers/staging/wlan-ng/prism2mib.c
> @@ -132,12 +132,12 @@ static int prism2mib_excludeunencrypted(struct mibrec 
> *mib,
>   struct p80211msg_dot11req_mibset *msg,
>   void *data);
>  
> -static int prism2mib_fragmentationthreshold(struct mibrec *mib,
> - int isget,
> - wlandevice_t *wlandev,
> - hfa384x_t *hw,
> - struct p80211msg_dot11req_mibset 
> *msg,
> - void *data);
> +static int prism2mib_fragmenthreshold(struct mibrec *mib,
> +   int isget,
> +   wlandevice_t *wlandev,
> +   hfa384x_t *hw,
> +   struct p80211msg_dot11req_mibset *msg,
> +   void *data);
>  
>  static int prism2mib_priv(struct mibrec *mib,
> int isget,
> @@ -198,7 +198,7 @@ static struct mibrec mibtab[] = {
>   {DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
>F_STA | F_READ | F_WRITE,
>HFA384x_RID_FRAGTHRESH, 0, 0,
> -  prism2mib_fragmentationthreshold},
> +  prism2mib_fragmenthreshold},
>   {DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime,
>F_STA | F_READ,
>HFA384x_RID_MAXTXLIFETIME, 0, 0,
> @@ -660,12 +660,12 @@ static int prism2mib_excludeunencrypted(struct mibrec 
> *mib,
>  *
>  */
>  
> -static int prism2mib_fragmentationthreshold(struct mibrec *mib,
> - int isget,
> - wlandevice_t *wlandev,
> - hfa384x_t *hw,
> - struct p80211msg_dot11req_mibset 
> *msg,
> - void *data)
> +static int prism2mib_fragmenthreshold(struct mibrec *mib,
> +   int isget,
> +   wlandevice_t *wlandev,
> +   hfa384x_t *hw,
> +   struct p80211msg_dot11req_mibset *msg,
> +   void *data)
>  {
>   int result;
>   u32 *uint32 = (u32 *) data;
> -- 
> 2.1.2

I don't understand the problem you are trying to solve here, what is it?

confused,

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


[PATCH] staging: wlan-ng: Renamed prism2_fragmenthreshold in prism2mib.c

2014-10-12 Thread Erich Cordoba Malibran
From: Erich Cordoba Malibran 

Renamed function to fix style issues.

Signed-off-by: Erich Cordoba Malibran 
---
 drivers/staging/wlan-ng/prism2mib.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mib.c 
b/drivers/staging/wlan-ng/prism2mib.c
index 0163e06..30d224f 100644
--- a/drivers/staging/wlan-ng/prism2mib.c
+++ b/drivers/staging/wlan-ng/prism2mib.c
@@ -132,12 +132,12 @@ static int prism2mib_excludeunencrypted(struct mibrec 
*mib,
struct p80211msg_dot11req_mibset *msg,
void *data);
 
-static int prism2mib_fragmentationthreshold(struct mibrec *mib,
-   int isget,
-   wlandevice_t *wlandev,
-   hfa384x_t *hw,
-   struct p80211msg_dot11req_mibset 
*msg,
-   void *data);
+static int prism2mib_fragmenthreshold(struct mibrec *mib,
+ int isget,
+ wlandevice_t *wlandev,
+ hfa384x_t *hw,
+ struct p80211msg_dot11req_mibset *msg,
+ void *data);
 
 static int prism2mib_priv(struct mibrec *mib,
  int isget,
@@ -198,7 +198,7 @@ static struct mibrec mibtab[] = {
{DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold,
 F_STA | F_READ | F_WRITE,
 HFA384x_RID_FRAGTHRESH, 0, 0,
-prism2mib_fragmentationthreshold},
+prism2mib_fragmenthreshold},
{DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime,
 F_STA | F_READ,
 HFA384x_RID_MAXTXLIFETIME, 0, 0,
@@ -660,12 +660,12 @@ static int prism2mib_excludeunencrypted(struct mibrec 
*mib,
 *
 */
 
-static int prism2mib_fragmentationthreshold(struct mibrec *mib,
-   int isget,
-   wlandevice_t *wlandev,
-   hfa384x_t *hw,
-   struct p80211msg_dot11req_mibset 
*msg,
-   void *data)
+static int prism2mib_fragmenthreshold(struct mibrec *mib,
+ int isget,
+ wlandevice_t *wlandev,
+ hfa384x_t *hw,
+ struct p80211msg_dot11req_mibset *msg,
+ void *data)
 {
int result;
u32 *uint32 = (u32 *) data;
-- 
2.1.2

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


Re: [PATCH 1/2] staging: rtl8188eu: Fix coding style space missing problems

2014-10-12 Thread hejianet
 Thanks for the suggestion, I will update it later

On Thu, 09 Oct 2014 07:35:59 -0700 from j...@perches.com wrote:
> git ls-files "drivers/staging/rtl8188eu/*.[ch]" | \
>   xargs ./scripts/checkpatch.pl -f --fix-inplace --strict --types=SPACING

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


Re: [PATCH resend] staging, lustre: fix a sparse error

2014-10-12 Thread WANG Chao
On 10/12/14 at 08:17pm, Al Viro wrote:
> On Fri, Oct 10, 2014 at 11:21:16AM +0800, WANG Chao wrote:
> 
> > I think __user annotation is for no dereferencing in kernel space. In
> > this case, I think it's fine to override this error by __force. Because
> > they're pointers with identical target types.
> 
> Umm...  The real question seems to be whether iovec is the right type in
> the first place.  Does ->tx_iov ever contain a vector with _userland_
> pointers?  If not, it ought to be struct kvec * instead.

I'm afraid I'm not familiar with lustre.

[CCing lustre maintainers]

Oleg and Andreas:

Could you answer the Al's question?

For your information, my original post was here:
https://lkml.org/lkml/2014/10/9/135

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