[PATCH -next] staging/goldfish/goldfish_audio: fix a sparse warning

2014-07-22 Thread Robin Schroer
Fix a pointer check to use NULL instead of 0

Warning:
drivers/staging/goldfish/goldfish_audio.c:300:34: warning: Using plain
integer as NULL pointer

Signed-off-by: Robin Schroer 
---
 drivers/staging/goldfish/goldfish_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index 9df4ad8..c89d0b8 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -297,7 +297,7 @@ static int goldfish_audio_probe(struct platform_device 
*pdev)
}
data->buffer_virt = dmam_alloc_coherent(&pdev->dev,
COMBINED_BUFFER_SIZE, &buf_addr, GFP_KERNEL);
-   if (data->buffer_virt == 0) {
+   if (data->buffer_virt == NULL) {
dev_err(&pdev->dev, "allocate buffer failed\n");
return -ENOMEM;
}
-- 
2.0.2

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


Re: XVME 6300 with TSI148 bridge on 64 bit Debian (Linux 3.2.57) vme_user issue

2014-07-22 Thread Maurice Moss
Hi Martyn,

Thanks for your patience with me.  I have a couple of questions for you:

0. I put the SBC with the right settings for Geographical addressing.
I did 2 tests by setting the board in each of the 2 slots available on
my rack and the geo address was detected as 0 in both the cases.  This
means my backplane isn't working or that my SBC isn't talking to the
backplane.
1. Is there a way I can test whether the PCI bridge is working?
2. I don't understand what should be the exact vme base address of my
slave board.  I am now using VDIS8004 set in slot 2,
(http://www.ifh.de/~wischnew/amanda/daq/ces_8004_v10_.pdf) set to VME
short A16 (The static rotatory switches set to 2 and 2).  Based on
this my address would be 0x2200?  Any clarification or pointing me in
the right direction would be sincerely appreciated :-/
3. When I do reads with what I believe is the correct address, I get
back '0xff' characters all the time, and if I do it frequently enough
I manage to crash the computer (with no logs on the dmesg, and reboot
needed with a forced fsck).  I am now trying to probe the kernel
module adding print statements, and trying to build it out of tree.

Cheers,
Maurice

PS: Here is what I get when I do an 'lspci -v':

03:00.0 PCI bridge: PLX Technology, Inc. PEX 8114 PCI
Express-to-PCI/PCI-X Bridge (rev bd) (prog-if 00 [Normal decode])
Physical Slot: 0
Flags: bus master, fast devsel, latency 0
Memory at d400 (32-bit, non-prefetchable) [size=8K]
Bus: primary=03, secondary=04, subordinate=04, sec-latency=64
Memory behind bridge: d000-d3ff
Capabilities: 

04:04.0 Bridge: Tundra Semiconductor Corp. Tsi148 [Tempe] (rev 01)
Subsystem: Tundra Semiconductor Corp. Device 
Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 16
Memory at d000 (64-bit, non-prefetchable) [size=4K]
Capabilities: 
Kernel driver in use: vme_tsi148

On Wed, Jul 16, 2014 at 12:47 AM, Martyn Welch  wrote:
>
>
> On 14/07/14 19:29, Maurice Moss wrote:
>>
>> Hi all,
>>
>> I have updated my Linux Kernel to the latest.  I am on Debian 64bit
>> 3.15.5.  I issue the following Kernel command line, and the vme_user
>> module seems to load correctly, however the vme bus is neither mounted
>> on /dev nor /proc.
>>
>
> Just to make sure, you're looking under /dev/bus/vme?
>
>
>> I was earlier using a 3.2 debian 32bit and managed to mount the vme
>> bus by following the exact same procedure of rebuilding the kernel
>> with vme_user module.  Any help is appreciated.  Here is what I see on
>> dmesg.
>>
>> [0.00] Kernel command line:
>> BOOT_IMAGE=/boot/vmlinuz-3.15.5-vme
>> root=UUID=4cdc2e84-9fbc-471c-9eb4-fde8f0b1ce96 ro vme_user.bus=0
>> vme_tsi148.err_chk=1 quiet
>> [1.754278] vme_user: VME User Space Access Driver
>> [1.754695] vme_tsi148 :04:04.0: Board is the VME system controller
>> [1.754700] vme_tsi148 :04:04.0: VME geographical address is 0
>> [1.754704] vme_tsi148 :04:04.0: VME Write and flush and error
>> check is enabled
>> [1.754942] vme_tsi148 :04:04.0: CR/CSR Offset: 0
>> [1.754948] vme_tsi148 :04:04.0: Enabling CR/CSR space
>>
>> Cheers!
>>
>
> It's unfortunately going to take me a while to get everything together to
> take a look, some of my old installs I've been eeking along for a while to
> do adhoc VME tests are now broken :-(
>
> Martyn
>
>
>> On Thu, Jul 3, 2014 at 8:18 AM, Maurice Moss 
>> wrote:
>>>
>>> Martyn,
>>>
>>> OK.  I feel like I am not clear.  The kernel command line has a space,
>>> but the line here in the email doesn't (I don't know how that
>>> happened).  I am still stuck with the same issue.
>>>
>>> Sorry for all the confusion
>>>
>>>
>>> On Thu, Jul 3, 2014 at 8:15 AM, Maurice Moss 
>>> wrote:

 Yes, copy and paste issue, I had double checked that right after I
 sent you the mail.  Sorry!!

 On Thu, Jul 3, 2014 at 3:47 AM, Martyn Welch 
 wrote:
>
>
>
> On 03/07/14 00:47, Maurice Moss wrote:
>>
>>
>> I upgraded to linux kernel 3.14.9 (on Fedora).  Re-compiled the kernel
>> with the vme support etc.  I now get the below in my log, and don't
>> see any vme related files in /dev !!
>>
>> [0.00] Kernel command line: BOOT_IMAGE=/vmlinuz-3.14.9
>> root=UUID=aee6e594-4be8-46d4-abe6-7c054ef239b0 ro
>> vconsole.font=latarcyrheb-sun16 vme_user.bus=0vme_tsi148.err_chk=1
>> rhgb quiet
>
>
>
> Unless this is a copy and paste issue, you seem to be missing a space
> between "vme_user.bus=0" and "vme_tsi148.err_chk=1".
>
>
> Martyn
>
> --
> Martyn Welch (Lead Software Engineer)  | Registered in England and
> Wales
> GE Intelligent Platforms   | (3828642) at 100 Barbirolli
> Square
> T +44(0)1327322748 | Manchester, M2 3AB
> E martyn.we...@ge.com  | VAT:GB 927559189
>
>
> --

[PATCH 1/1] Staging: comedi: amplc_pc236: a blank line inserted

2014-07-22 Thread Sam Asadi
A 'Missing a blank line after declarations' warning fixed by inserting
a blank line after struct pointer declaration.

Signed-off-by: Sam Asadi 
---
 drivers/staging/comedi/drivers/amplc_pc236.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index c9a96ad..d0f81f8 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -515,6 +515,7 @@ static void pc236_detach(struct comedi_device *dev)
comedi_legacy_detach(dev);
} else if (is_pci_board(thisboard)) {
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
+
if (dev->irq)
free_irq(dev->irq, dev);
comedi_pci_disable(dev);
-- 
1.7.10.4

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


[PATCH] hyperv: Fix error return code in netvsc_init_buf()

2014-07-22 Thread weiyj_lk
From: Wei Yongjun 

Fix to return -ENOMEM from the kalloc error handling
case instead of 0.

Signed-off-by: Wei Yongjun 
---
 drivers/net/hyperv/netvsc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 4ed38ea..d97d5f3 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -378,8 +378,10 @@ static int netvsc_init_buf(struct hv_device *device)
 
net_device->send_section_map =
kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL);
-   if (net_device->send_section_map == NULL)
+   if (net_device->send_section_map == NULL) {
+   ret = -ENOMEM;
goto cleanup;
+   }
 
goto exit;
 

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


[PATCH v2 2/2] staging: cxt1e1: Fix static symbol sparse warnings for global vars in linux.c

2014-07-22 Thread Jeff Oczek
Put extern declarations in cxt1e1_common.h to reduce sparse warnings for 
linux.c:

drivers/staging/cxt1e1/linux.c:86:13: warning:
  symbol 'cxt1e1_error_flag' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:91:13: warning:
  symbol 'cxt1e1_max_mru' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:95:13: warning:
  symbol 'cxt1e1_max_mtu' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:96:13: warning:
  symbol 'cxt1e1_max_mtu_default' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:100:13: warning:
  symbol 'cxt1e1_max_txdesc_default' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:101:13: warning:
  symbol 'cxt1e1_max_txdesc_used' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:105:13: warning:
  symbol 'cxt1e1_max_rxdesc_default' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:106:13: warning:
  symbol 'cxt1e1_max_rxdesc_used' was not declared. Should it be static?

Signed-off-by: Jeff Oczek 
---
 drivers/staging/cxt1e1/cxt1e1_common.h | 14 ++
 drivers/staging/cxt1e1/hwprobe.c   |  2 +-
 drivers/staging/cxt1e1/linux.c |  1 +
 drivers/staging/cxt1e1/musycc.c|  5 +
 drivers/staging/cxt1e1/pmcc4_drv.c |  5 +
 5 files changed, 18 insertions(+), 9 deletions(-)
 create mode 100644 drivers/staging/cxt1e1/cxt1e1_common.h

diff --git a/drivers/staging/cxt1e1/cxt1e1_common.h 
b/drivers/staging/cxt1e1/cxt1e1_common.h
new file mode 100644
index 000..c6634ea
--- /dev/null
+++ b/drivers/staging/cxt1e1/cxt1e1_common.h
@@ -0,0 +1,14 @@
+#ifndef __CXT1E1_COMMON_H
+#define __CXT1E1_COMMON_H
+
+extern int cxt1e1_error_flag;
+extern int cxt1e1_max_mru;
+extern int cxt1e1_max_mtu;
+extern int cxt1e1_max_mtu_default;
+extern int cxt1e1_max_txdesc_used;
+extern int cxt1e1_max_txdesc_default;
+extern int cxt1e1_max_rxdesc_used;
+extern int cxt1e1_max_rxdesc_default;
+
+#endif
+
diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index 9eb0313..3f7bf70 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -30,8 +30,8 @@
 #ifdef CONFIG_PROC_FS
 #include "sbeproc.h"
 #endif
+#include "cxt1e1_common.h"
 
-extern int  cxt1e1_error_flag;
 extern int  drvr_state;
 
 /* forward references */
diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c
index 07cc142..3dd09a3 100644
--- a/drivers/staging/cxt1e1/linux.c
+++ b/drivers/staging/cxt1e1/linux.c
@@ -30,6 +30,7 @@
 #include "pmcc4_ioctls.h"
 #include "pmcc4_private.h"
 #include "sbeproc.h"
+#include "cxt1e1_common.h"
 
 
/***
  * Error out early if we have compiler trouble.
diff --git a/drivers/staging/cxt1e1/musycc.c b/drivers/staging/cxt1e1/musycc.c
index 5b9b482..aeb8a21 100644
--- a/drivers/staging/cxt1e1/musycc.c
+++ b/drivers/staging/cxt1e1/musycc.c
@@ -34,6 +34,7 @@ static unsigned int max_bh;
 #include "pmcc4_private.h"
 #include "pmcc4.h"
 #include "musycc.h"
+#include "cxt1e1_common.h"
 
 #define sd_find_chan(ci,ch)   c4_find_chan(ch)
 
@@ -43,10 +44,6 @@ static unsigned int max_bh;
 extern ci_t *c4_list;
 extern int  drvr_state;
 
-extern int  cxt1e1_max_mru;
-extern int  cxt1e1_max_mtu;
-extern int  cxt1e1_max_rxdesc_used;
-extern int  cxt1e1_max_txdesc_used;
 extern ci_t *CI;/* dummy pointr to board ZEROE's data - DEBUG
 * USAGE */
 
diff --git a/drivers/staging/cxt1e1/pmcc4_drv.c 
b/drivers/staging/cxt1e1/pmcc4_drv.c
index 99b02a0..a3ec7f9 100644
--- a/drivers/staging/cxt1e1/pmcc4_drv.c
+++ b/drivers/staging/cxt1e1/pmcc4_drv.c
@@ -38,6 +38,7 @@
 #include "musycc.h"
 #include "comet.h"
 #include "sbe_bid.h"
+#include "cxt1e1_common.h"
 
 #define KERN_WARN KERN_WARNING
 
@@ -59,10 +60,6 @@ voidmusycc_update_timeslots (mpi_t *);
 
 extern void musycc_update_tx_thp (mch_t *);
 extern int  cxt1e1_log_level;
-extern int  cxt1e1_max_mru;
-extern int  cxt1e1_max_mtu;
-extern int  cxt1e1_max_rxdesc_used, cxt1e1_max_rxdesc_default;
-extern int  cxt1e1_max_txdesc_used, cxt1e1_max_txdesc_default;
 
 #if defined (__powerpc__)
 extern void *memset (void *s, int c, size_t n);
-- 
1.9.1

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


[PATCH v2 1/2] staging: cxt1e1: Prefix ambiguous variable names with 'cxt1e1_' for clarity

2014-07-22 Thread Jeff Oczek
Changed names of ambiguous sounding variable names as follows

error_flag  ->  cxt1e1_error_flag
max_mtu_default ->  cxt1e1_max_mtu_default
max_txdesc_used ->  cxt1e1_max_txdesc_used
max_txdesc_default  ->  cxt1e1_max_txdesc_default
max_rxdesc_used ->  cxt1e1_max_rxdesc_used
max_rxdesc_default  ->  cxt1e1_max_rxdesc_default

Since max_txdesc_used, max_rxdesc_used are module parameters, these were
changed from global to static and the module init function assigns the values
to the newly named global variables

Signed-off-by: Jeff Oczek 
---
 drivers/staging/cxt1e1/hwprobe.c   |  7 ++---
 drivers/staging/cxt1e1/linux.c | 53 +-
 drivers/staging/cxt1e1/musycc.c|  4 +--
 drivers/staging/cxt1e1/pmcc4_drv.c | 22 +---
 drivers/staging/cxt1e1/sbeproc.c   |  6 ++---
 5 files changed, 51 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index 4fa27c8..9eb0313 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -31,7 +31,7 @@
 #include "sbeproc.h"
 #endif
 
-extern int  error_flag;
+extern int  cxt1e1_error_flag;
 extern int  drvr_state;
 
 /* forward references */
@@ -294,7 +294,7 @@ c4hw_attach_all(void)
struct pci_dev *pdev = NULL;
int found = 0, i, j;
 
-   error_flag = 0;
+   cxt1e1_error_flag = 0;
prep_hdw_info();
/*** scan PCI bus for all possible boards */
while ((pdev = pci_get_device(PCI_VENDOR_ID_CONEXANT,
@@ -372,7 +372,8 @@ c4hw_attach_all(void)
 #if 0
cleanup_devs();
 #endif
-   return error_flag; /* error_flag set w/in add_dev() */
+   /* cxt1e1_error_flag set w/in add_dev() */
+   return cxt1e1_error_flag;
}
show_two(hi, i); /* displays found information */
}
diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c
index 09f3d5c..07cc142 100644
--- a/drivers/staging/cxt1e1/linux.c
+++ b/drivers/staging/cxt1e1/linux.c
@@ -83,7 +83,7 @@ int musycc_start_xmit(ci_t *, int, void *);
 extern ci_t *CI;
 extern struct s_hdw_info hdw_info[];
 
-int error_flag; /* module load error reporting */
+int cxt1e1_error_flag; /* module load error reporting */
 int cxt1e1_log_level = LOG_ERROR;
 static int  log_level_default = LOG_ERROR;
 module_param(cxt1e1_log_level, int, 0444);
@@ -93,15 +93,17 @@ static int  max_mru_default = MUSYCC_MRU;
 module_param(cxt1e1_max_mru, int, 0444);
 
 int cxt1e1_max_mtu = MUSYCC_MTU;
-int max_mtu_default = MUSYCC_MTU;
+int cxt1e1_max_mtu_default = MUSYCC_MTU;
 module_param(cxt1e1_max_mtu, int, 0444);
 
-int max_txdesc_used = MUSYCC_TXDESC_MIN;
-int max_txdesc_default = MUSYCC_TXDESC_MIN;
+static int  max_txdesc_used = MUSYCC_TXDESC_MIN;
+int cxt1e1_max_txdesc_default = MUSYCC_TXDESC_MIN;
+intcxt1e1_max_txdesc_used = MUSYCC_TXDESC_MIN;
 module_param(max_txdesc_used, int, 0444);
 
-int max_rxdesc_used = MUSYCC_RXDESC_MIN;
-int max_rxdesc_default = MUSYCC_RXDESC_MIN;
+static int  max_rxdesc_used = MUSYCC_RXDESC_MIN;
+int cxt1e1_max_rxdesc_default = MUSYCC_RXDESC_MIN;
+intcxt1e1_max_rxdesc_used = MUSYCC_RXDESC_MIN;
 module_param(max_rxdesc_used, int, 0444);
 
 //
@@ -921,7 +923,7 @@ c4_add_dev(hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
if (!ndev) {
pr_warning("%s: no memory for struct net_device !\n",
   hi->devname);
-   error_flag = -ENOMEM;
+   cxt1e1_error_flag = -ENOMEM;
return NULL;
}
ci = (ci_t *)(netdev_priv(ndev));
@@ -956,7 +958,7 @@ c4_add_dev(hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
(c4_init(ci, (u_char *) f0, (u_char *) f1) != 
SBE_DRVR_SUCCESS)) {
kfree(netdev_priv(ndev));
kfree(ndev);
-   error_flag = -ENODEV;
+   cxt1e1_error_flag = -ENODEV;
return NULL;
}
/*
@@ -982,7 +984,7 @@ c4_add_dev(hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
unregister_netdev(ndev);
kfree(netdev_priv(ndev));
kfree(ndev);
-   error_flag = -EIO;
+   cxt1e1_error_flag = -EIO;
return NULL;
}
 #ifdef CONFIG_SBE_PMCC4_NCOMM
@@ -992,7 +994,7 @@ c4_add_dev(hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
free_irq(irq0, ndev);
kfree(netdev_priv(ndev));
kfree(ndev);
-   error_flag = -EIO;
+   cxt1e1_error_flag = -EIO;
   

[PATCH v2 0/2] staging: cxt1e1: Fix ambiguous global var names, reduce sparse warnings

2014-07-22 Thread Jeff Oczek
This patch set:
changes ambiguous global names, such as "error_flag" to "cxt1e1_error_flag"
puts globals in header file to reduce externs used in c files as well as sparse 
warnings

Jeff Oczek (2):
  staging: cxt1e1: Prefix ambiguous variable names with 'cxt1e1_' for
clarity
  staging: cxt1e1: Fix static symbol sparse warnings for global vars in
linux.c

 drivers/staging/cxt1e1/cxt1e1_common.h | 14 +
 drivers/staging/cxt1e1/hwprobe.c   |  7 +++--
 drivers/staging/cxt1e1/linux.c | 54 +++---
 drivers/staging/cxt1e1/musycc.c|  5 +---
 drivers/staging/cxt1e1/pmcc4_drv.c | 23 +++
 drivers/staging/cxt1e1/sbeproc.c   |  6 ++--
 6 files changed, 64 insertions(+), 45 deletions(-)
 create mode 100644 drivers/staging/cxt1e1/cxt1e1_common.h

-- 
1.9.1

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


Re: [PATCH 5/8 v2] staging: unisys: move parahotplug to sysfs

2014-07-22 Thread Greg KH
On Tue, Jul 22, 2014 at 09:56:29AM -0400, Benjamin Romer wrote:
> Move the /proc/visorchipset/parahotplug interface to sysfs under
> /sys/devices/platform/visorchipset/guest/parahotplug.
> 
> The parahotplug interface is used to deal with recovery situations on s-Par
> guest partitions. The command service partition will send a message to a guest
> when a device that guest is using needs to be temporarily removed. The message
> triggers a udev event that will cause a recovery script to run. When that
> script has completed its work, it will write to the parahotplug interface to
> send a message back to Command indicating that it is safe to remove the 
> device.
> 
> Moving this interface to sysfs orphans the visorchipset_proc_read_writeonly()
> function, so it is also removed.
> 
> Signed-off-by: Benjamin Romer 
> ---
> v2: attribute creation was fixed and checks for controlvm_channel pointer were
> removed.
> 
>  .../unisys/visorchipset/visorchipset_main.c| 59 
> --
>  1 file changed, 11 insertions(+), 48 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
> b/drivers/staging/unisys/visorchipset/visorchipset_main.c
> index 74ab15b..c88f95f 100644
> --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
> +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
> @@ -129,19 +129,12 @@ static MYPROCTYPE *PartitionType;
>  #define VISORCHIPSET_DIAG_PROC_ENTRY_FN "diagdump"
>  static struct proc_dir_entry *diag_proc_dir;
>  
> -#define VISORCHIPSET_PARAHOTPLUG_PROC_ENTRY_FN "parahotplug"
> -static struct proc_dir_entry *parahotplug_proc_dir;
> -
>  static LIST_HEAD(BusInfoList);
>  static LIST_HEAD(DevInfoList);
>  
>  static struct proc_dir_entry *ProcDir;
>  static VISORCHANNEL *ControlVm_channel;
>  
> -static ssize_t visorchipset_proc_read_writeonly(struct file *file,
> - char __user *buf,
> - size_t len, loff_t *offset);
> -
>  typedef struct {
>   U8 __iomem *ptr;/* pointer to base address of payload pool */
>   U64 offset; /* offset from beginning of controlvm
> @@ -324,6 +317,10 @@ static ssize_t chipsetready_store(struct device *dev,
>   struct device_attribute *attr, const char *buf, size_t count);
>  static DEVICE_ATTR_WO(chipsetready);
>  
> +static ssize_t parahotplug_store(struct device *dev,
> + struct device_attribute *attr, const char *buf, size_t count);
> +static DEVICE_ATTR_WO(parahotplug);
> +
>  static struct attribute *visorchipset_install_attrs[] = {
>   &dev_attr_toolaction.attr,
>   &dev_attr_boottotool.attr,
> @@ -340,6 +337,7 @@ static struct attribute_group visorchipset_install_group 
> = {
>  
>  static struct attribute *visorchipset_guest_attrs[] = {
>   &dev_attr_chipsetready.attr,
> + &dev_attr_parahotplug.attr,
>   NULL
>  };
>  
> @@ -1812,30 +1810,17 @@ parahotplug_process_message(CONTROLVM_MESSAGE *inmsg)
>  
>  /*
>   * Gets called when the udev script writes to
> - * /proc/visorchipset/parahotplug.  Expects input in the form of "
> - * " where  is the identifier passed to the script that
> - * matches a request on the request list, and  is 0 or 1
> - * indicating whether the device is now enabled or not.
> + * /sys/devices/platform/visorchipset/guest/parahotplug.
> + * Expects input in the form of " " where  is the identifier
> + * passed to the script that matches a request on the request list, and 
> 
> + * is 0 or 1 indicating whether the device is now enabled or not.

Why isn't this information in the ABI file?

Also, 2 values for one sysfs file?  Not acceptable, sorry.

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


Re: [PATCH 4/8 v2] staging: unisys: move chipsetready to sysfs

2014-07-22 Thread Greg KH
On Tue, Jul 22, 2014 at 09:56:28AM -0400, Benjamin Romer wrote:
> Move the chipsetready proc entry to sysfs under a new directory guest. This
> entry is used by Unisys application software on the guest to acknowledge
> completion of specific events for integration purposes, but these
> acknowledgements are not required for the guest to operate correctly.
> 
> The store function is simplified as well, to use scanf() instead of copying
> the buffer and using strsep().
> 
> Signed-off-by: Benjamin Romer 
> ---
> v2: attribute creation was fixed and checks for controlvm_channel pointer were
> removed. The off-by-one error in the sscanf() was fixed. Error -1 that was 
> being returned was changed to -EINVAL.
> 
>  .../unisys/visorchipset/visorchipset_main.c| 88 
> --
>  1 file changed, 33 insertions(+), 55 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
> b/drivers/staging/unisys/visorchipset/visorchipset_main.c
> index a20e21b..74ab15b 100644
> --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
> +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
> @@ -129,9 +129,6 @@ static MYPROCTYPE *PartitionType;
>  #define VISORCHIPSET_DIAG_PROC_ENTRY_FN "diagdump"
>  static struct proc_dir_entry *diag_proc_dir;
>  
> -#define VISORCHIPSET_CHIPSET_PROC_ENTRY_FN "chipsetready"
> -static struct proc_dir_entry *chipset_proc_dir;
> -
>  #define VISORCHIPSET_PARAHOTPLUG_PROC_ENTRY_FN "parahotplug"
>  static struct proc_dir_entry *parahotplug_proc_dir;
>  
> @@ -323,6 +320,10 @@ static ssize_t remaining_steps_store(struct device *dev,
>   struct device_attribute *attr, const char *buf, size_t count);
>  static DEVICE_ATTR_RW(remaining_steps);
>  
> +static ssize_t chipsetready_store(struct device *dev,
> + struct device_attribute *attr, const char *buf, size_t count);
> +static DEVICE_ATTR_WO(chipsetready);
> +
>  static struct attribute *visorchipset_install_attrs[] = {
>   &dev_attr_toolaction.attr,
>   &dev_attr_boottotool.attr,
> @@ -337,8 +338,19 @@ static struct attribute_group visorchipset_install_group 
> = {
>   .attrs = visorchipset_install_attrs
>  };
>  
> +static struct attribute *visorchipset_guest_attrs[] = {
> + &dev_attr_chipsetready.attr,
> + NULL
> +};
> +
> +static struct attribute_group visorchipset_guest_group = {
> + .name = "guest",
> + .attrs = visorchipset_guest_attrs
> +};
> +
>  static const struct attribute_group *visorchipset_dev_groups[] = {
>   &visorchipset_install_group,
> + &visorchipset_guest_group,
>   NULL
>  };
>  
> @@ -2369,49 +2381,27 @@ visorchipset_cache_free(struct kmem_cache *pool, void 
> *p, char *fn, int ln)
>   kmem_cache_free(pool, p);
>  }
>  
> -#define gettoken(bufp) strsep(bufp, " -\t\n")
> -
> -static ssize_t
> -chipset_proc_write(struct file *file, const char __user *buffer,
> -size_t count, loff_t *ppos)
> +ssize_t chipsetready_store(struct device *dev, struct device_attribute *attr,
> + const char *buf, size_t count)

Shouldn't this, and your other sysfs file attribute functions, be
static?   You said they were above, but not here, so, which does the
compiler decide to use?  I think the last one, but please be consistant.

Same goes for all of the patches in this series...

thanks,

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


Re: [PATCH 4/8 v2] staging: unisys: move chipsetready to sysfs

2014-07-22 Thread Greg KH
On Tue, Jul 22, 2014 at 09:56:28AM -0400, Benjamin Romer wrote:
> Move the chipsetready proc entry to sysfs under a new directory guest. This
> entry is used by Unisys application software on the guest to acknowledge
> completion of specific events for integration purposes, but these
> acknowledgements are not required for the guest to operate correctly.
> 
> The store function is simplified as well, to use scanf() instead of copying
> the buffer and using strsep().
> 
> Signed-off-by: Benjamin Romer 
> ---
> v2: attribute creation was fixed and checks for controlvm_channel pointer were
> removed. The off-by-one error in the sscanf() was fixed. Error -1 that was 
> being returned was changed to -EINVAL.
> 
>  .../unisys/visorchipset/visorchipset_main.c| 88 
> --
>  1 file changed, 33 insertions(+), 55 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
> b/drivers/staging/unisys/visorchipset/visorchipset_main.c
> index a20e21b..74ab15b 100644
> --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
> +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
> @@ -129,9 +129,6 @@ static MYPROCTYPE *PartitionType;
>  #define VISORCHIPSET_DIAG_PROC_ENTRY_FN "diagdump"
>  static struct proc_dir_entry *diag_proc_dir;
>  
> -#define VISORCHIPSET_CHIPSET_PROC_ENTRY_FN "chipsetready"
> -static struct proc_dir_entry *chipset_proc_dir;
> -
>  #define VISORCHIPSET_PARAHOTPLUG_PROC_ENTRY_FN "parahotplug"
>  static struct proc_dir_entry *parahotplug_proc_dir;
>  
> @@ -323,6 +320,10 @@ static ssize_t remaining_steps_store(struct device *dev,
>   struct device_attribute *attr, const char *buf, size_t count);
>  static DEVICE_ATTR_RW(remaining_steps);
>  
> +static ssize_t chipsetready_store(struct device *dev,
> + struct device_attribute *attr, const char *buf, size_t count);
> +static DEVICE_ATTR_WO(chipsetready);
> +
>  static struct attribute *visorchipset_install_attrs[] = {
>   &dev_attr_toolaction.attr,
>   &dev_attr_boottotool.attr,
> @@ -337,8 +338,19 @@ static struct attribute_group visorchipset_install_group 
> = {
>   .attrs = visorchipset_install_attrs
>  };
>  
> +static struct attribute *visorchipset_guest_attrs[] = {
> + &dev_attr_chipsetready.attr,
> + NULL
> +};
> +
> +static struct attribute_group visorchipset_guest_group = {
> + .name = "guest",
> + .attrs = visorchipset_guest_attrs
> +};
> +
>  static const struct attribute_group *visorchipset_dev_groups[] = {
>   &visorchipset_install_group,
> + &visorchipset_guest_group,
>   NULL
>  };
>  
> @@ -2369,49 +2381,27 @@ visorchipset_cache_free(struct kmem_cache *pool, void 
> *p, char *fn, int ln)
>   kmem_cache_free(pool, p);
>  }
>  
> -#define gettoken(bufp) strsep(bufp, " -\t\n")
> -
> -static ssize_t
> -chipset_proc_write(struct file *file, const char __user *buffer,
> -size_t count, loff_t *ppos)
> +ssize_t chipsetready_store(struct device *dev, struct device_attribute *attr,
> + const char *buf, size_t count)
>  {
> - char buf[512];
> - char *token, *p;
> -
> - if (count > sizeof(buf) - 1) {
> - LOGERR("chipset_proc_write: count (%d) exceeds size of buffer 
> (%d)",
> -  (int) count, (int) sizeof(buffer));
> - return -EINVAL;
> - }
> - if (copy_from_user(buf, buffer, count)) {
> - LOGERR("chipset_proc_write: copy_from_user failed");
> - return -EFAULT;
> - }
> - buf[count] = '\0';
> -
> - p = buf;
> - token = gettoken(&p);
> -
> - if (strcmp(token, "CALLHOMEDISK_MOUNTED") == 0) {
> - token = gettoken(&p);
> - /* The Call Home Disk has been mounted */
> - if (strcmp(token, "0") == 0)
> - chipset_events[0] = 1;
> - } else if (strcmp(token, "MODULES_LOADED") == 0) {
> - token = gettoken(&p);
> - /* All modules for the partition have been loaded */
> - if (strcmp(token, "0") == 0)
> - chipset_events[1] = 1;
> - } else if (token == NULL) {
> - /* No event specified */
> - LOGERR("No event was specified to send CHIPSET_READY response");
> - return -1;
> + char msgtype[64];
> + int msgparam;
> +
> + if (sscanf(buf, "%63s %d", msgtype, &msgparam) == 2) {

2 values in one sysfs file?  Not good :(

Why?

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


Re: [PATCH 8/8 v2] staging: unisys: ABI documentation for new sysfs entries

2014-07-22 Thread Greg KH
On Tue, Jul 22, 2014 at 09:56:32AM -0400, Benjamin Romer wrote:
> This patch adds a documentation file for all of the interfaces that were moved
> to sysfs by the other patches in this set.
> 
> Signed-off-by: Benjamin Romer 
> ---
> v2: whitespace errors were corrected.
> 
>  .../Documentation/ABI/sysfs-platform-visorchipset  | 74 
> ++
>  1 file changed, 74 insertions(+)
>  create mode 100644 
> drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
> 
> diff --git 
> a/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset 
> b/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
> new file mode 100644
> index 000..b6cad24
> --- /dev/null
> +++ b/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
> @@ -0,0 +1,74 @@
> +What:install/error
> +Date:7/18/2014
> +KernelVersion:   TBD
> +Contact: sparmaintai...@unisys.com
> +Description: used to send the ID of a string that should be displayed on
> + s-Par's automatic installation progress screen when an error
> + is encountered during installation. This field has no effect
> + if not in installation mode.
> +Users:   sparmaintai...@unisys.com
> +
> +What:install/remainingsteps
> +Date:7/18/2014
> +KernelVersion:   TBD
> +Contact: sparmaintai...@unisys.com
> +Description: used to set the value of the progress bar on the s-Par automatic
> + installation progress screen. This field has no effect if not in
> + installation mode.
> +Users:   sparmaintai...@unisys.com
> +
> +What:install/textid
> +Date:7/18/2014
> +KernelVersion:   TBD
> +Contact: sparmaintai...@unisys.com
> +Description: used to send the ID of a string that should be displayed on
> + s-Par's automatic installation progress screen. Setting this
> + field when not in installation mode (boottotool was set on
> + the previous guest boot) has no effect.
> +Users:   sparmaintai...@unisys.com
> +
> +What:install/boottotool
> +Date:7/18/2014
> +KernelVersion:   TBD
> +Contact: sparmaintai...@unisys.com
> +Description: The boottotool flag controls s-Par behavior on the next boot of
> + this guest. Setting the flag will cause the guest to boot from
> + the utility and installation image, which will use the value in
> + the toolaction field to determine what operation is being
> + requested.
> +Users:   sparmaintai...@unisys.com
> +
> +What:install/toolaction
> +Date:7/18/2014
> +KernelVersion:   TBD
> +Contact: sparmaintai...@unisys.com
> +Description: This field is used to tell s-Par which type of recovery tool
> + action to perform on the next guest boot-up. The meaning of the
> + value is dependent on the type of installation software used to
> + commission the guest.
> +Users:   sparmaintai...@unisys.com
> +
> +What:guest/chipsetready
> +Date:7/18/2014
> +KernelVersion:   TBD
> +Contact: sparmaintai...@unisys.com
> +Description: This entry is used by Unisys application software on the guest
> + to acknowledge completion of specific events for integration
> + purposes, but these acknowledgements are not required for the
> + guest to operate correctly.
> +Users:   sparmaintai...@unisys.com

What is the format of the chipsetready file?  It looks like you want to
write 2 values to it?  Please describe it better, for all of these.

thanks,

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


Re: [PATCH 3/8 v2] staging: unisys: move installer to sysfs and split fields

2014-07-22 Thread Greg KH
On Tue, Jul 22, 2014 at 09:56:27AM -0400, Benjamin Romer wrote:
> The installer entry in /proc/visorchipset/installer was composed of three
> separate fields as one entry. This patch removes the proc entry and associated
> functions, and creates new fields with distinct entries under sysfs in the
> visorchipset/install directory. The fields are:
> 
>   textid: used to send the ID of a string that should be displayed on
>   s-Par's automatic installation progress screen. Setting this
>   field when not in installation mode (boottotool was set on
>   the previous guest boot) has no effect.
> 
>   remaining_steps: used to set the value of the progress bar on the
>   s-Par automatic installation progress screen. This field has
>   no effect if not in installation mode.
> 
>   error: used to send the ID of a string that should be displayed on
>   s-Par's automatic installation progress screen when an error
>   is encountered during installation. This field has no effect
>   if not in installation mode.
> 
> Signed-off-by: Benjamin Romer 
> ---
> v2: attribute creation was fixed and checks for controlvm_channel pointer were
> removed.
> 
>  .../unisys/visorchipset/visorchipset_main.c| 233 
> ++---
>  1 file changed, 106 insertions(+), 127 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
> b/drivers/staging/unisys/visorchipset/visorchipset_main.c
> index 48db6ee..a20e21b 100644
> --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
> +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
> @@ -144,16 +144,6 @@ static VISORCHANNEL *ControlVm_channel;
>  static ssize_t visorchipset_proc_read_writeonly(struct file *file,
>   char __user *buf,
>   size_t len, loff_t *offset);
> -static ssize_t proc_read_installer(struct file *file, char __user *buf,
> -size_t len, loff_t *offset);
> -static ssize_t proc_write_installer(struct file *file,
> - const char __user *buffer,
> - size_t count, loff_t *ppos);
> -
> -static const struct file_operations proc_installer_fops = {
> - .read = proc_read_installer,
> - .write = proc_write_installer,
> -};
>  
>  typedef struct {
>   U8 __iomem *ptr;/* pointer to base address of payload pool */
> @@ -315,9 +305,30 @@ static ssize_t boottotool_store(struct device *dev,
>   struct device_attribute *attr, const char *buf, size_t count);
>  static DEVICE_ATTR_RW(boottotool);
>  
> +static ssize_t error_show(struct device *dev, struct device_attribute *attr,
> + char *buf);
> +static ssize_t error_store(struct device *dev, struct device_attribute *attr,
> + const char *buf, size_t count);
> +static DEVICE_ATTR_RW(error);
> +
> +static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
> + char *buf);
> +static ssize_t textid_store(struct device *dev,  struct device_attribute 
> *attr,

You have an extra tab character in this line :(



> +ssize_t remaining_steps_show(struct device *dev, struct device_attribute 
> *attr,
> + char *buf)
> +{
> + U16 remainingSteps;

Minor nit, I took your previous patch, but as this needs to be redone,
plese, for new functions, use the proper kernel variable types, like
u16 here, not made-up-ones-for-this-driver-alone.

thanks,

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


Re: [PATCH 1/5] staging: vt6655: change type of PortOffset to void __iomem *

2014-07-22 Thread Greg Kroah-Hartman
On Tue, Jul 22, 2014 at 10:08:26PM +0200, Guillaume Clement wrote:
> PortOffset was an unsigned long, but used as an pointer to io
> memory. Sometimes it was not properly cast before use, which caused
> many warning by sparse.
> 
> By updating its type to void __iomem *, and reflecting the changes
> where it is needed, this removes most of those warnings.

Nice job, that's the correct way to fix this.

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


Re: [PATCH] staging: cxt1e1: Fix static symbol sparse warnings for global vars in linux.c

2014-07-22 Thread Greg KH
On Tue, Jul 22, 2014 at 04:56:59PM -0400, Jeff Oczek wrote:
> On Tue, Jul 22, 2014 at 01:17:22PM -0700, Greg KH wrote:
> > On Tue, Jul 22, 2014 at 04:07:51PM -0400, Jeff Oczek wrote:
> > > Put extern declarations in cxt1e1_common.h to reduce sparse warnings for 
> > > linux.c:
> > 
> > I know you didn't name this variable, but wow, that's a horrid name for
> > a global variable :)
> > 
> > Any way you could change this to first fix up the name of the variable
> > to something a bit more "device-specific" first, before this patch?
> > 
> > Perhaps "cxt1e1_error_flag"?
> > 
> > > +extern int cxt1e1_max_mru;
> > > +extern int cxt1e1_max_mtu;
> > 
> > These are fine.
> > 
> > > +extern int max_mtu_default;
> > > +extern int max_txdesc_used;
> > > +extern int max_txdesc_default;
> > > +extern int max_rxdesc_used;
> > > +extern int max_rxdesc_default;
> > 
> > Again, these are bad names, can you do the same thing here?
> > 
> > thanks,
> > 
> > greg k-h
> 
> Hi Greg,
> 
> max_txdesc_used and max_rxdesc_used are module parameters, 

Ugh :(

> is it ok to change them?  I'm quite new to this -- I don't know if that
> would count as breaking userspace or not.

Yeah, we can't change them, good catch.

> If not allowed, I could go the route of changing these less descriptive ones
> to static in the main file and then make an assignment to the global vars
> during the module init.

That would be the best thing to do.

thanks,

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


Re: [PATCH] staging: cxt1e1: Fix static symbol sparse warnings for global vars in linux.c

2014-07-22 Thread Jeff Oczek
On Tue, Jul 22, 2014 at 01:17:22PM -0700, Greg KH wrote:
> On Tue, Jul 22, 2014 at 04:07:51PM -0400, Jeff Oczek wrote:
> > Put extern declarations in cxt1e1_common.h to reduce sparse warnings for 
> > linux.c:
> 
> I know you didn't name this variable, but wow, that's a horrid name for
> a global variable :)
> 
> Any way you could change this to first fix up the name of the variable
> to something a bit more "device-specific" first, before this patch?
> 
> Perhaps "cxt1e1_error_flag"?
> 
> > +extern int cxt1e1_max_mru;
> > +extern int cxt1e1_max_mtu;
> 
> These are fine.
> 
> > +extern int max_mtu_default;
> > +extern int max_txdesc_used;
> > +extern int max_txdesc_default;
> > +extern int max_rxdesc_used;
> > +extern int max_rxdesc_default;
> 
> Again, these are bad names, can you do the same thing here?
> 
> thanks,
> 
> greg k-h

Hi Greg,

max_txdesc_used and max_rxdesc_used are module parameters, 
is it ok to change them?  I'm quite new to this -- I don't know if that
would count as breaking userspace or not.

If not allowed, I could go the route of changing these less descriptive ones
to static in the main file and then make an assignment to the global vars
during the module init.

Or I can just leave the module params be and change the other globals.

Any of those sound good?

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


[PATCH 3/5] staging: vt6655: statify some variables

2014-07-22 Thread Guillaume Clement
Some variables are used only in the context of their .c file, which
gives warnings with sparse.

Signed-off-by: Guillaume Clement 
---
 drivers/staging/vt6655/baseband.c| 14 +++---
 drivers/staging/vt6655/bssdb.c   |  4 ++--
 drivers/staging/vt6655/card.c|  6 +++---
 drivers/staging/vt6655/device_main.c |  4 ++--
 drivers/staging/vt6655/wcmd.c|  2 +-
 drivers/staging/vt6655/wmgr.c| 10 +-
 6 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/vt6655/baseband.c 
b/drivers/staging/vt6655/baseband.c
index 0985563..67bc3b4 100644
--- a/drivers/staging/vt6655/baseband.c
+++ b/drivers/staging/vt6655/baseband.c
@@ -75,7 +75,7 @@ static int msglevel = MSG_LEVEL_INFO;
 /*-  Static Variables  --*/
 
 #define CB_VT3253_INIT_FOR_RFMD 446
-unsigned char byVT3253InitTab_RFMD[CB_VT3253_INIT_FOR_RFMD][2] = {
+static unsigned char byVT3253InitTab_RFMD[CB_VT3253_INIT_FOR_RFMD][2] = {
{0x00, 0x30},
{0x01, 0x00},
{0x02, 0x00},
@@ -525,7 +525,7 @@ unsigned char 
byVT3253InitTab_RFMD[CB_VT3253_INIT_FOR_RFMD][2] = {
 };
 
 #define CB_VT3253B0_INIT_FOR_RFMD 256
-unsigned char byVT3253B0_RFMD[CB_VT3253B0_INIT_FOR_RFMD][2] = {
+static unsigned char byVT3253B0_RFMD[CB_VT3253B0_INIT_FOR_RFMD][2] = {
{0x00, 0x31},
{0x01, 0x00},
{0x02, 0x00},
@@ -786,7 +786,7 @@ unsigned char byVT3253B0_RFMD[CB_VT3253B0_INIT_FOR_RFMD][2] 
= {
 
 #define CB_VT3253B0_AGC_FOR_RFMD2959 195
 /* For RFMD2959 */
-unsigned char byVT3253B0_AGC4_RFMD2959[CB_VT3253B0_AGC_FOR_RFMD2959][2] = {
+static unsigned char byVT3253B0_AGC4_RFMD2959[CB_VT3253B0_AGC_FOR_RFMD2959][2] 
= {
{0xF0, 0x00},
{0xF1, 0x3E},
{0xF0, 0x80},
@@ -986,7 +986,7 @@ unsigned char 
byVT3253B0_AGC4_RFMD2959[CB_VT3253B0_AGC_FOR_RFMD2959][2] = {
 
 #define CB_VT3253B0_INIT_FOR_AIROHA2230 256
 /* For AIROHA */
-unsigned char byVT3253B0_AIROHA2230[CB_VT3253B0_INIT_FOR_AIROHA2230][2] = {
+static unsigned char byVT3253B0_AIROHA2230[CB_VT3253B0_INIT_FOR_AIROHA2230][2] 
= {
{0x00, 0x31},
{0x01, 0x00},
{0x02, 0x00},
@@ -1247,7 +1247,7 @@ unsigned char 
byVT3253B0_AIROHA2230[CB_VT3253B0_INIT_FOR_AIROHA2230][2] = {
 
 #define CB_VT3253B0_INIT_FOR_UW2451 256
 /* For UW2451 */
-unsigned char byVT3253B0_UW2451[CB_VT3253B0_INIT_FOR_UW2451][2] = {
+static unsigned char byVT3253B0_UW2451[CB_VT3253B0_INIT_FOR_UW2451][2] = {
{0x00, 0x31},
{0x01, 0x00},
{0x02, 0x00},
@@ -1508,7 +1508,7 @@ unsigned char 
byVT3253B0_UW2451[CB_VT3253B0_INIT_FOR_UW2451][2] = {
 
 #define CB_VT3253B0_AGC 193
 /* For AIROHA */
-unsigned char byVT3253B0_AGC[CB_VT3253B0_AGC][2] = {
+static unsigned char byVT3253B0_AGC[CB_VT3253B0_AGC][2] = {
{0xF0, 0x00},
{0xF1, 0x00},
{0xF0, 0x80},
@@ -1704,7 +1704,7 @@ unsigned char byVT3253B0_AGC[CB_VT3253B0_AGC][2] = {
{0xF0, 0x00},
 };
 
-const unsigned short awcFrameTime[MAX_RATE] =
+static const unsigned short awcFrameTime[MAX_RATE] =
 {10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216};
 
 /*-  Static Functions  --*/
diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c
index 59679cd..eb3474d 100644
--- a/drivers/staging/vt6655/bssdb.c
+++ b/drivers/staging/vt6655/bssdb.c
@@ -65,14 +65,14 @@
 /*-  Static Variables  --*/
 static int msglevel = MSG_LEVEL_INFO;
 
-const unsigned short awHWRetry0[5][5] = {
+static const unsigned short awHWRetry0[5][5] = {
{RATE_18M, RATE_18M, RATE_12M, RATE_12M, RATE_12M},
{RATE_24M, RATE_24M, RATE_18M, RATE_12M, RATE_12M},
{RATE_36M, RATE_36M, RATE_24M, RATE_18M, RATE_18M},
{RATE_48M, RATE_48M, RATE_36M, RATE_24M, RATE_24M},
{RATE_54M, RATE_54M, RATE_48M, RATE_36M, RATE_36M}
 };
-const unsigned short awHWRetry1[5][5] = {
+static const unsigned short awHWRetry1[5][5] = {
{RATE_18M, RATE_18M, RATE_12M, RATE_6M, RATE_6M},
{RATE_24M, RATE_24M, RATE_18M, RATE_6M, RATE_6M},
{RATE_36M, RATE_36M, RATE_24M, RATE_12M, RATE_12M},
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 988858b..e29dcd8 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -87,7 +87,7 @@ static unsigned char abyDefaultSuppRatesB[] = 
{WLAN_EID_SUPP_RATES, 4, 0x02, 0x0
 
 /*-  Static Variables  --*/
 
-const unsigned short cwRXBCNTSFOff[MAX_RATE] =
+static const unsigned short cwRXBCNTSFOff[MAX_RATE] =
 {17, 17, 17, 17, 34, 23, 17, 11, 8, 5, 4, 3};
 
 /*-  Static Functions  --*/
@@ -1576,7 +1576,7 @@ CARDvSafeResetRx(
  * Return Value: response Control frame rate
  *
  */
-unsigned short CARDwGetCCKControlRate(void *pDeviceHandler, unsigned short 
wRateIdx)
+static unsigned short CARDwGetCCKControlRate(void *pDeviceHandler

Re: [PATCH] staging: cxt1e1: Fix static symbol sparse warnings for global vars in linux.c

2014-07-22 Thread Greg KH
On Tue, Jul 22, 2014 at 04:07:51PM -0400, Jeff Oczek wrote:
> Put extern declarations in cxt1e1_common.h to reduce sparse warnings for 
> linux.c:
> drivers/staging/cxt1e1/linux.c:86:13: warning:
>   symbol 'error_flag' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:91:13: warning:
>   symbol 'cxt1e1_max_mru' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:95:13: warning:
>   symbol 'cxt1e1_max_mtu' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:96:13: warning:
>   symbol 'max_mtu_default' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:99:13: warning:
>   symbol 'max_txdesc_used' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:100:13: warning:
>   symbol 'max_txd:esc_default' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:103:13: warning:
>   symbol 'max_rxdesc_used' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:104:13: warning:
>   symbol 'max_rxdesc_default' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:153:1: warning:
>   symbol 'c4_wk_chan_restart' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:171:1: warning:
>   symbol 'c4_wk_chan_init' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:186:1: warning:
>   symbol 'c4_wq_port_init' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:208:1: warning:
>   symbol 'c4_wq_port_cleanup' was not declared. Should it be static?
> 
> Signed-off-by: Jeff Oczek 
> ---
>  drivers/staging/cxt1e1/cxt1e1_common.h | 15 +++
>  drivers/staging/cxt1e1/hwprobe.c   |  2 +-
>  drivers/staging/cxt1e1/linux.c |  2 +-
>  drivers/staging/cxt1e1/musycc.c|  7 +--
>  drivers/staging/cxt1e1/pmcc4_drv.c |  5 +
>  5 files changed, 19 insertions(+), 12 deletions(-)
>  create mode 100644 drivers/staging/cxt1e1/cxt1e1_common.h
> 
> diff --git a/drivers/staging/cxt1e1/cxt1e1_common.h 
> b/drivers/staging/cxt1e1/cxt1e1_common.h
> new file mode 100644
> index 000..ac6b974
> --- /dev/null
> +++ b/drivers/staging/cxt1e1/cxt1e1_common.h
> @@ -0,0 +1,15 @@
> +#ifndef __CXT1E1_COMMON_H
> +#define __CXT1E1_COMMON_H
> +
> +#include "pmcc4.h"
> +
> +extern int error_flag;

I know you didn't name this variable, but wow, that's a horrid name for
a global variable :)

Any way you could change this to first fix up the name of the variable
to something a bit more "device-specific" first, before this patch?

Perhaps "cxt1e1_error_flag"?

> +extern int cxt1e1_max_mru;
> +extern int cxt1e1_max_mtu;

These are fine.

> +extern int max_mtu_default;
> +extern int max_txdesc_used;
> +extern int max_txdesc_default;
> +extern int max_rxdesc_used;
> +extern int max_rxdesc_default;

Again, these are bad names, can you do the same thing here?

thanks,

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


[PATCH 1/5] staging: vt6655: change type of PortOffset to void __iomem *

2014-07-22 Thread Guillaume Clement
PortOffset was an unsigned long, but used as an pointer to io
memory. Sometimes it was not properly cast before use, which caused
many warning by sparse.

By updating its type to void __iomem *, and reflecting the changes
where it is needed, this removes most of those warnings.

Signed-off-by: Guillaume Clement 
---
 drivers/staging/vt6655/baseband.c|  30 +-
 drivers/staging/vt6655/baseband.h|  24 
 drivers/staging/vt6655/card.c|   8 +--
 drivers/staging/vt6655/card.h|   8 +--
 drivers/staging/vt6655/device.h  |   2 +-
 drivers/staging/vt6655/device_main.c |   6 +-
 drivers/staging/vt6655/key.c |  18 +++---
 drivers/staging/vt6655/key.h |  16 +++---
 drivers/staging/vt6655/mac.c | 104 +-
 drivers/staging/vt6655/mac.h | 106 +--
 drivers/staging/vt6655/rf.c  |  16 +++---
 drivers/staging/vt6655/rf.h  |   8 +--
 drivers/staging/vt6655/srom.c|  24 
 drivers/staging/vt6655/srom.h|  24 
 drivers/staging/vt6655/upc.h |  18 ++
 15 files changed, 203 insertions(+), 209 deletions(-)

diff --git a/drivers/staging/vt6655/baseband.c 
b/drivers/staging/vt6655/baseband.c
index 490ca96..0985563 100644
--- a/drivers/staging/vt6655/baseband.c
+++ b/drivers/staging/vt6655/baseband.c
@@ -1987,7 +1987,7 @@ BBvCalculateParameter(
  * Return Value: true if succeeded; false if failed.
  *
  */
-bool BBbReadEmbedded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned 
char *pbyData)
+bool BBbReadEmbedded(void __iomem *dwIoBase, unsigned char byBBAddr, unsigned 
char *pbyData)
 {
unsigned short ww;
unsigned char byValue;
@@ -2029,7 +2029,7 @@ bool BBbReadEmbedded(unsigned long dwIoBase, unsigned 
char byBBAddr, unsigned ch
  * Return Value: true if succeeded; false if failed.
  *
  */
-bool BBbWriteEmbedded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned 
char byData)
+bool BBbWriteEmbedded(void __iomem *dwIoBase, unsigned char byBBAddr, unsigned 
char byData)
 {
unsigned short ww;
unsigned char byValue;
@@ -2070,7 +2070,7 @@ bool BBbWriteEmbedded(unsigned long dwIoBase, unsigned 
char byBBAddr, unsigned c
  * Return Value: true if all TestBits are set; false otherwise.
  *
  */
-bool BBbIsRegBitsOn(unsigned long dwIoBase, unsigned char byBBAddr, unsigned 
char byTestBits)
+bool BBbIsRegBitsOn(void __iomem *dwIoBase, unsigned char byBBAddr, unsigned 
char byTestBits)
 {
unsigned char byOrgData;
 
@@ -2092,7 +2092,7 @@ bool BBbIsRegBitsOn(unsigned long dwIoBase, unsigned char 
byBBAddr, unsigned cha
  * Return Value: true if all TestBits are clear; false otherwise.
  *
  */
-bool BBbIsRegBitsOff(unsigned long dwIoBase, unsigned char byBBAddr, unsigned 
char byTestBits)
+bool BBbIsRegBitsOff(void __iomem *dwIoBase, unsigned char byBBAddr, unsigned 
char byTestBits)
 {
unsigned char byOrgData;
 
@@ -2119,7 +2119,7 @@ bool BBbVT3253Init(PSDevice pDevice)
 {
bool bResult = true;
intii;
-   unsigned long dwIoBase = pDevice->PortOffset;
+   void __iomem *dwIoBase = pDevice->PortOffset;
unsigned char byRFType = pDevice->byRFType;
unsigned char byLocalID = pDevice->byLocalID;
 
@@ -2285,7 +2285,7 @@ bool BBbVT3253Init(PSDevice pDevice)
  * Return Value: none
  *
  */
-void BBvReadAllRegs(unsigned long dwIoBase, unsigned char *pbyBBRegs)
+void BBvReadAllRegs(void __iomem *dwIoBase, unsigned char *pbyBBRegs)
 {
int  ii;
unsigned char byBase = 1;
@@ -2312,7 +2312,7 @@ void BBvReadAllRegs(unsigned long dwIoBase, unsigned char 
*pbyBBRegs)
 void BBvLoopbackOn(PSDevice pDevice)
 {
unsigned char byData;
-   unsigned long dwIoBase = pDevice->PortOffset;
+   void __iomem *dwIoBase = pDevice->PortOffset;
 
/* CR C9 = 0x00 */
BBbReadEmbedded(dwIoBase, 0xC9, &pDevice->byBBCRc9); /* CR201 */
@@ -2365,7 +2365,7 @@ void BBvLoopbackOn(PSDevice pDevice)
 void BBvLoopbackOff(PSDevice pDevice)
 {
unsigned char byData;
-   unsigned long dwIoBase = pDevice->PortOffset;
+   void __iomem *dwIoBase = pDevice->PortOffset;
 
BBbWriteEmbedded(dwIoBase, 0xC9, pDevice->byBBCRc9); /* CR201 */
BBbWriteEmbedded(dwIoBase, 0x88, pDevice->byBBCR88); /* CR136 */
@@ -2448,7 +2448,7 @@ void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char 
byData)
  *
  */
 void
-BBvSoftwareReset(unsigned long dwIoBase)
+BBvSoftwareReset(void __iomem *dwIoBase)
 {
BBbWriteEmbedded(dwIoBase, 0x50, 0x40);
BBbWriteEmbedded(dwIoBase, 0x50, 0);
@@ -2469,7 +2469,7 @@ BBvSoftwareReset(unsigned long dwIoBase)
  *
  */
 void
-BBvPowerSaveModeON(unsigned long dwIoBase)
+BBvPowerSaveModeON(void __iomem *dwIoBase)
 {
unsigned char byOrgData;
 
@@ -2491,7 +2491,7 @@ BBvPowerSaveModeON(unsigned long dwIoBase)
  *
  */
 void
-BBvPowerSaveModeOFF(unsigned long dwIoBase)
+BBvPowerSaveModeOFF(void __iom

[PATCH 4/5] staging: vt6655: remove unused functions

2014-07-22 Thread Guillaume Clement
The IEEE11hbMgrRxAction is not exported and never used. Deleting it
allows to delete other functions that were only used by
IEEE11hbMgrRxAction.

This allows to fix several warnings reported by sparse.

Signed-off-by: Guillaume Clement 
---
 drivers/staging/vt6655/IEEE11h.c | 175 ---
 1 file changed, 175 deletions(-)

diff --git a/drivers/staging/vt6655/IEEE11h.c b/drivers/staging/vt6655/IEEE11h.c
index 6cfad1c..180a27c 100644
--- a/drivers/staging/vt6655/IEEE11h.c
+++ b/drivers/staging/vt6655/IEEE11h.c
@@ -41,7 +41,6 @@
 #include "channel.h"
 
 /*-  Static Definitions -*/
-static int  msglevel= MSG_LEVEL_INFO;
 
 #pragma pack(1)
 
@@ -98,185 +97,11 @@ typedef struct _WLAN_FRAME_TPCREP {
 /*-  Static Variables  --*/
 
 /*-  Static Functions  --*/
-static bool s_bRxMSRReq(PSMgmtObject pMgmt, PWLAN_FRAME_MSRREQ pMSRReq,
-   unsigned int uLength)
-{
-   size_tuNumOfEIDs = 0;
-   bool bResult = true;
-
-   if (uLength <= WLAN_A3FR_MAXLEN)
-   memcpy(pMgmt->abyCurrentMSRReq, pMSRReq, uLength);
-   uNumOfEIDs = ((uLength - offsetof(WLAN_FRAME_MSRREQ,
- sMSRReqEIDs))/
- (sizeof(WLAN_IE_MEASURE_REQ)));
-   pMgmt->pCurrMeasureEIDRep = &(((PWLAN_FRAME_MSRREP)
-  
(pMgmt->abyCurrentMSRRep))->sMSRRepEIDs[0]);
-   pMgmt->uLengthOfRepEIDs = 0;
-   bResult = CARDbStartMeasure(pMgmt->pAdapter,
-   ((PWLAN_FRAME_MSRREQ)
-(pMgmt->abyCurrentMSRReq))->sMSRReqEIDs,
-   uNumOfEIDs
-);
-   return bResult;
-}
-
-static bool s_bRxTPCReq(PSMgmtObject pMgmt,
-   PWLAN_FRAME_TPCREQ pTPCReq,
-   unsigned char byRate,
-   unsigned char byRSSI)
-{
-   PWLAN_FRAME_TPCREP  pFrame;
-   PSTxMgmtPacket  pTxPacket = NULL;
-
-   pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool;
-   memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN);
-   pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket +
-   sizeof(STxMgmtPacket));
-
-   pFrame = (PWLAN_FRAME_TPCREP)((unsigned char *)pTxPacket +
- sizeof(STxMgmtPacket));
-
-   pFrame->Header.wFrameCtl = (WLAN_SET_FC_FTYPE(WLAN_FTYPE_MGMT) |
-   WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION)
-);
-
-   memcpy(pFrame->Header.abyAddr1,
-  pTPCReq->Header.abyAddr2,
-  WLAN_ADDR_LEN);
-   memcpy(pFrame->Header.abyAddr2,
-  CARDpGetCurrentAddress(pMgmt->pAdapter),
-  WLAN_ADDR_LEN);
-   memcpy(pFrame->Header.abyAddr3,
-  pMgmt->abyCurrBSSID,
-  WLAN_BSSID_LEN);
-
-   pFrame->byCategory = 0;
-   pFrame->byAction = 3;
-   pFrame->byDialogToken = ((PWLAN_FRAME_MSRREQ)
-(pMgmt->abyCurrentMSRReq))->byDialogToken;
-
-   pFrame->sTPCRepEIDs.byElementID = WLAN_EID_TPC_REP;
-   pFrame->sTPCRepEIDs.len = 2;
-   pFrame->sTPCRepEIDs.byTxPower = CARDbyGetTransmitPower(pMgmt->pAdapter);
-   switch (byRate) {
-   case RATE_54M:
-   pFrame->sTPCRepEIDs.byLinkMargin = 65 - byRSSI;
-   break;
-   case RATE_48M:
-   pFrame->sTPCRepEIDs.byLinkMargin = 66 - byRSSI;
-   break;
-   case RATE_36M:
-   pFrame->sTPCRepEIDs.byLinkMargin = 70 - byRSSI;
-   break;
-   case RATE_24M:
-   pFrame->sTPCRepEIDs.byLinkMargin = 74 - byRSSI;
-   break;
-   case RATE_18M:
-   pFrame->sTPCRepEIDs.byLinkMargin = 77 - byRSSI;
-   break;
-   case RATE_12M:
-   pFrame->sTPCRepEIDs.byLinkMargin = 79 - byRSSI;
-   break;
-   case RATE_9M:
-   pFrame->sTPCRepEIDs.byLinkMargin = 81 - byRSSI;
-   break;
-   case RATE_6M:
-   default:
-   pFrame->sTPCRepEIDs.byLinkMargin = 82 - byRSSI;
-   break;
-   }
-
-   pTxPacket->cbMPDULen = sizeof(WLAN_FRAME_TPCREP);
-   pTxPacket->cbPayloadLen = sizeof(WLAN_FRAME_TPCREP) -
-   WLAN_HDR_ADDR3_LEN;
-   if (csMgmt_xmit(pMgmt->pAdapter, pTxPacket) != CMD_STATUS_PENDING)
-   return false;
-   return true;
-}
 
 /*-  Export Variables  --*/
 
 /*-  Export Functions  --*/
 
-/*+
- *
- * Description:
- *  Handles action management frames.
- *
- * Parameters:
- *  In:
- *  pMgmt   - Management Object structure
- *  pRxPacket   - Receive

[PATCH 2/5] staging: vt6655:fix warning for unexported non-static functions

2014-07-22 Thread Guillaume Clement
There is one function in aes_ccmp.c which is exported, but sparse sees
it unexported because it doesn't include the header that exports it.

Signed-off-by: Guillaume Clement 
---
 drivers/staging/vt6655/aes_ccmp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/vt6655/aes_ccmp.c 
b/drivers/staging/vt6655/aes_ccmp.c
index 4ccfe06..a25e6cf 100644
--- a/drivers/staging/vt6655/aes_ccmp.c
+++ b/drivers/staging/vt6655/aes_ccmp.c
@@ -35,6 +35,7 @@
 
 #include "device.h"
 #include "80211hdr.h"
+#include "aes_ccmp.h"
 
 /*-  Static Definitions -*/
 
-- 
1.8.5.5

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


[PATCH 5/5] staging: vt6655: Fix unused function warning

2014-07-22 Thread Guillaume Clement
Sparse reports that MimeThread is not used. Actually, it can be used
if THREAD is defined. By enclosing the MimeThread function into the
same #ifdef as the caller of MimeThread, this fixes the sparse
warnings.

Signed-off-by: Guillaume Clement 
---
 drivers/staging/vt6655/device_main.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 5576c30..fe9e13c 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -98,7 +98,9 @@ MODULE_AUTHOR("VIA Networking Technologies, Inc., 
");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("VIA Networking Solomon-A/B/G Wireless LAN Adapter Driver");
 
+#ifdef THREAD
 static int mlme_kill;
+#endif
 
 #define DEVICE_PARAM(N, D)
 
@@ -1596,7 +1598,8 @@ void  InitRxManagementQueue(PSDevice  pDevice)
 //PLICE_DEBUG<-
 
 //PLICE_DEBUG ->
-int MlmeThread(
+#ifdef THREAD
+static int MlmeThread(
void *Context)
 {
PSDevicepDevice =  (PSDevice) Context;
@@ -1619,6 +1622,7 @@ int MlmeThread(
 
return 0;
 }
+#endif
 
 static int  device_open(struct net_device *dev) {
PSDevice pDevice = (PSDevice)netdev_priv(dev);
-- 
1.8.5.5

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


[PATCH 0/5] staging: vt6655: fix sparse issues

2014-07-22 Thread Guillaume Clement
Those patches fix warnings reported by sparse on the vt6655
driver. This will allow to more easily find real errors with sparse
later if one appears.


Note that checkpatch does return an error for patch 1 and 2 (line over
80 characters) but the line length was not increased by this patch. If
needed, I can do another patch set to fix the 80 column warnings too.

[PATCH 1/5] staging: vt6655: change type of PortOffset to void
[PATCH 2/5] staging: vt6655:fix warning for unexported non-static
[PATCH 3/5] staging: vt6655: statify some variables
[PATCH 4/5] staging: vt6655: remove unused functions
[PATCH 5/5] staging: vt6655: Fix unused function warning
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: cxt1e1: Fix static symbol sparse warnings for global vars in linux.c

2014-07-22 Thread Jeff Oczek
Put extern declarations in cxt1e1_common.h to reduce sparse warnings for 
linux.c:
drivers/staging/cxt1e1/linux.c:86:13: warning:
  symbol 'error_flag' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:91:13: warning:
  symbol 'cxt1e1_max_mru' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:95:13: warning:
  symbol 'cxt1e1_max_mtu' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:96:13: warning:
  symbol 'max_mtu_default' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:99:13: warning:
  symbol 'max_txdesc_used' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:100:13: warning:
  symbol 'max_txd:esc_default' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:103:13: warning:
  symbol 'max_rxdesc_used' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:104:13: warning:
  symbol 'max_rxdesc_default' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:153:1: warning:
  symbol 'c4_wk_chan_restart' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:171:1: warning:
  symbol 'c4_wk_chan_init' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:186:1: warning:
  symbol 'c4_wq_port_init' was not declared. Should it be static?
drivers/staging/cxt1e1/linux.c:208:1: warning:
  symbol 'c4_wq_port_cleanup' was not declared. Should it be static?

Signed-off-by: Jeff Oczek 
---
 drivers/staging/cxt1e1/cxt1e1_common.h | 15 +++
 drivers/staging/cxt1e1/hwprobe.c   |  2 +-
 drivers/staging/cxt1e1/linux.c |  2 +-
 drivers/staging/cxt1e1/musycc.c|  7 +--
 drivers/staging/cxt1e1/pmcc4_drv.c |  5 +
 5 files changed, 19 insertions(+), 12 deletions(-)
 create mode 100644 drivers/staging/cxt1e1/cxt1e1_common.h

diff --git a/drivers/staging/cxt1e1/cxt1e1_common.h 
b/drivers/staging/cxt1e1/cxt1e1_common.h
new file mode 100644
index 000..ac6b974
--- /dev/null
+++ b/drivers/staging/cxt1e1/cxt1e1_common.h
@@ -0,0 +1,15 @@
+#ifndef __CXT1E1_COMMON_H
+#define __CXT1E1_COMMON_H
+
+#include "pmcc4.h"
+
+extern int error_flag;
+extern int cxt1e1_max_mru;
+extern int cxt1e1_max_mtu;
+extern int max_mtu_default;
+extern int max_txdesc_used;
+extern int max_txdesc_default;
+extern int max_rxdesc_used;
+extern int max_rxdesc_default;
+
+#endif
diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index 4fa27c8..45bc161 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -30,8 +30,8 @@
 #ifdef CONFIG_PROC_FS
 #include "sbeproc.h"
 #endif
+#include "cxt1e1_common.h"
 
-extern int  error_flag;
 extern int  drvr_state;
 
 /* forward references */
diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c
index 09f3d5c..3ba0245 100644
--- a/drivers/staging/cxt1e1/linux.c
+++ b/drivers/staging/cxt1e1/linux.c
@@ -30,7 +30,7 @@
 #include "pmcc4_ioctls.h"
 #include "pmcc4_private.h"
 #include "sbeproc.h"
-
+#include "cxt1e1_common.h"
 
/***
  * Error out early if we have compiler trouble.
  *
diff --git a/drivers/staging/cxt1e1/musycc.c b/drivers/staging/cxt1e1/musycc.c
index 0bcbd8a..4f8b137 100644
--- a/drivers/staging/cxt1e1/musycc.c
+++ b/drivers/staging/cxt1e1/musycc.c
@@ -34,7 +34,7 @@ static unsigned int max_bh;
 #include "pmcc4_private.h"
 #include "pmcc4.h"
 #include "musycc.h"
-
+#include "cxt1e1_common.h"
 #define sd_find_chan(ci,ch)   c4_find_chan(ch)
 
 
@@ -42,11 +42,6 @@ static unsigned int max_bh;
 /* global driver variables */
 extern ci_t *c4_list;
 extern int  drvr_state;
-
-extern int  cxt1e1_max_mru;
-extern int  cxt1e1_max_mtu;
-extern int  max_rxdesc_used;
-extern int  max_txdesc_used;
 extern ci_t *CI;/* dummy pointr to board ZEROE's data - DEBUG
 * USAGE */
 
diff --git a/drivers/staging/cxt1e1/pmcc4_drv.c 
b/drivers/staging/cxt1e1/pmcc4_drv.c
index 76bebdd..e053b60 100644
--- a/drivers/staging/cxt1e1/pmcc4_drv.c
+++ b/drivers/staging/cxt1e1/pmcc4_drv.c
@@ -38,6 +38,7 @@
 #include "musycc.h"
 #include "comet.h"
 #include "sbe_bid.h"
+#include "cxt1e1_common.h"
 
 #define KERN_WARN KERN_WARNING
 
@@ -59,10 +60,6 @@ voidmusycc_update_timeslots (mpi_t *);
 
 extern void musycc_update_tx_thp (mch_t *);
 extern int  cxt1e1_log_level;
-extern int  cxt1e1_max_mru;
-extern int  cxt1e1_max_mtu;
-extern int  max_rxdesc_used, max_rxdesc_default;
-extern int  max_txdesc_used, max_txdesc_default;
 
 #if defined (__powerpc__)
 extern void *memset (void *s, int c, size_t n);
-- 
1.9.1

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


[PATCH] staging: gdm724x: Use NLMSG_HDRLEN

2014-07-22 Thread Himangi Saraogi
Replace use of  NLMSG_SPACE(0) with NLMSG_HDRLEN as they are equivalent
and NLMSG_SPACE seems to be deprecated.

Signed-off-by: Himangi Saraogi 
---
To send to: Greg Kroah-Hartman 
,de...@driverdev.osuosl.org,linux-ker...@vger.kernel.org
 drivers/staging/gdm724x/netlink_k.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gdm724x/netlink_k.c 
b/drivers/staging/gdm724x/netlink_k.c
index 5ddd369..59a1830 100644
--- a/drivers/staging/gdm724x/netlink_k.c
+++ b/drivers/staging/gdm724x/netlink_k.c
@@ -54,7 +54,7 @@ static void netlink_rcv_cb(struct sk_buff *skb)
return;
}
 
-   if (skb->len < NLMSG_SPACE(0)) {
+   if (skb->len < NLMSG_HDRLEN) {
pr_err("nl cb - invalid skb length\n");
return;
}
-- 
1.9.1

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


Re: [PATCH 0/25] Replace DEFINE_PCI_DEVICE_TABLE macro use

2014-07-22 Thread Benoit Taine
On 21/07/2014 17:16, Bjorn Helgaas wrote:
> [+cc Jingoo]
> 
> On Fri, Jul 18, 2014 at 12:50 PM, James Bottomley
> > Anyway, it's PCI code ... let the PCI maintainer decide.  However, if he
> > does want this do it as one big bang patch via either the PCI or Trivial
> > tree (latter because Jiří has experience doing this, but the former
> > might be useful so the decider feels the pain ...)
> 
> I don't feel strongly either way, so I guess I'm OK with this, and in
> the spirit of feeling the pain, I'm willing to handle it.  Jingoo
> proposed similar patches, so it might be nice to give him some credit.
> 
> Benoit, how about if you wait until about half-way through the merge
> window after v3.16 releases, generate an up-to-date single patch, and
> post that?  Then we can try to get it in before v3.17-rc1 to minimize
> merge hassles.

Sure, I will do this.

-- 
Benoît Taine
Master cycle intern
Regal Team. LIP6
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgnc: Remove all C99 comments

2014-07-22 Thread Seunghun Lee
This patch fixes the following checkpatch error:

ERROR: do not use C99 // comments

CC: Lidza Louina 
Signed-off-by: Seunghun Lee 
---
 drivers/staging/dgnc/dgnc_driver.h |   10 +-
 drivers/staging/dgnc/digi.h|   36 ++--
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index 3519b80..fe5ea90 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -98,7 +98,7 @@
 /* Choose one: */
 #  define TRC_ON_OVERFLOW_WRAP_AROUND
 #  undef  TRC_ON_OVERFLOW_SHIFT_BUFFER
-# endif //TRC_TO_KMEM
+# endif /* TRC_TO_KMEM */
 
 # define TRC_MAXMSG1024
 # define TRC_OVERFLOW  "(OVERFLOW)"
@@ -106,13 +106,13 @@
 
 #if defined TRC_TO_CONSOLE
 #define PRINTF_TO_CONSOLE(args) { printk(DRVSTR": "); printk args; }
-#else //!defined TRACE_TO_CONSOLE
+#else /* !defined TRACE_TO_CONSOLE */
 #define PRINTF_TO_CONSOLE(args)
 #endif
 
 #if defined TRC_TO_KMEM
 #define PRINTF_TO_KMEM(args) dgnc_tracef args
-#else //!defined TRC_TO_KMEM
+#else /* !defined TRC_TO_KMEM */
 #define PRINTF_TO_KMEM(args)
 #endif
 
@@ -140,7 +140,7 @@
 # define P(X)  dgnc_tracef(#X "=%p\n", X)
 # define X(X)  dgnc_tracef(#X "=%x\n", X)
 
-#else//!defined DGNC_TRACER
+#else/* !defined DGNC_TRACER */
 
 #define PRINTF_TO_KMEM(args)
 # define TRC(ARGS)
@@ -164,7 +164,7 @@
 
 # define DPR(args)
 
-#endif//DGNC_TRACER
+#endif/* DGNC_TRACER */
 
 /* Number of boards we support at once. */
 #defineMAXBOARDS   20
diff --git a/drivers/staging/dgnc/digi.h b/drivers/staging/dgnc/digi.h
index 6a9adf6..282908f 100644
--- a/drivers/staging/dgnc/digi.h
+++ b/drivers/staging/dgnc/digi.h
@@ -394,23 +394,23 @@ struct digi_getcounter {
 #define DIGI_REALPORT_GETCOUNTERS ('e'<<8 ) | 110
 #define DIGI_REALPORT_GETEVENTS ('e'<<8 ) | 111
 
-#define EV_OPU 0x0001  //!http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v5 (staging-next) 0/5] staging:iio:hmc5843: Few adjustments and support for hmc5983

2014-07-22 Thread Josef Gajdusek
This patch series modifies the hmc5843 driver to support the hmc5983 i2c and
spi interfaces.

v2:
* Reverted the changed order of iio unregister and setting hmc mode to 
sleep

v3:
* Fixed bug introduced in the first patch
* Readded few comment lines which have gone missing in the hmc5843.c ->
  hmc5843_core.c move

v4: 
* Changes suggested by Lars in https://lkml.org/lkml/2014/7/14/968
  * The i2c and spi drivers are now user-selectable with the core driver
being selected automatically
  * The regmap_config structs in both _spi and _i2c files are now static
  * The iio_dev allocation is now done in the common function
  * pm ops are now defined in the header file and the same definition is
shared between both interface-specific drivers
* regmap tables in hmc5843.h are not longer static (this fixed bunch of 
  variable not used warnings)

v5:
* Fixed sparse warning (moved regmap configuration structs from the 
header
  file to the _spi and _i2c files)
* Added the hmc5983 to 
Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt

Josef Gajdusek (5):
  staging:iio:hmc5843: Added regmap support
  staging:iio:hmc5843: Split hmc5843.c to multiple files
  staging:iio:hmc5843: register <-> value arrays now can have different
lengths
  staging:iio:hmc5843: Add support for i2c hmc5983
  staging:iio:hmc5843: Add support for spi hmc5983

 drivers/staging/iio/magnetometer/Kconfig|  30 +-
 drivers/staging/iio/magnetometer/Makefile   |   4 +-
 drivers/staging/iio/magnetometer/hmc5843.c  | 652 
 drivers/staging/iio/magnetometer/hmc5843.h  |  86 
 drivers/staging/iio/magnetometer/hmc5843_core.c | 638 +++
 drivers/staging/iio/magnetometer/hmc5843_i2c.c  |  74 +++
 drivers/staging/iio/magnetometer/hmc5843_spi.c  |  73 +++
 7 files changed, 900 insertions(+), 657 deletions(-)
 delete mode 100644 drivers/staging/iio/magnetometer/hmc5843.c
 create mode 100644 drivers/staging/iio/magnetometer/hmc5843.h
 create mode 100644 drivers/staging/iio/magnetometer/hmc5843_core.c
 create mode 100644 drivers/staging/iio/magnetometer/hmc5843_i2c.c
 create mode 100644 drivers/staging/iio/magnetometer/hmc5843_spi.c

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


[PATCH v5 (staging-next) 5/5] staging:iio:hmc5843: Add support for spi hmc5983

2014-07-22 Thread Josef Gajdusek
This patch adds support for the hmc5983 spi interface.
This chip is almost identical to the hmc5883. The difference being added
temperature compensation, additional available sample rate (220Hz) and an SPI
interface.

Signed-off-by: Josef Gajdusek 
---
 drivers/staging/iio/magnetometer/Kconfig   |  15 
 drivers/staging/iio/magnetometer/Makefile  |   1 +
 drivers/staging/iio/magnetometer/hmc5843_spi.c | 100 +
 3 files changed, 116 insertions(+)
 create mode 100644 drivers/staging/iio/magnetometer/hmc5843_spi.c

diff --git a/drivers/staging/iio/magnetometer/Kconfig 
b/drivers/staging/iio/magnetometer/Kconfig
index c086f33..dec814a 100644
--- a/drivers/staging/iio/magnetometer/Kconfig
+++ b/drivers/staging/iio/magnetometer/Kconfig
@@ -22,4 +22,19 @@ config SENSORS_HMC5843_I2C
  - hmc5843_core (core functions)
  - hmc5843_i2c (support for HMC5843, HMC5883, HMC5883L and HMC5983)
 
+config SENSORS_HMC5843_SPI
+   tristate "Honeywell HMC5983 3-Axis Magnetometer (SPI)"
+   depends on SPI_MASTER
+   select SENSORS_HMC5843
+   select REGMAP_SPI
+   help
+ Say Y here to add support for the Honeywell HMC5983 3-Axis 
Magnetometer
+ (digital compass).
+
+ This driver can also be compiled as a set of modules.
+ If so, these modules will be created:
+ - hmc5843_core (core functions)
+ - hmc5843_spi (support for HMC5983)
+
+
 endmenu
diff --git a/drivers/staging/iio/magnetometer/Makefile 
b/drivers/staging/iio/magnetometer/Makefile
index 65baf1c..33761a1 100644
--- a/drivers/staging/iio/magnetometer/Makefile
+++ b/drivers/staging/iio/magnetometer/Makefile
@@ -4,3 +4,4 @@
 
 obj-$(CONFIG_SENSORS_HMC5843)  += hmc5843_core.o
 obj-$(CONFIG_SENSORS_HMC5843_I2C)  += hmc5843_i2c.o
+obj-$(CONFIG_SENSORS_HMC5843_SPI)  += hmc5843_spi.o
diff --git a/drivers/staging/iio/magnetometer/hmc5843_spi.c 
b/drivers/staging/iio/magnetometer/hmc5843_spi.c
new file mode 100644
index 000..98c4b57
--- /dev/null
+++ b/drivers/staging/iio/magnetometer/hmc5843_spi.c
@@ -0,0 +1,100 @@
+/*
+ * SPI driver for hmc5983
+ *
+ * Copyright (C) Josef Gajdusek 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * */
+
+#include 
+#include 
+#include 
+
+#include "hmc5843.h"
+
+static const struct regmap_range hmc5843_readable_ranges[] = {
+   regmap_reg_range(0, HMC5843_ID_END),
+};
+
+static struct regmap_access_table hmc5843_readable_table = {
+   .yes_ranges = hmc5843_readable_ranges,
+   .n_yes_ranges = ARRAY_SIZE(hmc5843_readable_ranges),
+};
+
+static const struct regmap_range hmc5843_writable_ranges[] = {
+   regmap_reg_range(0, HMC5843_MODE_REG),
+};
+
+static struct regmap_access_table hmc5843_writable_table = {
+   .yes_ranges = hmc5843_writable_ranges,
+   .n_yes_ranges = ARRAY_SIZE(hmc5843_writable_ranges),
+};
+
+static const struct regmap_range hmc5843_volatile_ranges[] = {
+   regmap_reg_range(HMC5843_DATA_OUT_MSB_REGS, HMC5843_STATUS_REG),
+};
+
+static struct regmap_access_table hmc5843_volatile_table = {
+   .yes_ranges = hmc5843_volatile_ranges,
+   .n_yes_ranges = ARRAY_SIZE(hmc5843_volatile_ranges),
+};
+
+static struct regmap_config hmc5843_spi_regmap_config = {
+   .reg_bits = 8,
+   .val_bits = 8,
+
+   .rd_table = &hmc5843_readable_table,
+   .wr_table = &hmc5843_writable_table,
+   .volatile_table = &hmc5843_volatile_table,
+
+   /* Autoincrement address pointer */
+   .read_flag_mask = 0xc0,
+
+   .cache_type = REGCACHE_RBTREE,
+};
+
+static int hmc5843_spi_probe(struct spi_device *spi)
+{
+   int ret;
+
+   spi->mode = SPI_MODE_3;
+   spi->max_speed_hz = 800;
+   spi->bits_per_word = 8;
+   ret = spi_setup(spi);
+   if (ret)
+   return ret;
+
+   return hmc5843_common_probe(&spi->dev,
+   devm_regmap_init_spi(spi, &hmc5843_spi_regmap_config),
+   HMC5983_ID);
+}
+
+static int hmc5843_spi_remove(struct spi_device *spi)
+{
+   return hmc5843_common_remove(&spi->dev);
+}
+
+static const struct spi_device_id hmc5843_id[] = {
+   { "hmc5983", HMC5983_ID },
+   { }
+};
+
+static struct spi_driver hmc5843_driver = {
+   .driver = {
+   .name = "hmc5843",
+   .pm = HMC5843_PM_OPS,
+   .owner = THIS_MODULE,
+   },
+   .id_table = hmc5843_id,
+   .probe = hmc5843_spi_probe,
+   .remove = hmc5843_spi_remove,
+};
+
+module_spi_driver(hmc5843_driver);
+
+MODULE_AUTHOR("Josef Gajdusek ");
+MODULE_DESCRIPTION("HMC5983 SPI driver

[PATCH v5 (staging-next) 4/5] staging:iio:hmc5843: Add support for i2c hmc5983

2014-07-22 Thread Josef Gajdusek
This patch adds support for the hmc5983 i2c interface.
This chip is almost identical to the hmc5883. The difference being added
temperature compensation, additional available sample rate (220Hz) and an SPI
interface.

Signed-off-by: Josef Gajdusek 
---
 .../devicetree/bindings/iio/magnetometer/hmc5843.txt |  1 +
 drivers/staging/iio/magnetometer/Kconfig |  2 +-
 drivers/staging/iio/magnetometer/hmc5843.h   |  1 +
 drivers/staging/iio/magnetometer/hmc5843_core.c  | 20 +---
 drivers/staging/iio/magnetometer/hmc5843_i2c.c   |  6 --
 5 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt 
b/Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt
index b8cbdd5..8e191ee 100644
--- a/Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt
+++ b/Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt
@@ -6,6 +6,7 @@ Required properties:
   Other models which are supported with driver are:
"honeywell,hmc5883"
"honeywell,hmc5883l"
+   "honeywell,hmc5983"
   - reg : the I2C address of the magnetometer - typically 0x1e
 
 Optional properties:
diff --git a/drivers/staging/iio/magnetometer/Kconfig 
b/drivers/staging/iio/magnetometer/Kconfig
index 0a27f98..c086f33 100644
--- a/drivers/staging/iio/magnetometer/Kconfig
+++ b/drivers/staging/iio/magnetometer/Kconfig
@@ -20,6 +20,6 @@ config SENSORS_HMC5843_I2C
  This driver can also be compiled as a set of modules.
  If so, these modules will be created:
  - hmc5843_core (core functions)
- - hmc5843_i2c (support for HMC5843, HMC5883 and HMC5883L)
+ - hmc5843_i2c (support for HMC5843, HMC5883, HMC5883L and HMC5983)
 
 endmenu
diff --git a/drivers/staging/iio/magnetometer/hmc5843.h 
b/drivers/staging/iio/magnetometer/hmc5843.h
index 06b2712..b784e3e 100644
--- a/drivers/staging/iio/magnetometer/hmc5843.h
+++ b/drivers/staging/iio/magnetometer/hmc5843.h
@@ -29,6 +29,7 @@ enum hmc5843_ids {
HMC5843_ID,
HMC5883_ID,
HMC5883L_ID,
+   HMC5983_ID,
 };
 
 struct hmc5843_data {
diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c 
b/drivers/staging/iio/magnetometer/hmc5843_core.c
index 08fb0be..914ae1a 100644
--- a/drivers/staging/iio/magnetometer/hmc5843_core.c
+++ b/drivers/staging/iio/magnetometer/hmc5843_core.c
@@ -101,6 +101,11 @@ static const int hmc5883_regval_to_samp_freq[][2] = {
{75, 0}
 };
 
+static const int hmc5983_regval_to_samp_freq[][2] = {
+   {0, 75}, {1, 50}, {3, 0}, {7, 50}, {15, 0}, {30, 0},
+   {75, 0}, {220, 0}
+};
+
 /* Describe chip variants */
 struct hmc5843_chip_info {
const struct iio_chan_spec *channels;
@@ -457,7 +462,7 @@ static const struct iio_chan_spec hmc5843_channels[] = {
IIO_CHAN_SOFT_TIMESTAMP(3),
 };
 
-/* Beware: Y and Z are exchanged on HMC5883 */
+/* Beware: Y and Z are exchanged on HMC5883 and 5983 */
 static const struct iio_chan_spec hmc5883_channels[] = {
HMC5843_CHANNEL(X, 0),
HMC5843_CHANNEL(Z, 1),
@@ -504,6 +509,15 @@ static const struct hmc5843_chip_info 
hmc5843_chip_info_tbl[] = {
.n_regval_to_nanoscale =
ARRAY_SIZE(hmc5883l_regval_to_nanoscale),
},
+   [HMC5983_ID] = {
+   .channels = hmc5883_channels,
+   .regval_to_samp_freq = hmc5983_regval_to_samp_freq,
+   .n_regval_to_samp_freq =
+   ARRAY_SIZE(hmc5983_regval_to_samp_freq),
+   .regval_to_nanoscale = hmc5883l_regval_to_nanoscale,
+   .n_regval_to_nanoscale =
+   ARRAY_SIZE(hmc5883l_regval_to_nanoscale),
+   }
 };
 
 static int hmc5843_init(struct hmc5843_data *data)
@@ -516,7 +530,7 @@ static int hmc5843_init(struct hmc5843_data *data)
if (ret < 0)
return ret;
if (id[0] != 'H' || id[1] != '4' || id[2] != '3') {
-   dev_err(data->dev, "no HMC5843/5883/5883L sensor\n");
+   dev_err(data->dev, "no HMC5843/5883/5883L/5983 sensor\n");
return -ENODEV;
}
 
@@ -620,5 +634,5 @@ int hmc5843_common_remove(struct device *dev)
 EXPORT_SYMBOL(hmc5843_common_remove);
 
 MODULE_AUTHOR("Shubhrajyoti Datta ");
-MODULE_DESCRIPTION("HMC5843/5883/5883L core driver");
+MODULE_DESCRIPTION("HMC5843/5883/5883L/5983 core driver");
 MODULE_LICENSE("GPL");
diff --git a/drivers/staging/iio/magnetometer/hmc5843_i2c.c 
b/drivers/staging/iio/magnetometer/hmc5843_i2c.c
index 5593a7d..6acd614 100644
--- a/drivers/staging/iio/magnetometer/hmc5843_i2c.c
+++ b/drivers/staging/iio/magnetometer/hmc5843_i2c.c
@@ -1,5 +1,5 @@
 /*
- * i2c driver for hmc5843/5843/5883/5883l
+ * i2c driver for hmc5843/5843/5883/5883l/5983
  *
  * Split from hmc5843.c
  * Copyright (C) Josef Gajdusek 
@@ -73,6 +73,7 @@ static const struct i2c_device_id hmc5843_id[] = {
{ "hmc5843",

[PATCH v5 (staging-next) 3/5] staging:iio:hmc5843: register <-> value arrays now can have different lengths

2014-07-22 Thread Josef Gajdusek
Changed structure of struct hmc5843_chip_info to include length of translation
arrays. Code previously using #defined constant has been changed accordingly.
This allows to integrate devices which do have different amounts of available
rates/scales.

Signed-off-by: Josef Gajdusek 
---
 drivers/staging/iio/magnetometer/hmc5843_core.c | 34 +
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c 
b/drivers/staging/iio/magnetometer/hmc5843_core.c
index bdeaf43..08fb0be 100644
--- a/drivers/staging/iio/magnetometer/hmc5843_core.c
+++ b/drivers/staging/iio/magnetometer/hmc5843_core.c
@@ -39,7 +39,6 @@
  */
 #define HMC5843_RANGE_GAIN_OFFSET  0x05
 #define HMC5843_RANGE_GAIN_DEFAULT 0x01
-#define HMC5843_RANGE_GAINS8
 #define HMC5843_RANGE_GAIN_MASK0xe0
 
 /* Device status */
@@ -59,7 +58,6 @@
  */
 #define HMC5843_RATE_OFFSET0x02
 #define HMC5843_RATE_DEFAULT   0x04
-#define HMC5843_RATES  7
 #define HMC5843_RATE_MASK  0x1c
 
 /* Device measurement configuration */
@@ -69,15 +67,15 @@
 #define HMC5843_MEAS_CONF_MASK 0x03
 
 /* Scaling factors: 1000/Gain */
-static const int hmc5843_regval_to_nanoscale[HMC5843_RANGE_GAINS] = {
+static const int hmc5843_regval_to_nanoscale[] = {
6173, 7692, 10309, 12821, 18868, 21739, 25641, 35714
 };
 
-static const int hmc5883_regval_to_nanoscale[HMC5843_RANGE_GAINS] = {
+static const int hmc5883_regval_to_nanoscale[] = {
7812, 9766, 13021, 16287, 24096, 27701, 32573, 45662
 };
 
-static const int hmc5883l_regval_to_nanoscale[HMC5843_RANGE_GAINS] = {
+static const int hmc5883l_regval_to_nanoscale[] = {
7299, 9174, 12195, 15152, 22727, 25641, 30303, 43478
 };
 
@@ -94,11 +92,11 @@ static const int 
hmc5883l_regval_to_nanoscale[HMC5843_RANGE_GAINS] = {
  * 6   | 50| 75
  * 7   | Not used  | Not used
  */
-static const int hmc5843_regval_to_samp_freq[7][2] = {
+static const int hmc5843_regval_to_samp_freq[][2] = {
{0, 50}, {1, 0}, {2, 0}, {5, 0}, {10, 0}, {20, 0}, {50, 0}
 };
 
-static const int hmc5883_regval_to_samp_freq[7][2] = {
+static const int hmc5883_regval_to_samp_freq[][2] = {
{0, 75}, {1, 50}, {3, 0}, {7, 50}, {15, 0}, {30, 0},
{75, 0}
 };
@@ -107,7 +105,9 @@ static const int hmc5883_regval_to_samp_freq[7][2] = {
 struct hmc5843_chip_info {
const struct iio_chan_spec *channels;
const int (*regval_to_samp_freq)[2];
+   const int n_regval_to_samp_freq;
const int *regval_to_nanoscale;
+   const int n_regval_to_nanoscale;
 };
 
 /* The lower two bits contain the current conversion mode */
@@ -248,7 +248,7 @@ static ssize_t hmc5843_show_samp_freq_avail(struct device 
*dev,
size_t len = 0;
int i;
 
-   for (i = 0; i < HMC5843_RATES; i++)
+   for (i = 0; i < data->variant->n_regval_to_samp_freq; i++)
len += scnprintf(buf + len, PAGE_SIZE - len,
"%d.%d ", data->variant->regval_to_samp_freq[i][0],
data->variant->regval_to_samp_freq[i][1]);
@@ -278,7 +278,7 @@ static int hmc5843_get_samp_freq_index(struct hmc5843_data 
*data,
 {
int i;
 
-   for (i = 0; i < HMC5843_RATES; i++)
+   for (i = 0; i < data->variant->n_regval_to_samp_freq; i++)
if (val == data->variant->regval_to_samp_freq[i][0] &&
val2 == data->variant->regval_to_samp_freq[i][1])
return i;
@@ -307,7 +307,7 @@ static ssize_t hmc5843_show_scale_avail(struct device *dev,
size_t len = 0;
int i;
 
-   for (i = 0; i < HMC5843_RANGE_GAINS; i++)
+   for (i = 0; i < data->variant->n_regval_to_nanoscale; i++)
len += scnprintf(buf + len, PAGE_SIZE - len,
"0.%09d ", data->variant->regval_to_nanoscale[i]);
 
@@ -327,7 +327,7 @@ static int hmc5843_get_scale_index(struct hmc5843_data 
*data, int val, int val2)
if (val != 0)
return -EINVAL;
 
-   for (i = 0; i < HMC5843_RANGE_GAINS; i++)
+   for (i = 0; i < data->variant->n_regval_to_nanoscale; i++)
if (val2 == data->variant->regval_to_nanoscale[i])
return i;
 
@@ -480,17 +480,29 @@ static const struct hmc5843_chip_info 
hmc5843_chip_info_tbl[] = {
[HMC5843_ID] = {
.channels = hmc5843_channels,
.regval_to_samp_freq = hmc5843_regval_to_samp_freq,
+   .n_regval_to_samp_freq =
+   ARRAY_SIZE(hmc5843_regval_to_samp_freq),
.regval_to_nanoscale = hmc5843_regval_to_nanoscale,
+   .n_regval_to_nanoscale =
+   ARRAY_SIZE(hmc5843_regval_to_nanoscale),
},
[HMC5883_ID] = {
 

[PATCH v5 (staging-next) 2/5] staging:iio:hmc5843: Split hmc5843.c to multiple files

2014-07-22 Thread Josef Gajdusek
This patch splits hmc5843.c to multiple files - the interface-agnostic
hmc5843_core.c, i2c specific hmc5843_i2c.c and header file hmc5843.h. This is
another step to add support of SPI-enabled hmc5983.

Signed-off-by: Josef Gajdusek 
---
 drivers/staging/iio/magnetometer/Kconfig   |  14 +-
 drivers/staging/iio/magnetometer/Makefile  |   3 +-
 drivers/staging/iio/magnetometer/hmc5843.h |  58 
 .../iio/magnetometer/{hmc5843.c => hmc5843_core.c} | 154 +
 drivers/staging/iio/magnetometer/hmc5843_i2c.c | 102 ++
 5 files changed, 203 insertions(+), 128 deletions(-)
 create mode 100644 drivers/staging/iio/magnetometer/hmc5843.h
 rename drivers/staging/iio/magnetometer/{hmc5843.c => hmc5843_core.c} (79%)
 create mode 100644 drivers/staging/iio/magnetometer/hmc5843_i2c.c

diff --git a/drivers/staging/iio/magnetometer/Kconfig 
b/drivers/staging/iio/magnetometer/Kconfig
index ad88d61..0a27f98 100644
--- a/drivers/staging/iio/magnetometer/Kconfig
+++ b/drivers/staging/iio/magnetometer/Kconfig
@@ -4,16 +4,22 @@
 menu "Magnetometer sensors"
 
 config SENSORS_HMC5843
-   tristate "Honeywell HMC5843/5883/5883L 3-Axis Magnetometer"
-   depends on I2C
+   tristate
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
+
+config SENSORS_HMC5843_I2C
+   tristate "Honeywell HMC5843/5883/5883L 3-Axis Magnetometer (I2C)"
+   depends on I2C
+   select SENSORS_HMC5843
select REGMAP_I2C
help
  Say Y here to add support for the Honeywell HMC5843, HMC5883 and
  HMC5883L 3-Axis Magnetometer (digital compass).
 
- To compile this driver as a module, choose M here: the module
- will be called hmc5843.
+ This driver can also be compiled as a set of modules.
+ If so, these modules will be created:
+ - hmc5843_core (core functions)
+ - hmc5843_i2c (support for HMC5843, HMC5883 and HMC5883L)
 
 endmenu
diff --git a/drivers/staging/iio/magnetometer/Makefile 
b/drivers/staging/iio/magnetometer/Makefile
index f9bfb2e..65baf1c 100644
--- a/drivers/staging/iio/magnetometer/Makefile
+++ b/drivers/staging/iio/magnetometer/Makefile
@@ -2,4 +2,5 @@
 # Makefile for industrial I/O Magnetometer sensors
 #
 
-obj-$(CONFIG_SENSORS_HMC5843)  += hmc5843.o
+obj-$(CONFIG_SENSORS_HMC5843)  += hmc5843_core.o
+obj-$(CONFIG_SENSORS_HMC5843_I2C)  += hmc5843_i2c.o
diff --git a/drivers/staging/iio/magnetometer/hmc5843.h 
b/drivers/staging/iio/magnetometer/hmc5843.h
new file mode 100644
index 000..06b2712
--- /dev/null
+++ b/drivers/staging/iio/magnetometer/hmc5843.h
@@ -0,0 +1,58 @@
+/*
+ * Header file for hmc5843 driver
+ *
+ * Split from hmc5843.c
+ * Copyright (C) Josef Gajdusek 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * */
+
+
+#ifndef HMC5843_CORE_H
+#define HMC5843_CORE_H
+
+#include 
+#include 
+
+#define HMC5843_CONFIG_REG_A   0x00
+#define HMC5843_CONFIG_REG_B   0x01
+#define HMC5843_MODE_REG   0x02
+#define HMC5843_DATA_OUT_MSB_REGS  0x03
+#define HMC5843_STATUS_REG 0x09
+#define HMC5843_ID_REG 0x0a
+#define HMC5843_ID_END 0x0c
+
+enum hmc5843_ids {
+   HMC5843_ID,
+   HMC5883_ID,
+   HMC5883L_ID,
+};
+
+struct hmc5843_data {
+   struct device *dev;
+   struct mutex lock;
+   struct regmap *regmap;
+   const struct hmc5843_chip_info *variant;
+   __be16 buffer[8]; /* 3x 16-bit channels + padding + 64-bit timestamp */
+};
+
+int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
+   enum hmc5843_ids id);
+int hmc5843_common_remove(struct device *dev);
+
+int hmc5843_common_suspend(struct device *dev);
+int hmc5843_common_resume(struct device *dev);
+
+#ifdef CONFIG_PM_SLEEP
+static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
+   hmc5843_common_suspend,
+   hmc5843_common_resume);
+#define HMC5843_PM_OPS (&hmc5843_pm_ops)
+#else
+#define HMC5843_PM_OPS NULL
+#endif
+
+#endif /* HMC5843_CORE_H */
diff --git a/drivers/staging/iio/magnetometer/hmc5843.c 
b/drivers/staging/iio/magnetometer/hmc5843_core.c
similarity index 79%
rename from drivers/staging/iio/magnetometer/hmc5843.c
rename to drivers/staging/iio/magnetometer/hmc5843_core.c
index 6f06f98..bdeaf43 100644
--- a/drivers/staging/iio/magnetometer/hmc5843.c
+++ b/drivers/staging/iio/magnetometer/hmc5843_core.c
@@ -4,6 +4,8 @@
 
 Support for HMC5883 and HMC5883L by Peter Meerwald .
 
+Split to multiple files by Josef Gajdusek  - 2014
+
 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
@

[PATCH v5 (staging-next) 1/5] staging:iio:hmc5843: Added regmap support

2014-07-22 Thread Josef Gajdusek
This patch changes hmc5843.c to use regmap. This provides transparent caching
to the code as well as abstraction necessary to add support for SPI-based
hmc5983.

Signed-off-by: Josef Gajdusek 
---
 drivers/staging/iio/magnetometer/Kconfig   |   1 +
 drivers/staging/iio/magnetometer/hmc5843.c | 140 +++--
 2 files changed, 96 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/iio/magnetometer/Kconfig 
b/drivers/staging/iio/magnetometer/Kconfig
index 34634da..ad88d61 100644
--- a/drivers/staging/iio/magnetometer/Kconfig
+++ b/drivers/staging/iio/magnetometer/Kconfig
@@ -8,6 +8,7 @@ config SENSORS_HMC5843
depends on I2C
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
+   select REGMAP_I2C
help
  Say Y here to add support for the Honeywell HMC5843, HMC5883 and
  HMC5883L 3-Axis Magnetometer (digital compass).
diff --git a/drivers/staging/iio/magnetometer/hmc5843.c 
b/drivers/staging/iio/magnetometer/hmc5843.c
index f595fdc..6f06f98 100644
--- a/drivers/staging/iio/magnetometer/hmc5843.c
+++ b/drivers/staging/iio/magnetometer/hmc5843.c
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -34,6 +35,7 @@
 #define HMC5843_DATA_OUT_MSB_REGS  0x03
 #define HMC5843_STATUS_REG 0x09
 #define HMC5843_ID_REG 0x0a
+#define HMC5843_ID_END 0x0c
 
 enum hmc5843_ids {
HMC5843_ID,
@@ -49,6 +51,7 @@ enum hmc5843_ids {
 #define HMC5843_RANGE_GAIN_OFFSET  0x05
 #define HMC5843_RANGE_GAIN_DEFAULT 0x01
 #define HMC5843_RANGE_GAINS8
+#define HMC5843_RANGE_GAIN_MASK0xe0
 
 /* Device status */
 #define HMC5843_DATA_READY 0x01
@@ -68,6 +71,7 @@ enum hmc5843_ids {
 #define HMC5843_RATE_OFFSET0x02
 #define HMC5843_RATE_DEFAULT   0x04
 #define HMC5843_RATES  7
+#define HMC5843_RATE_MASK  0x1c
 
 /* Device measurement configuration */
 #define HMC5843_MEAS_CONF_NORMAL   0x00
@@ -121,10 +125,7 @@ struct hmc5843_chip_info {
 struct hmc5843_data {
struct i2c_client *client;
struct mutex lock;
-   u8 rate;
-   u8 meas_conf;
-   u8 operating_mode;
-   u8 range;
+   struct regmap *regmap;
const struct hmc5843_chip_info *variant;
__be16 buffer[8]; /* 3x 16-bit channels + padding + 64-bit timestamp */
 };
@@ -135,10 +136,8 @@ static s32 hmc5843_set_mode(struct hmc5843_data *data, u8 
operating_mode)
int ret;
 
mutex_lock(&data->lock);
-   ret = i2c_smbus_write_byte_data(data->client, HMC5843_MODE_REG,
-   operating_mode & HMC5843_MODE_MASK);
-   if (ret >= 0)
-   data->operating_mode = operating_mode;
+   ret = regmap_update_bits(data->regmap, HMC5843_MODE_REG,
+   HMC5843_MODE_MASK, operating_mode);
mutex_unlock(&data->lock);
 
return ret;
@@ -146,15 +145,15 @@ static s32 hmc5843_set_mode(struct hmc5843_data *data, u8 
operating_mode)
 
 static int hmc5843_wait_measurement(struct hmc5843_data *data)
 {
-   s32 result;
int tries = 150;
+   int val;
+   int ret;
 
while (tries-- > 0) {
-   result = i2c_smbus_read_byte_data(data->client,
-   HMC5843_STATUS_REG);
-   if (result < 0)
-   return result;
-   if (result & HMC5843_DATA_READY)
+   ret = regmap_read(data->regmap, HMC5843_STATUS_REG, &val);
+   if (ret < 0)
+   return ret;
+   if (val & HMC5843_DATA_READY)
break;
msleep(20);
}
@@ -171,20 +170,20 @@ static int hmc5843_wait_measurement(struct hmc5843_data 
*data)
 static int hmc5843_read_measurement(struct hmc5843_data *data,
int idx, int *val)
 {
-   s32 result;
__be16 values[3];
+   int ret;
 
mutex_lock(&data->lock);
-   result = hmc5843_wait_measurement(data);
-   if (result < 0) {
+   ret = hmc5843_wait_measurement(data);
+   if (ret < 0) {
mutex_unlock(&data->lock);
-   return result;
+   return ret;
}
-   result = i2c_smbus_read_i2c_block_data(data->client,
-   HMC5843_DATA_OUT_MSB_REGS, sizeof(values), (u8 *) values);
+   ret = regmap_bulk_read(data->regmap, HMC5843_DATA_OUT_MSB_REGS,
+   values, sizeof(values));
mutex_unlock(&data->lock);
-   if (result < 0)
-   return -EINVAL;
+   if (ret < 0)
+   return ret;
 
*val = sign_extend32(be16_to_cpu(values[idx]), 15);
return IIO_VAL_INT;
@@ -208,16 +207,13 @@ static int hmc5843_read_measurement(struct hmc5843_data 
*data,
  * and BN.
  *
  *

[PATCH 3/5] staging: rtl8723au: Fix typo in rtw_xmit.c

2014-07-22 Thread Masanari Iida
This patch fix spelling typo in comments within rtw_xmit.c

Signed-off-by: Masanari Iida 
---
 drivers/staging/rtl8723au/core/rtw_xmit.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
b/drivers/staging/rtl8723au/core/rtw_xmit.c
index b917526..d83af87 100644
--- a/drivers/staging/rtl8723au/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
@@ -1197,7 +1197,7 @@ int rtw_xmitframe_coalesce23a(struct rtw_adapter 
*padapter, struct sk_buff *skb,
mpdu_len -= pattrib->icv_len;
 
if (bmcst)
-   /*  don't do fragment to broadcat/multicast packets */
+   /*  don't do fragment to broadcast/multicast packets */
mem_sz = min_t(s32, data_len, pattrib->pktlen);
else
mem_sz = min_t(s32, data_len, mpdu_len);
@@ -2011,7 +2011,7 @@ int xmitframe_enqueue_for_sleeping_sta23a(struct 
rtw_adapter *padapter, struct x
 
/* DBG_8723A("enqueue, sq_len =%d, tim =%x\n", 
psta->sleepq_len, pstapriv->tim_bitmap); */
 
-   /* tx bc/mc packets after upate bcn */
+   /* tx bc/mc packets after update bcn */
update_beacon23a(padapter, WLAN_EID_TIM, NULL, false);
 
/* spin_unlock_bh(&psta->sleep_q.lock); */
@@ -2068,7 +2068,7 @@ int xmitframe_enqueue_for_sleeping_sta23a(struct 
rtw_adapter *padapter, struct x
pstapriv->tim_bitmap |= CHKBIT(psta->aid);
 
if (psta->sleepq_len == 1) {
-   /* upate BCN for TIM IE */
+   /* update BCN for TIM IE */
update_beacon23a(padapter, WLAN_EID_TIM,
 NULL, false);
}
@@ -2227,7 +2227,7 @@ void wakeup_sta_to_xmit23a(struct rtw_adapter *padapter, 
struct sta_info *psta)
if (psta->sleepq_len == 0) {
pstapriv->tim_bitmap &= ~CHKBIT(psta->aid);
 
-   /* upate BCN for TIM IE */
+   /* update BCN for TIM IE */
update_mask = BIT(0);
 
if (psta->state&WIFI_SLEEP_STATE)
@@ -2274,7 +2274,7 @@ void wakeup_sta_to_xmit23a(struct rtw_adapter *padapter, 
struct sta_info *psta)
pstapriv->tim_bitmap &= ~BIT(0);
pstapriv->sta_dz_bitmap &= ~BIT(0);
 
-   /* upate BCN for TIM IE */
+   /* update BCN for TIM IE */
/* update_BCNTIM(padapter); */
update_mask |= BIT(1);
}
@@ -2348,7 +2348,7 @@ void xmit_delivery_enabled_frames23a(struct rtw_adapter 
*padapter,
(wmmps_ac)) {
pstapriv->tim_bitmap &= ~CHKBIT(psta->aid);
 
-   /* upate BCN for TIM IE */
+   /* update BCN for TIM IE */
update_beacon23a(padapter, WLAN_EID_TIM, NULL, false);
}
}
-- 
2.0.1.537.g81e776d

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


[PATCH] staging: unisys: fix and remove virthba comments

2014-07-22 Thread Erik Arfvidson
This patch fixes formatting and cleans up unneeded comments

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/virthba/virthba.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
index 65a75c8..ef7242ee 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -1449,7 +1449,7 @@ static ssize_t enable_ints_write(struct file *file,
return -EFAULT;
}
 
-   /*set all counts to new_value usually 0*/
+   /* set all counts to new_value usually 0 */
for (i = 0; i < VIRTHBASOPENMAX; i++) {
if (VirtHbasOpen[i].virthbainfo != NULL) {
virthbainfo = VirtHbasOpen[i].virthbainfo;
@@ -1747,7 +1747,6 @@ virthba_mod_exit(void)
virthba_serverdown_workqueue = NULL;
}
 
-   /* remove debugfs directory and files. */
debugfs_remove_recursive(virthba_debugfs_dir);
LOGINF("Leaving virthba_mod_exit\n");
 
-- 
1.9.1

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


[PATCH 5/5] staging: rtl8723au: Fix typo in rtl8723au/core

2014-07-22 Thread Masanari Iida
This patch fix spelling typo in comments within
rtl8723au/core.

Signed-off-by: Masanari Iida 
---
 drivers/staging/rtl8723au/core/rtw_cmd.c   | 4 ++--
 drivers/staging/rtl8723au/core/rtw_efuse.c | 6 +++---
 drivers/staging/rtl8723au/core/rtw_ieee80211.c | 2 +-
 drivers/staging/rtl8723au/core/rtw_pwrctrl.c   | 2 +-
 drivers/staging/rtl8723au/core/rtw_recv.c  | 8 
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c 
b/drivers/staging/rtl8723au/core/rtw_cmd.c
index df1ffb3..25d65b2 100644
--- a/drivers/staging/rtl8723au/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723au/core/rtw_cmd.c
@@ -322,7 +322,7 @@ post_process:
  pcmd_callback, pcmd->cmdcode));
rtw_free_cmd_obj23a(pcmd);
} else {
-   /* need conider that free cmd_obj in
+   /* need consider that free cmd_obj in
   rtw_cmd_callback */
pcmd_callback(pcmd->padapter, pcmd);
}
@@ -736,7 +736,7 @@ int rtw_setstakey_cmd23a(struct rtw_adapter *padapter, u8 
*psta, u8 unicast_key)
   &psecuritypriv->dot118021XGrpKey[idx].skey, 16);
 }
 
-   /* jeff: set this becasue at least sw key is ready */
+   /* jeff: set this because at least sw key is ready */
padapter->securitypriv.busetkipkey = 1;
 
res = rtw_enqueue_cmd23a(pcmdpriv, ph2c);
diff --git a/drivers/staging/rtl8723au/core/rtw_efuse.c 
b/drivers/staging/rtl8723au/core/rtw_efuse.c
index cc063cb..345bff8 100644
--- a/drivers/staging/rtl8723au/core/rtw_efuse.c
+++ b/drivers/staging/rtl8723au/core/rtw_efuse.c
@@ -59,7 +59,7 @@ static void Efuse_PowerSwitch(struct rtw_adapter *padapter,
rtl8723au_write8(padapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON);
 
/*  1.2V Power: From VDDON with Power
-   Cut(0xh[15]), defualt valid */
+   Cut(0xh[15]), default valid */
tmpV16 = rtl8723au_read16(padapter, REG_SYS_ISO_CTRL);
if (!(tmpV16 & PWC_EV12V)) {
tmpV16 |= PWC_EV12V;
@@ -144,7 +144,7 @@ Efuse_CalculateWordCnts23a(u8 word_en)
 /*  */
 /* Description: */
 /* Execute E-Fuse read byte operation. */
-/* Refered from SD1 Richard. */
+/* Referred from SD1 Richard. */
 /*  */
 /* Assumption: */
 /* 1. Boot from E-Fuse and successfully auto-load. */
@@ -521,7 +521,7 @@ static int efuse_write8(struct rtw_adapter *padapter, u16 
address, u8 *value)
 }
 
 /*
- * read/wirte raw efuse data
+ * read/write raw efuse data
  */
 int rtw_efuse_access23a(struct rtw_adapter *padapter, u8 bWrite, u16 
start_addr,
u16 cnts, u8 *data)
diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723au/core/rtw_ieee80211.c
index 78a7b27..23e6662 100644
--- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c
@@ -250,7 +250,7 @@ u8 *rtw_get_ie23a_ex(u8 *in_ie, uint in_len, u8 eid, u8 
*oui, u8 oui_len,
  * rtw_ies_remove_ie23a - Find matching IEs and remove
  * @ies: Address of IEs to search
  * @ies_len: Pointer of length of ies, will update to new length
- * @offset: The offset to start scarch
+ * @offset: The offset to start search
  * @eid: Element ID to match
  * @oui: OUI to match
  * @oui_len: OUI length
diff --git a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c 
b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c
index ad06335..7fbbdaf 100644
--- a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c
@@ -498,7 +498,7 @@ inline void rtw_set_ips_deny23a(struct rtw_adapter 
*padapter, u32 ms)
 /*
 * rtw_pwr_wakeup - Wake the NIC up from: 1)IPS. 2)USB autosuspend
 * @adapter: pointer to _adapter structure
-* @ips_deffer_ms: the ms wiil prevent from falling into IPS after wakeup
+* @ips_deffer_ms: the ms will prevent from falling into IPS after wakeup
 * Return _SUCCESS or _FAIL
 */
 
diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c 
b/drivers/staging/rtl8723au/core/rtw_recv.c
index 690970e..a9f8183 100644
--- a/drivers/staging/rtl8723au/core/rtw_recv.c
+++ b/drivers/staging/rtl8723au/core/rtw_recv.c
@@ -1185,7 +1185,7 @@ static int validate_recv_ctrl_frame(struct rtw_adapter 
*padapter,
 
/* DBG_8723A("after handling ps-poll, 
tim =%x\n", pstapriv->tim_bitmap); */
 
-   /* upate BCN for TIM IE */
+   /* update BCN for TIM IE */
/* update_BCNTIM(padapter); */
update_beacon23a(padapter, WLAN_EID_TIM,
 NULL, false);
@@ -1217,7 +1217,7 @@ static int validate_recv_ctrl_frame(struct rtw_adapter 

[PATCH 4/5] staging: rtl8723au: Fix typo in rtw_ap.c

2014-07-22 Thread Masanari Iida
This patch fix spelling typo in comments within rtw_ap.c

Signed-off-by: Masanari Iida 
---
 drivers/staging/rtl8723au/core/rtw_ap.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c 
b/drivers/staging/rtl8723au/core/rtw_ap.c
index 14c8d4e..4d2880a 100644
--- a/drivers/staging/rtl8723au/core/rtw_ap.c
+++ b/drivers/staging/rtl8723au/core/rtw_ap.c
@@ -93,7 +93,7 @@ static void update_BCNTIM(struct rtw_adapter *padapter)
} else {
tim_ielen = 0;
 
-   /* calulate head_len */
+   /* calculate head_len */
offset = 0;
 
/* get ssid_ie len */
@@ -135,7 +135,7 @@ static void update_BCNTIM(struct rtw_adapter *padapter)
*dst_ie++= tim_ielen;
 
*dst_ie++= 0;/* DTIM count */
-   *dst_ie++= 1;/* DTIM peroid */
+   *dst_ie++= 1;/* DTIM period */
 
if (pstapriv->tim_bitmap & BIT(0))/* for bc/mc frames */
*dst_ie++ = BIT(0);/* bitmap ctrl */
@@ -243,7 +243,7 @@ voidexpire_timeout_chk23a(struct rtw_adapter 
*padapter)
 
if (psta->state & WIFI_SLEEP_STATE) {
if (!(psta->state & WIFI_STA_ALIVE_CHK_STATE)) {
-   /* to check if alive by another methods 
if staion is at ps mode. */
+   /* to check if alive by another methods 
if station is at ps mode. */
psta->expire_to = pstapriv->expire_to;
psta->state |= WIFI_STA_ALIVE_CHK_STATE;
 
@@ -764,7 +764,7 @@ static void start_bss_network(struct rtw_adapter *padapter, 
u8 *pbuf)
/* update cur_wireless_mode */
update_wireless_mode23a(padapter);
 
-   /* udpate capability after cur_wireless_mode updated */
+   /* update capability after cur_wireless_mode updated */
update_capinfo23a(padapter, pnetwork->capability);
 
/* let pnetwork_mlmeext == pnetwork_mlme. */
@@ -844,7 +844,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter,
pbss_network->Ssid.ssid_len = ie_len;
}
 
-   /* chnnel */
+   /* channel */
channel = 0;
p = rtw_get_ie23a(ie, WLAN_EID_DS_PARAMS, &ie_len,
  pbss_network->IELength);
@@ -1305,7 +1305,7 @@ void update_beacon23a(struct rtw_adapter *padapter, u8 
ie_id, u8 *oui, u8 tx)
 
 /*
 op_mode
-Set to 0 (HT pure) under the followign conditions
+Set to 0 (HT pure) under the following conditions
- all STAs in the BSS are 20/40 MHz HT in 20/40 MHz BSS or
- all STAs in the BSS are 20 MHz HT in 20 MHz BSS
 Set to 1 (HT non-member protection) if there may be non-HT STAs
@@ -1387,7 +1387,7 @@ static int rtw_ht_operation_update(struct rtw_adapter 
*padapter)
 
 void associated_clients_update23a(struct rtw_adapter *padapter, u8 updated)
 {
-   /* update associcated stations cap. */
+   /* update associated stations cap. */
if (updated == true)
{
struct list_head *phead, *plist, *ptmp;
@@ -1572,7 +1572,7 @@ void bss_cap_update_on_sta_join23a(struct rtw_adapter 
*padapter, struct sta_info
update_beacon23a(padapter, WLAN_EID_HT_OPERATION, NULL, true);
}
 
-   /* update associcated stations cap. */
+   /* update associated stations cap. */
associated_clients_update23a(padapter,  beacon_updated);
 
DBG_8723A("%s, updated =%d\n", __func__, beacon_updated);
@@ -1641,7 +1641,7 @@ u8 bss_cap_update_on_sta_leave23a(struct rtw_adapter 
*padapter, struct sta_info
update_beacon23a(padapter, WLAN_EID_HT_OPERATION, NULL, true);
}
 
-   /* update associcated stations cap. */
+   /* update associated stations cap. */
 
DBG_8723A("%s, updated =%d\n", __func__, beacon_updated);
 
-- 
2.0.1.537.g81e776d

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


[PATCH 2/5] staging: rtl8723au: Fix typo in rtw_mlme.c

2014-07-22 Thread Masanari Iida
This patch fix spelling typo in comments within rtw_mlme.c

Signed-off-by: Masanari Iida 
---
 drivers/staging/rtl8723au/core/rtw_mlme.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c 
b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 4827280..c475b79 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -134,7 +134,7 @@ static void _rtw_free_network23a(struct mlme_priv 
*pmlmepriv,
 /*
  return the wlan_network with the matching addr
 
- Shall be calle under atomic context... to avoid possible racing condition...
+ Shall be called under atomic context... to avoid possible racing condition...
 */
 struct wlan_network *
 rtw_find_network23a(struct rtw_queue *scanned_queue, u8 *addr)
@@ -395,7 +395,7 @@ void update_network23a(struct wlan_bssid_ex *dst, struct 
wlan_bssid_ex *src,
(u32)dst->PhyInfo.SignalQuality * 4) / 5;
rssi_final = src->Rssi+dst->Rssi * 4 / 5;
} else {
-   /* bss info not receving from the right channel, use
+   /* bss info not receiving from the right channel, use
   the original RX signal infos */
ss_final = dst->PhyInfo.SignalStrength;
sq_final = dst->PhyInfo.SignalQuality;
@@ -490,7 +490,7 @@ static void rtw_update_scanned_network(struct rtw_adapter 
*adapter,
pnetwork->aid = 0;
pnetwork->join_res = 0;
 
-   /* bss info not receving from the right channel */
+   /* bss info not receiving from the right channel */
if (pnetwork->network.PhyInfo.SignalQuality == 101)
pnetwork->network.PhyInfo.SignalQuality = 0;
} else {
@@ -956,7 +956,7 @@ rtw_joinbss_update_stainfo(struct rtw_adapter *padapter,
/*  Commented by Albert 2012/07/21 */
/*  When doing the WPS, the wps_ie_len won't equal to 0 */
/*  And the Wi-Fi driver shouldn't allow the data packet
-   to be tramsmitted. */
+   to be transmitted. */
if (padapter->securitypriv.wps_ie_len != 0) {
psta->ieee8021x_blocked = true;
padapter->securitypriv.wps_ie_len = 0;
@@ -964,7 +964,7 @@ rtw_joinbss_update_stainfo(struct rtw_adapter *padapter,
 
/* for A-MPDU Rx reordering buffer control for bmc_sta &
 * sta_info */
-   /* if A-MPDU Rx is enabled, reseting
+   /* if A-MPDU Rx is enabled, resetting
   rx_ordering_ctrl wstart_b(indicate_seq) to default
   value = 0x */
/* todo: check if AP can send A-MPDU packets */
@@ -1073,7 +1073,7 @@ rtw_joinbss_update_network23a(struct rtw_adapter 
*padapter,
 
 /*
  * Notes:
- * the fucntion could be > passive_level (the same context as Rx tasklet)
+ * the function could be > passive_level (the same context as Rx tasklet)
  * pnetwork : returns from rtw23a_joinbss_event_cb
  * ptarget_wlan: found from scanned_queue
  * if join_res > 0, for (fw_state==WIFI_STATION_STATE),
@@ -1419,7 +1419,7 @@ void rtw_stadel_event_callback23a(struct rtw_adapter 
*adapter, const u8 *pbuf)
 }
 
 /*
-* rtw23a_join_to_handler - Timeout/faliure handler for CMD JoinBss
+* rtw23a_join_to_handler - Timeout/failure handler for CMD JoinBss
 * @adapter: pointer to _adapter structure
 */
 void rtw23a_join_to_handler (unsigned long data)
@@ -1470,7 +1470,7 @@ void rtw23a_join_to_handler (unsigned long data)
 }
 
 /*
-* rtw_scan_timeout_handler23a - Timeout/Faliure handler for CMD SiteSurvey
+* rtw_scan_timeout_handler23a - Timeout/Failure handler for CMD SiteSurvey
 * @data: pointer to _adapter structure
 */
 void rtw_scan_timeout_handler23a(unsigned long data)
@@ -2102,7 +2102,7 @@ void rtw_update_registrypriv_dev_network23a(struct 
rtw_adapter* adapter)
/* pdev_network->IELength = cpu_to_le32(sz); */
 }
 
-/* the fucntion is at passive_level */
+/* the function is at passive_level */
 void rtw_joinbss_reset23a(struct rtw_adapter *padapter)
 {
u8 threshold;
@@ -2131,7 +2131,7 @@ void rtw_joinbss_reset23a(struct rtw_adapter *padapter)
rtl8723a_set_rxdma_agg_pg_th(padapter, threshold);
 }
 
-/* the fucntion is >= passive_level */
+/* the function is >= passive_level */
 bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
  u8 *out_ie, uint in_len, uint *pout_len)
 {
@@ -2203,7 +2203,7 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter 
*padapter, u8 *in_ie,
return phtpriv->ht_option;
 }
 
-/* the fucntion is > passive_level (in critical_section) */
+/* the function is > passive_level (in critical_section) */
 void rtw_update_ht_cap23a(struct rtw_adapter *padapter, u8

[PATCH 1/5] staging: rtl8723au: Fix typo in rtw_mlme_ext.c

2014-07-22 Thread Masanari Iida
This patch fix spelling typo in comments within rtw_mlme_ext.c

Signed-off-by: Masanari Iida 
---
 drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
index 18e4d24..c5fdcb8 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
@@ -2213,7 +2213,7 @@ exit:
 
 /
 
-Following are some TX fuctions for WiFi MLME
+Following are some TX functions for WiFi MLME
 
 */
 
@@ -3352,7 +3352,7 @@ exit:
return;
 }
 
-/* when wait_ack is ture, this function shoule be called at process context */
+/* when wait_ack is true, this function should be called at process context */
 static int _issue_nulldata23a(struct rtw_adapter *padapter, unsigned char *da,
  unsigned int power_mode, int wait_ack)
 {
@@ -3423,7 +3423,7 @@ exit:
return ret;
 }
 
-/* when wait_ms >0 , this function shoule be called at process context */
+/* when wait_ms >0 , this function should be called at process context */
 /* da == NULL for station mode */
 int issue_nulldata23a(struct rtw_adapter *padapter, unsigned char *da,
  unsigned int power_mode, int try_cnt, int wait_ms)
@@ -3434,7 +3434,7 @@ int issue_nulldata23a(struct rtw_adapter *padapter, 
unsigned char *da,
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
-   /* da == NULL, assum it's null data for sta to ap*/
+   /* da == NULL, assume it's null data for sta to ap*/
if (da == NULL)
da = get_my_bssid23a(&pmlmeinfo->network);
 
@@ -3476,7 +3476,7 @@ exit:
return ret;
 }
 
-/* when wait_ack is ture, this function shoule be called at process context */
+/* when wait_ack is true, this function should be called at process context */
 static int _issue_qos_nulldata23a(struct rtw_adapter *padapter,
  unsigned char *da, u16 tid, int wait_ack)
 {
@@ -3551,7 +3551,7 @@ exit:
return ret;
 }
 
-/* when wait_ms >0 , this function shoule be called at process context */
+/* when wait_ms >0 , this function should be called at process context */
 /* da == NULL for station mode */
 int issue_qos_nulldata23a(struct rtw_adapter *padapter, unsigned char *da,
  u16 tid, int try_cnt, int wait_ms)
@@ -3562,7 +3562,7 @@ int issue_qos_nulldata23a(struct rtw_adapter *padapter, 
unsigned char *da,
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
-   /* da == NULL, assum it's null data for sta to ap*/
+   /* da == NULL, assume it's null data for sta to ap*/
if (da == NULL)
da = get_my_bssid23a(&pmlmeinfo->network);
 
@@ -4023,7 +4023,7 @@ int send_beacon23a(struct rtw_adapter *padapter)
 
 /
 
-Following are some utitity fuctions for WiFi MLME
+Following are some utitity functions for WiFi MLME
 
 */
 
@@ -4303,7 +4303,7 @@ static struct wlan_bssid_ex *collect_bss_info(struct 
rtw_adapter *padapter,
}
 
 
-   /*  mark bss info receving from nearby channel as SignalQuality 101 */
+   /*  mark bss info receiving from nearby channel as SignalQuality 101 */
if (bssid->DSConfig != rtw_get_oper_ch23a(padapter))
bssid->PhyInfo.SignalQuality = 101;
 
@@ -4325,7 +4325,7 @@ static void start_create_ibss(struct rtw_adapter* 
padapter)
/* update wireless mode */
update_wireless_mode23a(padapter);
 
-   /* udpate capability */
+   /* update capability */
caps = pnetwork->capability;
update_capinfo23a(padapter, caps);
if (caps & WLAN_CAPABILITY_IBSS) {  /* adhoc master */
@@ -4377,7 +4377,7 @@ static void start_clnt_join(struct rtw_adapter* padapter)
/* update wireless mode */
update_wireless_mode23a(padapter);
 
-   /* udpate capability */
+   /* update capability */
caps = pnetwork->capability;
update_capinfo23a(padapter, caps);
if (caps & WLAN_CAPABILITY_ESS) {
@@ -5073,7 +5073,7 @@ void mlmeext_joinbss_event_callback23a(struct rtw_adapter 
*padapter,
/* BCN interval */
rtl8723a_set_beacon_interval(padapter, pmlmeinfo->bcn_interval);
 
-   /* udpate capability */
+   /* update capability */
update_capinfo23a(padapter, pmlmeinfo->capability);
 
/* WMM, Update EDCA param */
@@ -5851,7 +5851,7 @@ int sitesurvey_cmd_hdl23a(struct rtw_adapter *padapter, 
const u8 *

[PATCH 7/8 v2] staging: unisys: remove partition information from proc

2014-07-22 Thread Benjamin Romer
Debugging information for the guest's channels was being exposed in proc.
Remove the code that creates these entries, which are no longer needed.

Signed-off-by: Benjamin Romer 
---
v2: patch location changed due to prior patches being revised.

 .../unisys/visorchipset/visorchipset_main.c| 100 -
 1 file changed, 100 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 134f028..1b6db5d 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -98,38 +98,9 @@ static CONTROLVM_MESSAGE_PACKET g_DeviceChangeStatePacket;
 #define is_diagpool_channel(channel_type_guid) \
 (uuid_le_cmp(channel_type_guid, UltraDiagPoolChannelProtocolGuid) == 0)
 
-typedef enum {
-   PARTPROP_invalid,
-   PARTPROP_name,
-   PARTPROP_description,
-   PARTPROP_handle,
-   PARTPROP_busNumber,
-   /* add new properties above, but don't forget to change
-* InitPartitionProperties() and show_partition_property() also...
-*/
-   PARTPROP_last
-} PARTITION_property;
-static const char *PartitionTypeNames[] = { "partition", NULL };
-
-static char *PartitionPropertyNames[PARTPROP_last + 1];
-static void
-InitPartitionProperties(void)
-{
-   char **p = PartitionPropertyNames;
-   p[PARTPROP_invalid] = "";
-   p[PARTPROP_name] = "name";
-   p[PARTPROP_description] = "description";
-   p[PARTPROP_handle] = "handle";
-   p[PARTPROP_busNumber] = "busNumber";
-   p[PARTPROP_last] = NULL;
-}
-
-static MYPROCTYPE *PartitionType;
-
 static LIST_HEAD(BusInfoList);
 static LIST_HEAD(DevInfoList);
 
-static struct proc_dir_entry *ProcDir;
 static VISORCHANNEL *ControlVm_channel;
 
 typedef struct {
@@ -510,52 +481,6 @@ ssize_t remaining_steps_store(struct device *dev, struct 
device_attribute *attr,
return -EIO;
 }
 
-static void
-show_partition_property(struct seq_file *f, void *ctx, int property)
-{
-   VISORCHIPSET_BUS_INFO *info = (VISORCHIPSET_BUS_INFO *) (ctx);
-
-   switch (property) {
-   case PARTPROP_name:
-   seq_printf(f, "%s\n", NONULLSTR(info->name));
-   break;
-   case PARTPROP_description:
-   seq_printf(f, "%s\n", NONULLSTR(info->description));
-   break;
-   case PARTPROP_handle:
-   seq_printf(f, "0x%-16.16Lx\n", info->partitionHandle);
-   break;
-   case PARTPROP_busNumber:
-   seq_printf(f, "%d\n", info->busNo);
-   break;
-   default:
-   seq_printf(f, "(%d??)\n", property);
-   break;
-   }
-}
-
-static void
-proc_Init(void)
-{
-   if (ProcDir == NULL) {
-   ProcDir = proc_mkdir(MYDRVNAME, NULL);
-   if (ProcDir == NULL) {
-   LOGERR("failed to create /proc directory %s",
-  MYDRVNAME);
-   POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC,
-POSTCODE_SEVERITY_ERR);
-   }
-   }
-}
-
-static void
-proc_DeInit(void)
-{
-   if (ProcDir != NULL)
-   remove_proc_entry(MYDRVNAME, NULL);
-   ProcDir = NULL;
-}
-
 #if 0
 static void
 testUnicode(void)
@@ -1258,16 +1183,6 @@ bus_configure(CONTROLVM_MESSAGE *inmsg, PARSER_CONTEXT 
*parser_ctx)
pBusInfo->name = parser_string_get(parser_ctx);
 
visorchannel_uuid_id(&pBusInfo->partitionGuid, s);
-   pBusInfo->procObject =
-   visor_proc_CreateObject(PartitionType, s, (void *) (pBusInfo));
-   if (pBusInfo->procObject == NULL) {
-   LOGERR("CONTROLVM_BUS_CONFIGURE Failed: busNo=%lu failed to 
create /proc entry",
-busNo);
-   POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, busNo,
-POSTCODE_SEVERITY_ERR);
-   rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
-   goto Away;
-   }
POSTCODE_LINUX_3(BUS_CONFIGURE_EXIT_PC, busNo, POSTCODE_SEVERITY_INFO);
 Away:
bus_epilog(busNo, CONTROLVM_BUS_CONFIGURE, &inmsg->hdr,
@@ -2450,15 +2365,6 @@ visorchipset_init(void)
goto Away;
}
 
-   proc_Init();
-   memset(PartitionPropertyNames, 0, sizeof(PartitionPropertyNames));
-   InitPartitionProperties();
-
-   PartitionType = visor_proc_CreateType(ProcDir, PartitionTypeNames,
- (const char **)
- PartitionPropertyNames,
- &show_partition_property);
-
memset(&g_DiagMsgHdr, 0, sizeof(CONTROLVM_MESSAGE_HEADER));
 
memset(&g_ChipSetMsgHdr, 0, sizeof(CONTROLVM_MESSAGE_HEADER));
@@ -2551,18 +2457,12 @@ visorchipset_exit(void)
 
cleanup_controlvm_structures();
 
-   if (PartitionType) {
-  

[PATCH 3/8 v2] staging: unisys: move installer to sysfs and split fields

2014-07-22 Thread Benjamin Romer
The installer entry in /proc/visorchipset/installer was composed of three
separate fields as one entry. This patch removes the proc entry and associated
functions, and creates new fields with distinct entries under sysfs in the
visorchipset/install directory. The fields are:

textid: used to send the ID of a string that should be displayed on
s-Par's automatic installation progress screen. Setting this
field when not in installation mode (boottotool was set on
the previous guest boot) has no effect.

remaining_steps: used to set the value of the progress bar on the
s-Par automatic installation progress screen. This field has
no effect if not in installation mode.

error: used to send the ID of a string that should be displayed on
s-Par's automatic installation progress screen when an error
is encountered during installation. This field has no effect
if not in installation mode.

Signed-off-by: Benjamin Romer 
---
v2: attribute creation was fixed and checks for controlvm_channel pointer were
removed.

 .../unisys/visorchipset/visorchipset_main.c| 233 ++---
 1 file changed, 106 insertions(+), 127 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 48db6ee..a20e21b 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -144,16 +144,6 @@ static VISORCHANNEL *ControlVm_channel;
 static ssize_t visorchipset_proc_read_writeonly(struct file *file,
char __user *buf,
size_t len, loff_t *offset);
-static ssize_t proc_read_installer(struct file *file, char __user *buf,
-  size_t len, loff_t *offset);
-static ssize_t proc_write_installer(struct file *file,
-   const char __user *buffer,
-   size_t count, loff_t *ppos);
-
-static const struct file_operations proc_installer_fops = {
-   .read = proc_read_installer,
-   .write = proc_write_installer,
-};
 
 typedef struct {
U8 __iomem *ptr;/* pointer to base address of payload pool */
@@ -315,9 +305,30 @@ static ssize_t boottotool_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count);
 static DEVICE_ATTR_RW(boottotool);
 
+static ssize_t error_show(struct device *dev, struct device_attribute *attr,
+   char *buf);
+static ssize_t error_store(struct device *dev, struct device_attribute *attr,
+   const char *buf, size_t count);
+static DEVICE_ATTR_RW(error);
+
+static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
+   char *buf);
+static ssize_t textid_store(struct device *dev,struct device_attribute 
*attr,
+   const char *buf, size_t count);
+static DEVICE_ATTR_RW(textid);
+
+static ssize_t remaining_steps_show(struct device *dev,
+   struct device_attribute *attr, char *buf);
+static ssize_t remaining_steps_store(struct device *dev,
+   struct device_attribute *attr, const char *buf, size_t count);
+static DEVICE_ATTR_RW(remaining_steps);
+
 static struct attribute *visorchipset_install_attrs[] = {
&dev_attr_toolaction.attr,
&dev_attr_boottotool.attr,
+   &dev_attr_error.attr,
+   &dev_attr_textid.attr,
+   &dev_attr_remaining_steps.attr,
NULL
 };
 
@@ -407,6 +418,91 @@ ssize_t boottotool_store(struct device *dev, struct 
device_attribute *attr,
} else
return -EIO;
 }
+
+ssize_t error_show(struct device *dev, struct device_attribute *attr,
+   char *buf)
+{
+   U32 error;
+
+   visorchannel_read(ControlVm_channel, offsetof(
+   ULTRA_CONTROLVM_CHANNEL_PROTOCOL, InstallationError),
+   &error, sizeof(U32));
+   return scnprintf(buf, PAGE_SIZE, "%i\n", error);
+}
+
+ssize_t error_store(struct device *dev, struct device_attribute *attr,
+   const char *buf, size_t count)
+{
+   U32 error;
+
+   if (sscanf(buf, "%i\n", &error) == 1) {
+   if (visorchannel_write(ControlVm_channel,
+   offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
+   InstallationError),
+   &error, sizeof(U32)) == 1) {
+   return count;
+   }
+   }
+   return -EIO;
+}
+
+ssize_t textid_show(struct device *dev, struct device_attribute *attr,
+   char *buf)
+{
+   U32 textId;
+
+   visorchannel_read(ControlVm_channel, offsetof(
+   ULTRA_CONTROLVM_CHANNEL_PROTOCOL, InstallationTextId),
+   &textId, sizeof(U32));
+   return scnprintf(buf, PAGE_SIZE, "%i\n", textId

[PATCH 8/8 v2] staging: unisys: ABI documentation for new sysfs entries

2014-07-22 Thread Benjamin Romer
This patch adds a documentation file for all of the interfaces that were moved
to sysfs by the other patches in this set.

Signed-off-by: Benjamin Romer 
---
v2: whitespace errors were corrected.

 .../Documentation/ABI/sysfs-platform-visorchipset  | 74 ++
 1 file changed, 74 insertions(+)
 create mode 100644 
drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset

diff --git 
a/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset 
b/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
new file mode 100644
index 000..b6cad24
--- /dev/null
+++ b/drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset
@@ -0,0 +1,74 @@
+What:  install/error
+Date:  7/18/2014
+KernelVersion: TBD
+Contact:   sparmaintai...@unisys.com
+Description:   used to send the ID of a string that should be displayed on
+   s-Par's automatic installation progress screen when an error
+   is encountered during installation. This field has no effect
+   if not in installation mode.
+Users: sparmaintai...@unisys.com
+
+What:  install/remainingsteps
+Date:  7/18/2014
+KernelVersion: TBD
+Contact:   sparmaintai...@unisys.com
+Description:   used to set the value of the progress bar on the s-Par automatic
+   installation progress screen. This field has no effect if not in
+   installation mode.
+Users: sparmaintai...@unisys.com
+
+What:  install/textid
+Date:  7/18/2014
+KernelVersion: TBD
+Contact:   sparmaintai...@unisys.com
+Description:   used to send the ID of a string that should be displayed on
+   s-Par's automatic installation progress screen. Setting this
+   field when not in installation mode (boottotool was set on
+   the previous guest boot) has no effect.
+Users: sparmaintai...@unisys.com
+
+What:  install/boottotool
+Date:  7/18/2014
+KernelVersion: TBD
+Contact:   sparmaintai...@unisys.com
+Description:   The boottotool flag controls s-Par behavior on the next boot of
+   this guest. Setting the flag will cause the guest to boot from
+   the utility and installation image, which will use the value in
+   the toolaction field to determine what operation is being
+   requested.
+Users: sparmaintai...@unisys.com
+
+What:  install/toolaction
+Date:  7/18/2014
+KernelVersion: TBD
+Contact:   sparmaintai...@unisys.com
+Description:   This field is used to tell s-Par which type of recovery tool
+   action to perform on the next guest boot-up. The meaning of the
+   value is dependent on the type of installation software used to
+   commission the guest.
+Users: sparmaintai...@unisys.com
+
+What:  guest/chipsetready
+Date:  7/18/2014
+KernelVersion: TBD
+Contact:   sparmaintai...@unisys.com
+Description:   This entry is used by Unisys application software on the guest
+   to acknowledge completion of specific events for integration
+   purposes, but these acknowledgements are not required for the
+   guest to operate correctly.
+Users: sparmaintai...@unisys.com
+
+What:  guest/parahotplug
+Date:  7/18/2014
+KernelVersion: TBD
+Contact:   sparmaintai...@unisys.com
+Description:   The parahotplug interface is used to deal with recovery
+   situations on s-Par guest partitions. The command service
+   partition will send a message to a guest when a device that
+   guest is using needs to be temporarily removed. The message
+   triggers a udev event that will cause a recovery script to run.
+   When that script has completed its work, it will write to the
+   parahotplug interface to send a message back to Command
+   indicating that it is safe to remove the device.
+Users: sparmaintai...@unisys.com
+
-- 
1.9.1

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


[PATCH 5/8 v2] staging: unisys: move parahotplug to sysfs

2014-07-22 Thread Benjamin Romer
Move the /proc/visorchipset/parahotplug interface to sysfs under
/sys/devices/platform/visorchipset/guest/parahotplug.

The parahotplug interface is used to deal with recovery situations on s-Par
guest partitions. The command service partition will send a message to a guest
when a device that guest is using needs to be temporarily removed. The message
triggers a udev event that will cause a recovery script to run. When that
script has completed its work, it will write to the parahotplug interface to
send a message back to Command indicating that it is safe to remove the device.

Moving this interface to sysfs orphans the visorchipset_proc_read_writeonly()
function, so it is also removed.

Signed-off-by: Benjamin Romer 
---
v2: attribute creation was fixed and checks for controlvm_channel pointer were
removed.

 .../unisys/visorchipset/visorchipset_main.c| 59 --
 1 file changed, 11 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 74ab15b..c88f95f 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -129,19 +129,12 @@ static MYPROCTYPE *PartitionType;
 #define VISORCHIPSET_DIAG_PROC_ENTRY_FN "diagdump"
 static struct proc_dir_entry *diag_proc_dir;
 
-#define VISORCHIPSET_PARAHOTPLUG_PROC_ENTRY_FN "parahotplug"
-static struct proc_dir_entry *parahotplug_proc_dir;
-
 static LIST_HEAD(BusInfoList);
 static LIST_HEAD(DevInfoList);
 
 static struct proc_dir_entry *ProcDir;
 static VISORCHANNEL *ControlVm_channel;
 
-static ssize_t visorchipset_proc_read_writeonly(struct file *file,
-   char __user *buf,
-   size_t len, loff_t *offset);
-
 typedef struct {
U8 __iomem *ptr;/* pointer to base address of payload pool */
U64 offset; /* offset from beginning of controlvm
@@ -324,6 +317,10 @@ static ssize_t chipsetready_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count);
 static DEVICE_ATTR_WO(chipsetready);
 
+static ssize_t parahotplug_store(struct device *dev,
+   struct device_attribute *attr, const char *buf, size_t count);
+static DEVICE_ATTR_WO(parahotplug);
+
 static struct attribute *visorchipset_install_attrs[] = {
&dev_attr_toolaction.attr,
&dev_attr_boottotool.attr,
@@ -340,6 +337,7 @@ static struct attribute_group visorchipset_install_group = {
 
 static struct attribute *visorchipset_guest_attrs[] = {
&dev_attr_chipsetready.attr,
+   &dev_attr_parahotplug.attr,
NULL
 };
 
@@ -1812,30 +1810,17 @@ parahotplug_process_message(CONTROLVM_MESSAGE *inmsg)
 
 /*
  * Gets called when the udev script writes to
- * /proc/visorchipset/parahotplug.  Expects input in the form of "
- * " where  is the identifier passed to the script that
- * matches a request on the request list, and  is 0 or 1
- * indicating whether the device is now enabled or not.
+ * /sys/devices/platform/visorchipset/guest/parahotplug.
+ * Expects input in the form of " " where  is the identifier
+ * passed to the script that matches a request on the request list, and 

+ * is 0 or 1 indicating whether the device is now enabled or not.
  */
-static ssize_t
-parahotplug_proc_write(struct file *file, const char __user *buffer,
-  size_t count, loff_t *ppos)
+ssize_t parahotplug_store(struct device *dev, struct device_attribute *attr,
+   const char *buf, size_t count)
 {
-   char buf[64];
uint id;
ushort active;
 
-   if (count > sizeof(buf) - 1) {
-   LOGERR("parahotplug_proc_write: count (%d) exceeds size of 
buffer (%d)",
-(int) count, (int) sizeof(buf));
-   return -EINVAL;
-   }
-   if (copy_from_user(buf, buffer, count)) {
-   LOGERR("parahotplug_proc_write: copy_from_user failed");
-   return -EFAULT;
-   }
-   buf[count] = '\0';
-
if (sscanf(buf, "%u %hu", &id, &active) != 2) {
id = 0;
active = 0;
@@ -1851,12 +1836,6 @@ parahotplug_proc_write(struct file *file, const char 
__user *buffer,
return count;
 }
 
-static const struct file_operations parahotplug_proc_fops = {
-   .owner = THIS_MODULE,
-   .read = visorchipset_proc_read_writeonly,
-   .write = parahotplug_proc_write,
-};
-
 /* Process a controlvm message.
  * Return result:
  *FALSE - this function will return FALSE only in the case where the
@@ -2405,13 +2384,6 @@ ssize_t chipsetready_store(struct device *dev, struct 
device_attribute *attr,
return count;
 }
 
-static ssize_t
-visorchipset_proc_read_writeonly(struct file *file, char __user *buf,
-size_t len, loff_t *offset)
-{
-   return 0;
-}
-
 s

[PATCH 4/8 v2] staging: unisys: move chipsetready to sysfs

2014-07-22 Thread Benjamin Romer
Move the chipsetready proc entry to sysfs under a new directory guest. This
entry is used by Unisys application software on the guest to acknowledge
completion of specific events for integration purposes, but these
acknowledgements are not required for the guest to operate correctly.

The store function is simplified as well, to use scanf() instead of copying
the buffer and using strsep().

Signed-off-by: Benjamin Romer 
---
v2: attribute creation was fixed and checks for controlvm_channel pointer were
removed. The off-by-one error in the sscanf() was fixed. Error -1 that was 
being returned was changed to -EINVAL.

 .../unisys/visorchipset/visorchipset_main.c| 88 --
 1 file changed, 33 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index a20e21b..74ab15b 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -129,9 +129,6 @@ static MYPROCTYPE *PartitionType;
 #define VISORCHIPSET_DIAG_PROC_ENTRY_FN "diagdump"
 static struct proc_dir_entry *diag_proc_dir;
 
-#define VISORCHIPSET_CHIPSET_PROC_ENTRY_FN "chipsetready"
-static struct proc_dir_entry *chipset_proc_dir;
-
 #define VISORCHIPSET_PARAHOTPLUG_PROC_ENTRY_FN "parahotplug"
 static struct proc_dir_entry *parahotplug_proc_dir;
 
@@ -323,6 +320,10 @@ static ssize_t remaining_steps_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count);
 static DEVICE_ATTR_RW(remaining_steps);
 
+static ssize_t chipsetready_store(struct device *dev,
+   struct device_attribute *attr, const char *buf, size_t count);
+static DEVICE_ATTR_WO(chipsetready);
+
 static struct attribute *visorchipset_install_attrs[] = {
&dev_attr_toolaction.attr,
&dev_attr_boottotool.attr,
@@ -337,8 +338,19 @@ static struct attribute_group visorchipset_install_group = 
{
.attrs = visorchipset_install_attrs
 };
 
+static struct attribute *visorchipset_guest_attrs[] = {
+   &dev_attr_chipsetready.attr,
+   NULL
+};
+
+static struct attribute_group visorchipset_guest_group = {
+   .name = "guest",
+   .attrs = visorchipset_guest_attrs
+};
+
 static const struct attribute_group *visorchipset_dev_groups[] = {
&visorchipset_install_group,
+   &visorchipset_guest_group,
NULL
 };
 
@@ -2369,49 +2381,27 @@ visorchipset_cache_free(struct kmem_cache *pool, void 
*p, char *fn, int ln)
kmem_cache_free(pool, p);
 }
 
-#define gettoken(bufp) strsep(bufp, " -\t\n")
-
-static ssize_t
-chipset_proc_write(struct file *file, const char __user *buffer,
-  size_t count, loff_t *ppos)
+ssize_t chipsetready_store(struct device *dev, struct device_attribute *attr,
+   const char *buf, size_t count)
 {
-   char buf[512];
-   char *token, *p;
-
-   if (count > sizeof(buf) - 1) {
-   LOGERR("chipset_proc_write: count (%d) exceeds size of buffer 
(%d)",
-(int) count, (int) sizeof(buffer));
-   return -EINVAL;
-   }
-   if (copy_from_user(buf, buffer, count)) {
-   LOGERR("chipset_proc_write: copy_from_user failed");
-   return -EFAULT;
-   }
-   buf[count] = '\0';
-
-   p = buf;
-   token = gettoken(&p);
-
-   if (strcmp(token, "CALLHOMEDISK_MOUNTED") == 0) {
-   token = gettoken(&p);
-   /* The Call Home Disk has been mounted */
-   if (strcmp(token, "0") == 0)
-   chipset_events[0] = 1;
-   } else if (strcmp(token, "MODULES_LOADED") == 0) {
-   token = gettoken(&p);
-   /* All modules for the partition have been loaded */
-   if (strcmp(token, "0") == 0)
-   chipset_events[1] = 1;
-   } else if (token == NULL) {
-   /* No event specified */
-   LOGERR("No event was specified to send CHIPSET_READY response");
-   return -1;
+   char msgtype[64];
+   int msgparam;
+
+   if (sscanf(buf, "%63s %d", msgtype, &msgparam) == 2) {
+   if (strcmp(msgtype, "CALLHOMEDISK_MOUNTED") == 0) {
+   /* The Call Home Disk has been mounted */
+   if (msgparam == 0)
+   chipset_events[0] = 1;
+   } else if (strcmp(msgtype, "MODULES_LOADED") == 0) {
+   /* All modules for the partition have been loaded */
+   if (msgparam == 0)
+   chipset_events[1] = 1;
+   } else {
+   return -EINVAL;
+   }
} else {
-   /* Unsupported event specified */
-   LOGERR("%s is an invalid event for sending CHIPSET_READY 
response",  token);
-   return -1;
+   return

[PATCH 1/8 v2] staging: unisys: add toolaction to sysfs

2014-07-22 Thread Benjamin Romer
Move the proc entry for controlling the toolaction field to sysfs. The field
appears in /sys/devices/platform/visorchipset/install/toolaction.

This field is used to tell s-Par which type of recovery tool action to perform
on the next guest boot-up. The meaning of the value is dependent on the type
of installation software used to commission the guest.

Signed-off-by: Benjamin Romer 
---
v2: attribute creation was fixed and checks for controlvm_channel pointer were
removed.

 .../unisys/visorchipset/visorchipset_main.c| 142 -
 1 file changed, 51 insertions(+), 91 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index a16d67e..a0d34eb 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -149,11 +149,6 @@ static ssize_t proc_read_installer(struct file *file, char 
__user *buf,
 static ssize_t proc_write_installer(struct file *file,
const char __user *buffer,
size_t count, loff_t *ppos);
-static ssize_t proc_read_toolaction(struct file *file, char __user *buf,
-   size_t len, loff_t *offset);
-static ssize_t proc_write_toolaction(struct file *file,
-const char __user *buffer,
-size_t count, loff_t *ppos);
 static ssize_t proc_read_bootToTool(struct file *file, char __user *buf,
size_t len, loff_t *offset);
 static ssize_t proc_write_bootToTool(struct file *file,
@@ -164,11 +159,6 @@ static const struct file_operations proc_installer_fops = {
.write = proc_write_installer,
 };
 
-static const struct file_operations proc_toolaction_fops = {
-   .read = proc_read_toolaction,
-   .write = proc_write_toolaction,
-};
-
 static const struct file_operations proc_bootToTool_fops = {
.read = proc_read_bootToTool,
.write = proc_write_bootToTool,
@@ -321,10 +311,33 @@ static VISORCHIPSET_BUSDEV_RESPONDERS BusDev_Responders = 
{
 /* info for /dev/visorchipset */
 static dev_t MajorDev = -1; /**< indicates major num for device */
 
+/* prototypes for attributes */
+static ssize_t toolaction_show(struct device *dev,
+   struct device_attribute *attr, char *buf);
+static ssize_t toolaction_store(struct device *dev,
+   struct device_attribute *attr, const char *buf, size_t count);
+static DEVICE_ATTR_RW(toolaction);
+
+static struct attribute *visorchipset_install_attrs[] = {
+   &dev_attr_toolaction.attr,
+   NULL
+};
+
+static struct attribute_group visorchipset_install_group = {
+   .name = "install",
+   .attrs = visorchipset_install_attrs
+};
+
+static const struct attribute_group *visorchipset_dev_groups[] = {
+   &visorchipset_install_group,
+   NULL
+};
+
 /* /sys/devices/platform/visorchipset */
 static struct platform_device Visorchipset_platform_device = {
.name = "visorchipset",
.id = -1,
+   .dev.groups = visorchipset_dev_groups,
 };
 
 /* Function prototypes */
@@ -336,6 +349,34 @@ static void 
controlvm_respond_physdev_changestate(CONTROLVM_MESSAGE_HEADER *
  msgHdr, int response,
  ULTRA_SEGMENT_STATE state);
 
+ssize_t toolaction_show(struct device *dev, struct device_attribute *attr,
+   char *buf)
+{
+   U8 toolAction;
+
+   visorchannel_read(ControlVm_channel,
+   offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
+  ToolAction), &toolAction, sizeof(U8));
+   return scnprintf(buf, PAGE_SIZE, "%u\n", toolAction);
+}
+
+ssize_t toolaction_store(struct device *dev, struct device_attribute *attr,
+   const char *buf, size_t count)
+{
+   U8 toolAction;
+
+   if (sscanf(buf, "%hhu\n", &toolAction) == 1) {
+   if (visorchannel_write(ControlVm_channel,
+   offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
+   ToolAction),
+   &toolAction, sizeof(U8)) < 0)
+   return -EFAULT;
+   else
+   return count;
+   } else
+   return -EIO;
+}
+
 static void
 show_partition_property(struct seq_file *f, void *ctx, int property)
 {
@@ -2368,83 +2409,6 @@ proc_write_installer(struct file *file,
 }
 
 /**
- * Reads the ToolAction field of ControlVMChannel.
- */
-static ssize_t
-proc_read_toolaction(struct file *file, char __user *buf,
-size_t len, loff_t *offset)
-{
-   int length = 0;
-   U8 toolAction;
-   char *vbuf;
-   loff_t pos = *offset;
-
-   if (pos < 0)
-   return -EINVAL;
-
-   if (pos > 0 || !len)
-   return 0;
-
-   vbuf = kzall

[PATCH 0/8 v2] staging: unisys: visorchipset proc fixes

2014-07-22 Thread Benjamin Romer
This patch set moves several interfaces in the visorchipset module from procfs
to sysfs, and removes the remaining proc interfaces from the module. It includes
documentation for the new interfaces in Documentation/ABI, and some code cleanup
in the new sysfs handler functions.

In version 2 of the set, extraneous checks for controlvm_channel pointer 
validity were removed, all newly created attributes use DEVICE_ATTR_RW or 
DEVICE_ATTR_WO, and logging was removed from the show and store functions to 
prevent creating a DOS attack possibility. 

Benjamin Romer (8):
  staging: unisys: add toolaction to sysfs
  staging: unisys: move boottotool out of proc to sysfs
  staging: unisys: move installer to sysfs and split fields
  staging: unisys: move chipsetready to sysfs
  staging: unisys: move parahotplug to sysfs
  staging: unisys: clean up diagdump proc entry code
  staging: unisys: remove partition information from proc
  staging: unisys: ABI documentation for new sysfs entries

 .../Documentation/ABI/sysfs-platform-visorchipset  |  74 +++
 .../unisys/visorchipset/visorchipset_main.c| 730 +++--
 2 files changed, 300 insertions(+), 504 deletions(-)
 create mode 100644 
drivers/staging/unisys/Documentation/ABI/sysfs-platform-visorchipset

-- 
1.9.1

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


[PATCH 2/8 v2] staging: unisys: move boottotool out of proc to sysfs

2014-07-22 Thread Benjamin Romer
Move the proc entry controlling the boottotool flag to procfs. The field
appears in /sys/devices/platform/visorchipset/install/boottotool.

The boottotool flag controls s-Par behavior on the next boot of this guest.
Setting the flag will cause the guest to boot from the utility and installation
image, which will use the value in the toolaction field to determine what
operation is being requested.

Signed-off-by: Benjamin Romer 
---
v2: attribute creation was fixed and checks for controlvm_channel pointer were
removed.

 .../unisys/visorchipset/visorchipset_main.c| 132 +++--
 1 file changed, 40 insertions(+), 92 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index a0d34eb..48db6ee 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -149,21 +149,12 @@ static ssize_t proc_read_installer(struct file *file, 
char __user *buf,
 static ssize_t proc_write_installer(struct file *file,
const char __user *buffer,
size_t count, loff_t *ppos);
-static ssize_t proc_read_bootToTool(struct file *file, char __user *buf,
-   size_t len, loff_t *offset);
-static ssize_t proc_write_bootToTool(struct file *file,
-const char __user *buffer,
-size_t count, loff_t *ppos);
+
 static const struct file_operations proc_installer_fops = {
.read = proc_read_installer,
.write = proc_write_installer,
 };
 
-static const struct file_operations proc_bootToTool_fops = {
-   .read = proc_read_bootToTool,
-   .write = proc_write_bootToTool,
-};
-
 typedef struct {
U8 __iomem *ptr;/* pointer to base address of payload pool */
U64 offset; /* offset from beginning of controlvm
@@ -318,8 +309,15 @@ static ssize_t toolaction_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count);
 static DEVICE_ATTR_RW(toolaction);
 
+static ssize_t boottotool_show(struct device *dev,
+   struct device_attribute *attr, char *buf);
+static ssize_t boottotool_store(struct device *dev,
+   struct device_attribute *attr, const char *buf, size_t count);
+static DEVICE_ATTR_RW(boottotool);
+
 static struct attribute *visorchipset_install_attrs[] = {
&dev_attr_toolaction.attr,
+   &dev_attr_boottotool.attr,
NULL
 };
 
@@ -377,6 +375,38 @@ ssize_t toolaction_store(struct device *dev, struct 
device_attribute *attr,
return -EIO;
 }
 
+ssize_t boottotool_show(struct device *dev, struct device_attribute *attr,
+   char *buf)
+{
+   ULTRA_EFI_SPAR_INDICATION efiSparIndication;
+
+   visorchannel_read(ControlVm_channel,
+   offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
+   EfiSparIndication), &efiSparIndication,
+   sizeof(ULTRA_EFI_SPAR_INDICATION));
+   return scnprintf(buf, PAGE_SIZE, "%u\n",
+   efiSparIndication.BootToTool);
+}
+
+ssize_t boottotool_store(struct device *dev, struct device_attribute *attr,
+   const char *buf, size_t count)
+{
+   int val;
+   ULTRA_EFI_SPAR_INDICATION efiSparIndication;
+
+   if (sscanf(buf, "%u\n", &val) == 1) {
+   efiSparIndication.BootToTool = val;
+   if (visorchannel_write(ControlVm_channel,
+   offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
+EfiSparIndication),
+   &(efiSparIndication),
+   sizeof(ULTRA_EFI_SPAR_INDICATION)) < 0)
+   return -EFAULT;
+   else
+   return count;
+   } else
+   return -EIO;
+}
 static void
 show_partition_property(struct seq_file *f, void *ctx, int property)
 {
@@ -2408,84 +2438,6 @@ proc_write_installer(struct file *file,
return count;
 }
 
-/**
- * Reads the EfiSparIndication.BootToTool field of ControlVMChannel.
- */
-static ssize_t
-proc_read_bootToTool(struct file *file, char __user *buf,
-size_t len, loff_t *offset)
-{
-   int length = 0;
-   ULTRA_EFI_SPAR_INDICATION efiSparIndication;
-   char *vbuf;
-   loff_t pos = *offset;
-
-   if (pos < 0)
-   return -EINVAL;
-
-   if (pos > 0 || !len)
-   return 0;
-
-   vbuf = kzalloc(len, GFP_KERNEL);
-   if (!vbuf)
-   return -ENOMEM;
-
-   visorchannel_read(ControlVm_channel,
- offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
-  EfiSparIndication), &efiSparIndication,
- sizeof(ULTRA_EFI_SPAR_INDICATION));
-
-   length = sprintf(vbuf, "%d\n", (int) efiSparIndication.

[PATCH 6/8 v2] staging: unisys: clean up diagdump proc entry code

2014-07-22 Thread Benjamin Romer
Remove remnant code left over from the diagdump proc entry.

Signed-off-by: Benjamin Romer 
---
v2: patch locations changed due to prior patches being revised.

 drivers/staging/unisys/visorchipset/visorchipset_main.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index c88f95f..134f028 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -126,9 +126,6 @@ InitPartitionProperties(void)
 
 static MYPROCTYPE *PartitionType;
 
-#define VISORCHIPSET_DIAG_PROC_ENTRY_FN "diagdump"
-static struct proc_dir_entry *diag_proc_dir;
-
 static LIST_HEAD(BusInfoList);
 static LIST_HEAD(DevInfoList);
 
@@ -2558,10 +2555,7 @@ visorchipset_exit(void)
visor_proc_DestroyType(PartitionType);
PartitionType = NULL;
}
-   if (diag_proc_dir) {
-   remove_proc_entry(VISORCHIPSET_DIAG_PROC_ENTRY_FN, ProcDir);
-   diag_proc_dir = NULL;
-   }
+
memset(&g_DiagMsgHdr, 0, sizeof(CONTROLVM_MESSAGE_HEADER));
 
memset(&g_ChipSetMsgHdr, 0, sizeof(CONTROLVM_MESSAGE_HEADER));
-- 
1.9.1

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


Re: [PATCH] Fix issues reported by checkpatch

2014-07-22 Thread Dan Carpenter
On Sat, Jul 19, 2014 at 11:55:39AM +0200, LABBE Corentin wrote:
> Hello
> 
> The drivers/staging/sep/sep_main.c have lots of checkpatch issue.
> This patch series solves them and since there are many, I have splitted 
> corrections in 4 patch.
> 
> Note that this work is done for the Eudyptulla Challenge.
>

Could you resend this with a subject prefix to say which driver you are
modifying?

[PATCH 1/4] Staging: sep:

Also split it apart into patches which do one kind of thing and not just
misc fixes all together.

regards,
dan carpenter

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


Re: [PATCH v4 1/3] Staging: rts5208: Replace custom macro with dev_dbg

2014-07-22 Thread Dan Carpenter
On Mon, Jul 21, 2014 at 11:36:02PM +0200, Fabio Falzoi wrote:
> @@ -3664,7 +3672,7 @@ static int mg_set_tpc_para_sub(struct rtsx_chip *chip, 
> int type,
>   int retval;
>   u8 buf[6];
>  
> - RTSX_DEBUGP("--%s--\n", __func__);
> + dev_dbg(rtsx_dev(chip), "--%s--\n", __func__);

All of these debug printks to mark when we have called a function should
be deleted.  We have ftrace for that.

> -static inline void free_zone(struct zone_entry *zone)
> +static inline void free_zone(const struct rtsx_chip *chip,
> +  struct zone_entry *zone)
>  {
> - RTSX_DEBUGP("free_zone\n");
> + dev_dbg(rtsx_dev(chip), "free_zone\n");
>  
>   if (!zone)
>   return;

Don't add a parameter to free_zone() just for this debug printk which
should be deleted.

regards,
dan carpenter

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


[PATCH] Staging: vt6655: removed redundant comments from aes_ccmp.h

2014-07-22 Thread Igor Bezukh
Removed redundant comments from aes_ccmp.h header file

Signed-off-by: Igor Bezukh 
---
 drivers/staging/vt6655/aes_ccmp.h |9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/vt6655/aes_ccmp.h 
b/drivers/staging/vt6655/aes_ccmp.h
index cc02e64..fe0c506 100644
--- a/drivers/staging/vt6655/aes_ccmp.h
+++ b/drivers/staging/vt6655/aes_ccmp.h
@@ -32,15 +32,6 @@
 
 #include "ttype.h"
 
-/*-  Export Definitions -*/
-
-/*-  Export Types  --*/
-
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
 bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned 
short wFrameSize);
 
 #endif /* __AES_H__ */
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: Removed redundant comments and newlines

2014-07-22 Thread Igor Bezukh
Removed redundant comments and newlines from 80211mgr.h header file.

Signed-off-by: Igor Bezukh 
---
 drivers/staging/vt6655/80211mgr.h |   38 -
 1 file changed, 38 deletions(-)

diff --git a/drivers/staging/vt6655/80211mgr.h 
b/drivers/staging/vt6655/80211mgr.h
index 065238b..8b126bb 100644
--- a/drivers/staging/vt6655/80211mgr.h
+++ b/drivers/staging/vt6655/80211mgr.h
@@ -34,8 +34,6 @@
 #include "ttype.h"
 #include "80211hdr.h"
 
-/*-  Export Definitions -*/
-
 #define WLAN_MIN_ARRAY  1
 
 /* Information Element ID value */
@@ -202,12 +200,6 @@
 #define MEASURE_MODE_INCAPABLE  0x02
 #define MEASURE_MODE_REFUSED0x04
 
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Types  --*/
-
 /* Information Element Types */
 
 #pragma pack(1)
@@ -472,14 +464,11 @@ typedef struct tagWLAN_FR_BEACON {
unsigned intlen;
unsigned char *pBuf;
PUWLAN_80211HDR pHdr;
-   /* fixed fields */
PQWORD  pqwTimestamp;
unsigned short *pwBeaconInterval;
unsigned short *pwCapInfo;
-   /*-- info elements --*/
PWLAN_IE_SSID   pSSID;
PWLAN_IE_SUPP_RATES pSuppRates;
-/*  PWLAN_IE_FH_PARMS   pFHParms; */
PWLAN_IE_DS_PARMS   pDSParms;
PWLAN_IE_CF_PARMS   pCFParms;
PWLAN_IE_TIMpTIM;
@@ -501,10 +490,6 @@ typedef struct tagWLAN_FR_IBSSATIM {
unsigned intlen;
unsigned char *pBuf;
PUWLAN_80211HDR pHdr;
-
-   /* fixed fields */
-   /* info elements */
-   /* this frame type has a null body */
 } WLAN_FR_IBSSATIM, *PWLAN_FR_IBSSATIM;
 
 /* Disassociation */
@@ -513,9 +498,7 @@ typedef struct tagWLAN_FR_DISASSOC {
unsigned intlen;
unsigned char *pBuf;
PUWLAN_80211HDR pHdr;
-   /*-- fixed fields ---*/
unsigned short *pwReason;
-   /*-- info elements --*/
 } WLAN_FR_DISASSOC, *PWLAN_FR_DISASSOC;
 
 /* Association Request */
@@ -524,10 +507,8 @@ typedef struct tagWLAN_FR_ASSOCREQ {
unsigned intlen;
unsigned char *pBuf;
PUWLAN_80211HDR pHdr;
-   /*-- fixed fields ---*/
unsigned short *pwCapInfo;
unsigned short *pwListenInterval;
-   /*-- info elements --*/
PWLAN_IE_SSID   pSSID;
PWLAN_IE_SUPP_RATES pSuppRates;
PWLAN_IE_RSNpRSN;
@@ -543,11 +524,9 @@ typedef struct tagWLAN_FR_ASSOCRESP {
unsigned intlen;
unsigned char *pBuf;
PUWLAN_80211HDR pHdr;
-   /*-- fixed fields ---*/
unsigned short *pwCapInfo;
unsigned short *pwStatus;
unsigned short *pwAid;
-   /*-- info elements --*/
PWLAN_IE_SUPP_RATES pSuppRates;
PWLAN_IE_SUPP_RATES pExtSuppRates;
 } WLAN_FR_ASSOCRESP, *PWLAN_FR_ASSOCRESP;
@@ -558,13 +537,9 @@ typedef struct tagWLAN_FR_REASSOCREQ {
unsigned intlen;
unsigned char *pBuf;
PUWLAN_80211HDR pHdr;
-
-   /*-- fixed fields ---*/
unsigned short *pwCapInfo;
unsigned short *pwListenInterval;
PIEEE_ADDR  pAddrCurrAP;
-
-   /*-- info elements --*/
PWLAN_IE_SSID   pSSID;
PWLAN_IE_SUPP_RATES pSuppRates;
PWLAN_IE_RSNpRSN;
@@ -578,11 +553,9 @@ typedef struct tagWLAN_FR_REASSOCRESP {
unsigned intlen;
unsigned char *pBuf;
PUWLAN_80211HDR pHdr;
-   /*-- fixed fields ---*/
unsigned short *pwCapInfo;
unsigned short *pwStatus;
unsigned short *pwAid;
-   /*-- info elements --*/
PWLAN_IE_SUPP_RATES pSuppRates;
PWLAN_IE_SUPP_RATES pExtSuppRates;
 } WLAN_FR_REASSOCRESP, *PWLAN_FR_REASSOCRESP;
@@ -593,8 +566,6 @@ typedef struct tagWLAN_FR_PROBEREQ {
unsigned intlen;
unsigned char *pBuf;
PUWLAN_80211HDR pHdr;
-   /*-- fixed fields ---*/
-   /*-- info elements --*/
PWLAN_IE_SSID   pSSID;
PWLAN_IE_SUPP_RATES pSuppRates;
PWLAN_IE_SUPP_RATES pExtSuppRates;
@@ -606,11 +577,9 @@ typedef struct tagWLAN_FR_PROBERESP {
unsigned intlen;
unsigned char *pBuf;
PUWLAN_80211HDR pHdr;
-   /*-- fixed fields ---*/
PQWORD  pqwTimestamp;
unsigned short *pwBeaconInterval;
unsigned short *pwCapInfo;
-   /*-- info elements --*/
PWLAN_IE_SSID   pSSID;
PWLAN_IE_SUPP_RATES pSuppRates;
PWLAN_IE_DS_PARMS   pDSParms;
@@ -633,11 +602,9 @@ typedef struct tagWLAN_FR_A

[PATCH] Staging: vt6655: remove redundant comments from 80211hdr.h

2014-07-22 Thread Igor Bezukh
Removed redundant comments from 80211hdr.h header file

Signed-off-by: Igor Bezukh 
---
 drivers/staging/vt6655/80211hdr.h |7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/vt6655/80211hdr.h 
b/drivers/staging/vt6655/80211hdr.h
index ba155cd..e05d135 100644
--- a/drivers/staging/vt6655/80211hdr.h
+++ b/drivers/staging/vt6655/80211hdr.h
@@ -33,7 +33,6 @@
 
 #include "ttype.h"
 
-/*-  Export Definitions -*/
 /* bit type */
 #define BIT0   0x0001
 #define BIT1   0x0002
@@ -315,10 +314,4 @@ typedef union tagUWLAN_80211HDR {
WLAN_80211HDR_A4sA4;
 } UWLAN_80211HDR, *PUWLAN_80211HDR;
 
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
 #endif /* __80211HDR_H__ */
-- 
1.7.9.5

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


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-22 Thread Chen Gang


On 07/22/2014 06:32 PM, Arnd Bergmann wrote:
> On Sunday 20 July 2014 17:45:40 Chen Gang wrote:
>>>
>>> Next, I shall:
>>>
>>>  - Remove HAS_IOMEM and NO_IOMEM from kernel, firstly.
>>>
>>>  - Try to make dummy IOMEM functions for score architecture.
>>>
>>>  - Continue discussing with UML for it.
>>>
>>  
>> Oh, sorry, I forgot, after remove IOMEM from kernel, also s390 and tile
>> need implement dummy IOMEM if !PCI.
>>
>> If possible, I shall try to implement the dummy IOMEM in 'asm-generic',
>> and let uml, score, s390 and tile use them when they need.
> 
> Sorry for going round in circles, but looking back at the original patches,
> adding the extra 'depends on HAS_IOMEM' does seem much better than the
> other suggestions that came afterwards.
> 
> In particular, removing HAS_IOMEM and NO_IOMEM sounds like an awful idea
> to me. I'd rather add a HAS_IOPORT in addition to also catch architectures
> that have no support for PC-style PIO.
> 

Welcome any other members (especially driver members) ideas and
suggestions -- driver members and architecture members have different
tastes and different roles.

For me, if no additional reply, I prefer to keep current status, and
still add 'depends on HAS_IOMEM' for each driver which need it, but I am
not sure whether driver members can bear it.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-22 Thread Arnd Bergmann
On Sunday 20 July 2014 17:45:40 Chen Gang wrote:
> > 
> > Next, I shall:
> > 
> >  - Remove HAS_IOMEM and NO_IOMEM from kernel, firstly.
> > 
> >  - Try to make dummy IOMEM functions for score architecture.
> > 
> >  - Continue discussing with UML for it.
> >
>  
> Oh, sorry, I forgot, after remove IOMEM from kernel, also s390 and tile
> need implement dummy IOMEM if !PCI.
> 
> If possible, I shall try to implement the dummy IOMEM in 'asm-generic',
> and let uml, score, s390 and tile use them when they need.

Sorry for going round in circles, but looking back at the original patches,
adding the extra 'depends on HAS_IOMEM' does seem much better than the
other suggestions that came afterwards.

In particular, removing HAS_IOMEM and NO_IOMEM sounds like an awful idea
to me. I'd rather add a HAS_IOPORT in addition to also catch architectures
that have no support for PC-style PIO.

Arnd

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


Re: [PATCH 3/3] staging: vme: Add missing CR in printk messages in vme_pio2_core.c

2014-07-22 Thread Martyn Welch



On 18/07/14 16:33, Masanari Iida wrote:

This patch add missing CR in messages within vme_pio2_core.c

Signed-off-by: Masanari Iida 


Acked-by: Martyn Welch 



---
  drivers/staging/vme/devices/vme_pio2_core.c | 12 ++--
  1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c 
b/drivers/staging/vme/devices/vme_pio2_core.c
index fd19c25..84c5a07 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -182,30 +182,30 @@ static int pio2_match(struct vme_dev *vdev)

if (vdev->num >= bus_num) {
dev_err(&vdev->dev,
-   "The enumeration of the VMEbus to which the board is 
connected must be specified");
+   "The enumeration of the VMEbus to which the board is 
connected must be specified\n");
return 0;
}

if (vdev->num >= base_num) {
dev_err(&vdev->dev,
-   "The VME address for the cards registers must be 
specified");
+   "The VME address for the cards registers must be 
specified\n");
return 0;
}

if (vdev->num >= vector_num) {
dev_err(&vdev->dev,
-   "The IRQ vector used by the card must be specified");
+   "The IRQ vector used by the card must be specified\n");
return 0;
}

if (vdev->num >= level_num) {
dev_err(&vdev->dev,
-   "The IRQ level used by the card must be specified");
+   "The IRQ level used by the card must be specified\n");
return 0;
}

if (vdev->num >= variant_num) {
-   dev_err(&vdev->dev, "The variant of the card must be 
specified");
+   dev_err(&vdev->dev, "The variant of the card must be 
specified\n");
return 0;
}

@@ -324,7 +324,7 @@ static int pio2_probe(struct vme_dev *vdev)
retval = pio2_reset_card(card);
if (retval) {
dev_err(&card->vdev->dev,
-   "Failed to reset card, is location valid?");
+   "Failed to reset card, is location valid?\n");
retval = -ENODEV;
goto err_reset;
}



--
Martyn Welch (Lead Software Engineer)  | Registered in England and Wales
GE Intelligent Platforms   | (3828642) at 100 Barbirolli Square
T +44(0)1327322748 | Manchester, M2 3AB
E martyn.we...@ge.com  | VAT:GB 927559189
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/3] staging: vme: Fix typo in vme_pio2_gpio.c

2014-07-22 Thread Martyn Welch


On 18/07/14 16:33, Masanari Iida wrote:

This patch fix spelling typo in printk message.

Signed-off-by: Masanari Iida 


Acked-by: Martyn Welch 


---
  drivers/staging/vme/devices/vme_pio2_gpio.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_gpio.c 
b/drivers/staging/vme/devices/vme_pio2_gpio.c
index 2a2d920..55c009c 100644
--- a/drivers/staging/vme/devices/vme_pio2_gpio.c
+++ b/drivers/staging/vme/devices/vme_pio2_gpio.c
@@ -108,7 +108,7 @@ static int pio2_gpio_dir_in(struct gpio_chip *chip, 
unsigned offset)
if ((card->bank[PIO2_CHANNEL_BANK[offset]].config == OUTPUT) |
(card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
dev_err(&card->vdev->dev,
-   "Channel directionality not configurable at runtine\n");
+   "Channel directionality not configurable at runtime\n");

data = -EINVAL;
} else {
@@ -127,7 +127,7 @@ static int pio2_gpio_dir_out(struct gpio_chip *chip, 
unsigned offset, int value)
if ((card->bank[PIO2_CHANNEL_BANK[offset]].config == INPUT) |
(card->bank[PIO2_CHANNEL_BANK[offset]].config == NOFIT)) {
dev_err(&card->vdev->dev,
-   "Channel directionality not configurable at runtine\n");
+   "Channel directionality not configurable at runtime\n");

data = -EINVAL;
} else {



--
Martyn Welch (Lead Software Engineer)  | Registered in England and Wales
GE Intelligent Platforms   | (3828642) at 100 Barbirolli Square
T +44(0)1327322748 | Manchester, M2 3AB
E martyn.we...@ge.com  | VAT:GB 927559189
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/3] staging: vme: Add missing CR in error message

2014-07-22 Thread Martyn Welch



On 18/07/14 16:33, Masanari Iida wrote:

This patch adds missing CR in dev_err message.

Signed-off-by: Masanari Iida 


Acked-by: Martyn Welch 


---
  drivers/staging/vme/devices/vme_pio2_gpio.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_gpio.c 
b/drivers/staging/vme/devices/vme_pio2_gpio.c
index 55c009c..f00af07 100644
--- a/drivers/staging/vme/devices/vme_pio2_gpio.c
+++ b/drivers/staging/vme/devices/vme_pio2_gpio.c
@@ -222,7 +222,7 @@ void pio2_gpio_exit(struct pio2_card *card)
const char *label = card->gc.label;

if (gpiochip_remove(&(card->gc)))
-   dev_err(&card->vdev->dev, "Failed to remove GPIO");
+   dev_err(&card->vdev->dev, "Failed to remove GPIO\n");

kfree(label);
  }



--
Martyn Welch (Lead Software Engineer)  | Registered in England and Wales
GE Intelligent Platforms   | (3828642) at 100 Barbirolli Square
T +44(0)1327322748 | Manchester, M2 3AB
E martyn.we...@ge.com  | VAT:GB 927559189
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: comedi: comedidev.h: remove 'new_size' param from subdevice (*buf_change)

2014-07-22 Thread Ian Abbott

On 2014-07-21 19:48, H Hartley Sweeten wrote:

This parameter is never used by any of the comedi drivers that provide a
(*buf_change) callback. If the 'new_size' is needed in the callback it can
be found from the 's->async->prealloc_bufsz' as done in the ni_pcidio driver.

Remove the unused parameter.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 


Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail: )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/2] staging: comedi: remove unused subdevice lock/unlock

2014-07-22 Thread Ian Abbott

On 2014-07-21 19:01, H Hartley Sweeten wrote:

The subdevice lock/unlock callbacks have been disbled ever since the code
was merged. It's also broken due to the core member names in the struct
not matching the calls in the core. Just remove it.

H Hartley Sweeten (2):
   staging: comedi: comedi_fops: remove disabled subdevice lock/unlock callback
   staging: comedi: comedidev.h: remove unused callbacks from comedi_subdevice

  drivers/staging/comedi/comedi_fops.c | 16 +---
  drivers/staging/comedi/comedidev.h   |  3 ---
  2 files changed, 1 insertion(+), 18 deletions(-)



Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail: )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: gdm724x: gdm_lte.c: Fix warning of prefer ether_addr_copy()

2014-07-22 Thread Greg KH
On Tue, Jul 22, 2014 at 12:26:42PM +0530, Kiran Padwal wrote:
> This patch fixes the following checkpatch.pl warnings:
> WARNING: "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses 
> are __aligned(2)".

Is that true here?

Have you tested this on the hardware to ensure it works properly?

I hate that checkpatch message...

thanks,

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


[PATCH] Staging: gdm724x: gdm_usb.c: fix missing blank line after variable declaration

2014-07-22 Thread Kiran Padwal
Checkpatch fix - Add missing blank line after variable declaration

Signed-off-by: Kiran Padwal 
---
 drivers/staging/gdm724x/gdm_usb.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/gdm724x/gdm_usb.c 
b/drivers/staging/gdm724x/gdm_usb.c
index ea89d53..0c1b2de 100644
--- a/drivers/staging/gdm724x/gdm_usb.c
+++ b/drivers/staging/gdm724x/gdm_usb.c
@@ -896,6 +896,7 @@ static void gdm_usb_disconnect(struct usb_interface *intf)
struct lte_udev *udev;
u16 idVendor, idProduct;
struct usb_device *usbdev;
+
usbdev = interface_to_usbdev(intf);
 
idVendor = __le16_to_cpu(usbdev->descriptor.idVendor);
-- 
1.7.9.5

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


[PATCH] Staging: gdm724x: gdm_lte.c: Fix warning of prefer ether_addr_copy()

2014-07-22 Thread Kiran Padwal
This patch fixes the following checkpatch.pl warnings:
WARNING: "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are 
__aligned(2)".

Signed-off-by: Kiran Padwal 
---
 drivers/staging/gdm724x/gdm_lte.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_lte.c 
b/drivers/staging/gdm724x/gdm_lte.c
index bc6d574..6df6c70 100644
--- a/drivers/staging/gdm724x/gdm_lte.c
+++ b/drivers/staging/gdm724x/gdm_lte.c
@@ -626,7 +626,7 @@ static void gdm_lte_netif_rx(struct net_device *dev, char 
*buf,
void *addr = buf + sizeof(struct iphdr) +
sizeof(struct udphdr) +
offsetof(struct dhcp_packet, chaddr);
-   memcpy(nic->dest_mac_addr, addr, ETH_ALEN);
+   ether_addr_copy(nic->dest_mac_addr, addr);
}
}
 
@@ -639,7 +639,7 @@ static void gdm_lte_netif_rx(struct net_device *dev, char 
*buf,
}
 
/* Format the data so that it can be put to skb */
-   memcpy(mac_header_data, nic->dest_mac_addr, ETH_ALEN);
+   ether_addr_copy(mac_header_data, nic->dest_mac_addr);
memcpy(mac_header_data + ETH_ALEN, nic->src_mac_addr, ETH_ALEN);
 
vlan_eth.h_vlan_TCI = htons(nic->vlan_id);
@@ -842,9 +842,9 @@ static void form_mac_address(u8 *dev_addr, u8 *nic_src, u8 
*nic_dest,
 {
/* Form the dev_addr */
if (!mac_address)
-   memcpy(dev_addr, gdm_lte_macaddr, ETH_ALEN);
+   ether_addr_copy(dev_addr, gdm_lte_macaddr);
else
-   memcpy(dev_addr, mac_address, ETH_ALEN);
+   ether_addr_copy(dev_addr, mac_address);
 
/* The last byte of the mac address
 * should be less than or equal to 0xFC
@@ -858,7 +858,7 @@ static void form_mac_address(u8 *dev_addr, u8 *nic_src, u8 
*nic_dest,
memcpy(nic_src, dev_addr, 3);
 
/* Copy the nic_dest from dev_addr*/
-   memcpy(nic_dest, dev_addr, ETH_ALEN);
+   ether_addr_copy(nic_dest, dev_addr);
 }
 
 static void validate_mac_address(u8 *mac_address)
-- 
1.7.9.5

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