[PATCH] storvsc: do not assume SG list is continuous when doing bounce buffers (for 4.1 stable only)

2017-08-21 Thread Long Li
From: Long Li 

This patch is for linux-stable 4.1 branch only.

storvsc checks the SG list for gaps before passing them to Hyper-v device.
If there are gaps, data is copied to a bounce buffer and a continuous data
buffer is passed to Hyper-V.

The check on gaps assumes SG list is continuous, and not chained. This is
 not always true. Failing the check may result in incorrect I/O data
passed to the Hyper-v device.

This code path is not used post Linux 4.1.

Signed-off-by: Long Li 
---
 drivers/scsi/storvsc_drv.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 6c52d14..14dc5c6 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -584,17 +584,18 @@ static int do_bounce_buffer(struct scatterlist *sgl, 
unsigned int sg_count)
for (i = 0; i < sg_count; i++) {
if (i == 0) {
/* make sure 1st one does not have hole */
-   if (sgl[i].offset + sgl[i].length != PAGE_SIZE)
+   if (sgl->offset + sgl->length != PAGE_SIZE)
return i;
} else if (i == sg_count - 1) {
/* make sure last one does not have hole */
-   if (sgl[i].offset != 0)
+   if (sgl->offset != 0)
return i;
} else {
/* make sure no hole in the middle */
-   if (sgl[i].length != PAGE_SIZE || sgl[i].offset != 0)
+   if (sgl->length != PAGE_SIZE || sgl->offset != 0)
return i;
}
+   sgl = sg_next(sgl);
}
return -1;
 }
-- 
2.7.4

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


Re: [PATCH 4/4] staging: iio: tsl2x7x: constify i2c_device_id

2017-08-21 Thread Arvind Yadav

Hi


On Tuesday 22 August 2017 01:50 AM, Dan Carpenter wrote:

Don't say "[PATCH 4/4]".  It's not a patchset or a part of an email
thread.

Yes, It's part of these patchset.
  [PATCH 1/4] misc: apds9802als: constify i2c_device_id
  [PATCH 2/4] misc: hmc6352: constify i2c_device_id
  [PATCH 3/4] misc: isl29020: constify i2c_device_id
  [PATCH 4/4] staging: iio: tsl2x7x: constify i2c_device_id



regards,
dan carpenter


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


Re: [PATCH] mtd: nand: Rename nand.h into rawnand.h

2017-08-21 Thread Boris Brezillon
Le Fri,  4 Aug 2017 17:29:09 +0200,
Boris Brezillon  a écrit :

> We are planning to share more code between different NAND based
> devices (SPI NAND, OneNAND and raw NANDs), but before doing that
> we need to move the existing include/linux/mtd/nand.h file into
> include/linux/mtd/rawnand.h so we can later create a nand.h header
> containing all common structure and function prototypes.
> 
> Signed-off-by: Boris Brezillon 
> Signed-off-by: Peter Pan 
> Cc: Jonathan Corbet 
> Cc: Sekhar Nori 
> Cc: Kevin Hilman 
> Cc: Jason Cooper 
> Cc: Andrew Lunn 
> Cc: Sebastian Hesselbarth 
> Cc: Gregory Clement 
> Cc: Hartley Sweeten 
> Cc: Alexander Sverdlin 
> Cc: Shawn Guo 
> Cc: Sascha Hauer 
> Cc: Fabio Estevam 
> Cc: Imre Kaloz 
> Cc: Krzysztof Halasa 
> Cc: Eric Miao 
> Cc: Haojian Zhuang 
> Cc: Aaro Koskinen 
> Cc: Tony Lindgren 
> Cc: Alexander Clouter 
> Cc: Daniel Mack 
> Cc: Robert Jarzmik 
> Cc: Marek Vasut 
> Cc: Kukjin Kim 
> Cc: Krzysztof Kozlowski 
> Cc: Simtec Linux Team 
> Cc: Steven Miao 
> Cc: Mikael Starvik 
> Cc: Jesper Nilsson 
> Cc: Ralf Baechle 
> Cc: Yoshinori Sato 
> Cc: Rich Felker 
> Cc: Wenyou Yang 
> Cc: Josh Wu 
> Cc: Kamal Dasu 
> Cc: Masahiro Yamada 
> Cc: Han Xu 
> Cc: Harvey Hunt 
> Cc: Vladimir Zapolskiy 
> Cc: Sylvain Lemieux 
> Cc: Matthias Brugger 
> Cc: Wan ZongShun 
> Cc: Neil Armstrong 
> Cc: Ezequiel Garcia 
> Cc: Maxim Levitsky 
> Cc: Marc Gonzalez 
> Cc: Stefan Agner 
> Cc: Greg Kroah-Hartman 
> Cc: Mauro Carvalho Chehab 
> Cc: linux-...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-o...@vger.kernel.org
> Cc: linux-samsung-...@vger.kernel.org
> Cc: adi-buildroot-de...@lists.sourceforge.net
> Cc: linux-cris-ker...@axis.com
> Cc: linux-m...@linux-mips.org
> Cc: linux...@vger.kernel.org
> Cc: bcm-kernel-feedback-l...@broadcom.com
> Cc: linux-media...@lists.infradead.org
> Cc: linux-ox...@lists.tuxfamily.org
> Cc: linuxppc-...@lists.ozlabs.org
> Cc: de...@driverdev.osuosl.org

Created the nand/rename-header-file immutable branch which I then
merged in nand/next.

This way, anyone can pull the nand/rename-header-file branch in case a
conflict arise on one of the file modified by this patch.

The following changes since commit 5771a8c08880cdca3bfb4a3fc6d309d6bba20877:

  Linux v4.13-rc1 (2017-07-15 15:22:10 -0700)

are available in the git repository at:

  git://git.infradead.org/l2-mtd.git nand/rename-header-file

for you to fetch changes up to d4092d76a4a4e57b65910899948a83cc8646c5a5:

  mtd: nand: Rename nand.h into rawnand.h (2017-08-13 10:11:49 +0200)


Boris Brezillon (1):
  mtd: nand: Rename nand.h into rawnand.h

 Documentation/driver-api/mtdnand.rst| 8 
 MAINTAINERS | 2 +-
 arch/arm/mach-davinci/board-da850-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm355-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm355-leopard.c | 2 +-
 arch/arm/mach-davinci/board-dm365-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm644x-evm.c| 2 +-
 arch/arm/mach-davinci/board-dm646x-evm.c| 2 +-
 arch/arm/mach-davinci/board-sffsdr.c| 2 +-
 arch/arm/mach-dove/dove-db-setup.c  | 2 +-
 arch/arm/mach-ep93xx/snappercl15.c  | 2 +-
 arch/arm/mach-ep93xx/ts72xx.c   | 2 +-
 arch/arm/mach-imx/mach-qong.c   | 2 +-
 arch/arm/mach-ixp4xx/ixdp425-setup.c| 2 +-
 arch/arm/mach-mmp/aspenite.c| 2 +-
 arch/arm/mach-omap1/board-fsample.c | 2 +-
 arch/arm/mach-omap1/board-h2.c  | 2 +-
 arch/arm/mach-omap1/board-h3.c  | 2 +-
 arch/arm/mach-omap1/board-nand.c| 2 +-
 arch/arm/mach-omap1/board-perseus2.c  

Re: [PATCH 4/4] staging: iio: tsl2x7x: constify i2c_device_id

2017-08-21 Thread Dan Carpenter
Don't say "[PATCH 4/4]".  It's not a patchset or a part of an email
thread.

regards,
dan carpenter

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


Re: [PATCH 06/15] mtd: make device_type const

2017-08-21 Thread Boris Brezillon
Le Sat, 19 Aug 2017 13:52:17 +0530,
Bhumika Goyal  a écrit :

> Make this const as it is only stored in the type field of a device
> structure, which is const.
> Done using Coccinelle.
> 

Applied to l2-mtd/master.

Thanks,

Boris

> Signed-off-by: Bhumika Goyal 
> ---
>  drivers/mtd/mtdcore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index f872a99..e7ea842 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -340,7 +340,7 @@ static ssize_t mtd_bbtblocks_show(struct device *dev,
>  };
>  ATTRIBUTE_GROUPS(mtd);
>  
> -static struct device_type mtd_devtype = {
> +static const struct device_type mtd_devtype = {
>   .name   = "mtd",
>   .groups = mtd_groups,
>   .release= mtd_release,

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


Re: [PATCH 3/3] ANDROID: binder: fix proc->tsk check.

2017-08-21 Thread John Stultz
On Tue, Aug 8, 2017 at 11:08 AM, Greg KH  wrote:
> On Tue, Aug 08, 2017 at 10:34:47AM -0700, John Stultz wrote:
>> On Fri, Jul 28, 2017 at 4:56 AM, Martijn Coenen  wrote:
>> > Commit c4ea41ba195d ("binder: use group leader instead of open thread")'
>> > was incomplete and didn't update a check in binder_mmap(), causing all
>> > mmap() calls into the binder driver to fail.
>> >
>> > Signed-off-by: Martijn Coenen 
>> > ---
>> >  drivers/android/binder.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/android/binder.c b/drivers/android/binder.c
>> > index f7665c31feca..831cdd7d197d 100644
>> > --- a/drivers/android/binder.c
>> > +++ b/drivers/android/binder.c
>> > @@ -3362,7 +3362,7 @@ static int binder_mmap(struct file *filp, struct 
>> > vm_area_struct *vma)
>> > const char *failure_string;
>> > struct binder_buffer *buffer;
>> >
>> > -   if (proc->tsk != current)
>> > +   if (proc->tsk != current->group_leader)
>> > return -EINVAL;
>> >
>> > if ((vma->vm_end - vma->vm_start) > SZ_4M)
>>
>> Tested-by: John Stultz 
>>
>> As Amit already confirmed, this resolves the wifi and bluetooth
>> regression I was seeing with Android using 4.13-rc2.
>>
>> Though I've not seen it show up in Linus' tree yet, so I wanted to
>> pester folks so it gets into 4.13-rc (its given me some slight grief
>> trying to bisect down a separate issue).
>
> I will queue this up in the next few days, I need to resolve the patches
> that have been sent to me for this, sorry for the delay.

Hey Greg,
  Sorry to pester you again on this, but this seems to still be
missing in -rc6. Don't want it to slip by.

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


[PATCH 4/4] staging: iio: tsl2x7x: constify i2c_device_id

2017-08-21 Thread Arvind Yadav
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by  work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/staging/iio/light/tsl2x7x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 1467199..9b4425d 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -2010,7 +2010,7 @@ static int tsl2x7x_remove(struct i2c_client *client)
return 0;
 }
 
-static struct i2c_device_id tsl2x7x_idtable[] = {
+static const struct i2c_device_id tsl2x7x_idtable[] = {
{ "tsl2571", tsl2571 },
{ "tsl2671", tsl2671 },
{ "tmd2671", tmd2671 },
-- 
2.7.4

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


Re: [PATCH] staging: greybus: audio: constify snd_soc_dai_ops structures

2017-08-21 Thread Mark Greer
On Mon, Aug 21, 2017 at 10:28:24AM +0530, Arvind Yadav wrote:
> snd_soc_dai_ops are not supposed to change at runtime. All functions
> working with snd_soc_dai_ops provided by  work with
> const snd_soc_dai_ops. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav 
> ---
>  drivers/staging/greybus/audio_codec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/audio_codec.c 
> b/drivers/staging/greybus/audio_codec.c
> index 25c8bb4..a6d01f0 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -674,7 +674,7 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, 
> int mute, int stream)
>   return ret;
>  }
>  
> -static struct snd_soc_dai_ops gbcodec_dai_ops = {
> +static const struct snd_soc_dai_ops gbcodec_dai_ops = {
>   .startup = gbcodec_startup,
>   .shutdown = gbcodec_shutdown,
>   .hw_params = gbcodec_hw_params,

Thanks Arvind.

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


Re: [PATCH 1/1 v2] binder: free memory on error

2017-08-21 Thread Dan Carpenter
On Mon, Aug 21, 2017 at 04:13:28PM +0200, Christian Brauner wrote:
> On binder_init() the devices string is duplicated and smashed into individual
> device names which are passed along. However, the original duplicated string
> wasn't freed in case binder_init() failed. Let's free it on error.
> 
> Signed-off-by: Christian Brauner 

Looks good.  Thanks.

regards,
dan carpenter

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


[PATCH 0/1 v2] binder: free memory on error

2017-08-21 Thread Christian Brauner
On binder_init() the devices string is duplicated and smashed into individual
device names which are passed along. However, if I'm not mistaken the original
duplicated string wasn't freed in case binder_init() failed.

Christian

Changelog v2 2017-08-21 (Thanks Dan!)
- use more descriptive commit message
- call kfree(device_names) on correct position

Christian Brauner (1):
  binder: free memory on error

 drivers/android/binder.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

-- 
2.13.3

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


[PATCH 1/1 v2] binder: free memory on error

2017-08-21 Thread Christian Brauner
On binder_init() the devices string is duplicated and smashed into individual
device names which are passed along. However, the original duplicated string
wasn't freed in case binder_init() failed. Let's free it on error.

Signed-off-by: Christian Brauner 
---
Changelog v2 2017-08-21:
- use more descriptive commit message
- call kfree(device_names) on correct position
---
 drivers/android/binder.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index f7665c31feca..a6ae339223f6 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4215,7 +4215,7 @@ static int __init init_binder_device(const char *name)
 static int __init binder_init(void)
 {
int ret;
-   char *device_name, *device_names;
+   char *device_name, *device_names, *device_tmp;
struct binder_device *device;
struct hlist_node *tmp;
 
@@ -4263,7 +4263,8 @@ static int __init binder_init(void)
}
strcpy(device_names, binder_devices_param);
 
-   while ((device_name = strsep(_names, ","))) {
+   device_tmp = device_names;
+   while ((device_name = strsep(_tmp, ","))) {
ret = init_binder_device(device_name);
if (ret)
goto err_init_binder_device_failed;
@@ -4277,6 +4278,9 @@ static int __init binder_init(void)
hlist_del(>hlist);
kfree(device);
}
+
+   kfree(device_names);
+
 err_alloc_device_names_failed:
debugfs_remove_recursive(binder_debugfs_dir_entry_root);
 
-- 
2.13.3

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


Re: [PATCH 1/1] binder: free memory on error

2017-08-21 Thread Dan Carpenter
You need a commit message.

On Mon, Aug 21, 2017 at 03:36:16PM +0200, Christian Brauner wrote:
> Signed-off-by: Christian Brauner 
> ---
>  drivers/android/binder.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> index f7665c31feca..41a11661eed7 100644
> --- a/drivers/android/binder.c
> +++ b/drivers/android/binder.c
> @@ -4215,7 +4215,7 @@ static int __init init_binder_device(const char *name)
>  static int __init binder_init(void)
>  {
>   int ret;
> - char *device_name, *device_names;
> + char *device_name, *device_names, *device_tmp;
>   struct binder_device *device;
>   struct hlist_node *tmp;
>  
> @@ -4263,7 +4263,8 @@ static int __init binder_init(void)
>   }
>   strcpy(device_names, binder_devices_param);
>  
> - while ((device_name = strsep(_names, ","))) {
> + device_tmp = device_names;
> + while ((device_name = strsep(_tmp, ","))) {
>   ret = init_binder_device(device_name);
>   if (ret)
>   goto err_init_binder_device_failed;
> @@ -4279,6 +4280,7 @@ static int __init binder_init(void)
>   }
>  err_alloc_device_names_failed:
>   debugfs_remove_recursive(binder_debugfs_dir_entry_root);
> + kfree(device_names);

Unwind in the opposite order from how things are allocated.  So this
should be added before the err_alloc_device_names_failed label:


  5293  if (ret)
  5294  goto err_init_binder_device_failed;
  5295  }
  5296  
  5297  return ret;
  5298  
  5299  err_init_binder_device_failed:
  5300  hlist_for_each_entry_safe(device, tmp, _devices, hlist) {
  5301  misc_deregister(>miscdev);
  5302  hlist_del(>hlist);
  5303  kfree(device);
  5304  }

+   kfree(device_names);

  5305  err_alloc_device_names_failed:
  5306  debugfs_remove_recursive(binder_debugfs_dir_entry_root);
  5307  
  5308  return ret;
  5309  }


regards,
dan carpenter

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


[PATCH 1/1] binder: free memory on error

2017-08-21 Thread Christian Brauner
Signed-off-by: Christian Brauner 
---
 drivers/android/binder.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index f7665c31feca..41a11661eed7 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4215,7 +4215,7 @@ static int __init init_binder_device(const char *name)
 static int __init binder_init(void)
 {
int ret;
-   char *device_name, *device_names;
+   char *device_name, *device_names, *device_tmp;
struct binder_device *device;
struct hlist_node *tmp;
 
@@ -4263,7 +4263,8 @@ static int __init binder_init(void)
}
strcpy(device_names, binder_devices_param);
 
-   while ((device_name = strsep(_names, ","))) {
+   device_tmp = device_names;
+   while ((device_name = strsep(_tmp, ","))) {
ret = init_binder_device(device_name);
if (ret)
goto err_init_binder_device_failed;
@@ -4279,6 +4280,7 @@ static int __init binder_init(void)
}
 err_alloc_device_names_failed:
debugfs_remove_recursive(binder_debugfs_dir_entry_root);
+   kfree(device_names);
 
return ret;
 }
-- 
2.13.3

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


[PATCH 0/1] binder: free memory on error

2017-08-21 Thread Christian Brauner
On binder_init() the devices string is duplicated and smashed into individual
device names which are passed along. However, if I'm not mistaken the original
duplicated string wasn't freed in case binder_init() failed.

Christian

Christian Brauner (1):
  binder: free memory on error

 drivers/android/binder.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.13.3

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


[PATCH] staging: rtl8192e: Change fixed function names with "%s:", __func__

2017-08-21 Thread Shurong Zhang
Replace hard-coded function names in strings with "%s", __func__ in the 
dot11d.c file. Issue found by checkpatch.pl.

Signed-off-by: Shurong Zhang 
---
 drivers/staging/rtl8192e/dot11d.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c 
b/drivers/staging/rtl8192e/dot11d.c
index 017fe04..a3b0153 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -128,12 +128,12 @@ void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 
*pTaddr,
pTriple = (struct chnl_txpow_triple *)(pCoutryIe + 3);
for (i = 0; i < NumTriples; i++) {
if (MaxChnlNum >= pTriple->FirstChnl) {
-   netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): 
Invalid country IE, skip it1\n");
+   netdev_info(dev->dev, "%s(): Invalid country IE, skip 
it1\n", __func__);
return;
}
if (MAX_CHANNEL_NUMBER < (pTriple->FirstChnl +
pTriple->NumChnls)) {
-   netdev_info(dev->dev, "Dot11d_UpdateCountryIe(): 
Invalid country IE, skip it2\n");
+   netdev_info(dev->dev, "%s(): Invalid country IE, skip 
it2\n", __func__);
return;
}
 
-- 
2.7.4



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


Re: [PATCH] staging: lustre: fix structure size for ARM OABI

2017-08-21 Thread Cihangir Akturk
On Sun, Aug 20, 2017 at 03:52:26AM +0100, James Simmons wrote:
> 
> > On Aug 17, 2017, at 10:26, Greg KH  wrote:
> > > 
> > > On Wed, Aug 16, 2017 at 05:44:15PM +0300, Cihangir Akturk wrote:
> > >> When building the kernel for the ARM architecture without setting
> > >> CONFIG_AEABI, size of struct lov_user_md_v3 and struct lov_mds_md_v3
> > >> differs, due to different alignment requirements of OABI and EABI.
> 
> I have to ask are you testing the lustre on ARM?

No, I was just compiling the kernel for ARM architecture, and I hit
this issue. If it's possible, I can give it a try with a bunch of
raspberry pis or another cheap board?

>  
> > >> Marking the anonymous union within struct lov_user_md_v3 as
> > >> '_packed' solves this issue. Otherwise we get the following
> > >> error:
> > >> 
> > >> drivers/staging/lustre/lustre/lov/lov_pack.c:352:2: note: in expansion
> > >> of macro ‘BUILD_BUG_ON’
> > >>  BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3));
> > >> 
> > >> Signed-off-by: Cihangir Akturk 
> > >> ---
> > >> drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +-
> > >> 1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > This file is no longer in the tree :(
> > 
> > With James' recent patch series, this has moved to 
> > include/uapi/linux/lustre/lustre_user.h
> 
> BTW is __packed valid for UAPI headers?

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


Re: [PATCH] staging: vboxvideo: constify drm_fb_helper_funcs

2017-08-21 Thread Hans de Goede

Hi,

On 21-08-17 12:06, Arvind Yadav wrote:

drm_fb_helper_funcs are not supposed to change at runtime.
All functions working with drm_fb_helper_funcs provided by
 work with const drm_fb_helper_funcs.
So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 


Thanks, patch looks good to me:

Reviewed-by: Hans de Goede 

Regards,

Hans



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

diff --git a/drivers/staging/vboxvideo/vbox_fb.c 
b/drivers/staging/vboxvideo/vbox_fb.c
index 35f6d9f..70d99b7 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -330,7 +330,7 @@ static void vbox_fb_gamma_get(struct drm_crtc *crtc, u16 
*red, u16 *green,
*blue = regno;
  }
  
-static struct drm_fb_helper_funcs vbox_fb_helper_funcs = {

+static const struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
.gamma_set = vbox_fb_gamma_set,
.gamma_get = vbox_fb_gamma_get,
.fb_probe = vboxfb_create,


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


Re: [PATCH] Staging: bcm2048: fix bare use of 'unsigned' in radio-bcm2048.c

2017-08-21 Thread Hans Verkuil
On 08/04/2017 04:58 PM, Branislav Radocaj wrote:
> This is a patch to the radio-bcm2048.c file that fixes up
> a warning found by the checkpatch.pl tool.
> 
> Signed-off-by: Branislav Radocaj 
> ---
>  drivers/staging/media/bcm2048/radio-bcm2048.c | 50 
> +--
>  1 file changed, 25 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
> b/drivers/staging/media/bcm2048/radio-bcm2048.c
> index 38f72d069e27..90b8f05201ba 100644
> --- a/drivers/staging/media/bcm2048/radio-bcm2048.c
> +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
> @@ -2000,9 +2000,9 @@ static ssize_t bcm2048_##prop##_read(struct device 
> *dev,\
>   return sprintf(buf, mask "\n", value);  \
>  }
>  
> -#define DEFINE_SYSFS_PROPERTY(prop, signal, size, mask, check)   
> \
> -property_write(prop, signal size, mask, check)   
> \
> -property_read(prop, size, mask)
> +#define DEFINE_SYSFS_PROPERTY(prop, signal_size, size, mask, check)  \
> +property_write(prop, signal_size, mask, check)   
> \
> +property_read(prop, size, mask)  
> \

Jeez, the code in this header is awful.

Let's improve this a bit more:

The 'size' argument in property_read is unused AFAICT, so remove it from that
macro and wherever it is used.

The 'signal, size' arguments of property_write is just a type, so replace
'signal, size' by prop_type. Update DEFINE_SYSFS_PROPERTY accordingly and
then all the DEFINE_SYSFS_PROPERTY lines become:

DEFINE_SYSFS_PROPERTY(power_state, unsigned int, "%u", 0)

which finally makes sense when you read it.

Regards,

Hans

>  
>  #define property_str_read(prop, size)
> \
>  static ssize_t bcm2048_##prop##_read(struct device *dev, \
> @@ -2028,27 +2028,27 @@ static ssize_t bcm2048_##prop##_read(struct device 
> *dev,  \
>   return count;   \
>  }
>  
> -DEFINE_SYSFS_PROPERTY(power_state, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(mute, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(audio_route, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(dac_output, unsigned, int, "%u", 0)
> -
> -DEFINE_SYSFS_PROPERTY(fm_hi_lo_injection, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(fm_frequency, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(fm_af_frequency, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(fm_deemphasis, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(fm_rds_mask, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(fm_best_tune_mode, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(fm_search_rssi_threshold, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(fm_search_mode_direction, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(fm_search_tune_mode, unsigned, int, "%u", value > 3)
> -
> -DEFINE_SYSFS_PROPERTY(rds, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(rds_b_block_mask, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(rds_b_block_match, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(rds_pi_mask, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(rds_pi_match, unsigned, int, "%u", 0)
> -DEFINE_SYSFS_PROPERTY(rds_wline, unsigned, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(power_state, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(mute, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(audio_route, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(dac_output, unsigned int, int, "%u", 0)
> +
> +DEFINE_SYSFS_PROPERTY(fm_hi_lo_injection, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(fm_frequency, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(fm_af_frequency, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(fm_deemphasis, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(fm_rds_mask, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(fm_best_tune_mode, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(fm_search_rssi_threshold, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(fm_search_mode_direction, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(fm_search_tune_mode, unsigned int, int, "%u", value > 
> 3)
> +
> +DEFINE_SYSFS_PROPERTY(rds, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(rds_b_block_mask, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(rds_b_block_match, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(rds_pi_mask, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(rds_pi_match, unsigned int, int, "%u", 0)
> +DEFINE_SYSFS_PROPERTY(rds_wline, unsigned int, int, "%u", 0)
>  property_read(rds_pi, unsigned int, "%x")
>  property_str_read(rds_rt, (BCM2048_MAX_RDS_RT + 1))
>  property_str_read(rds_ps, (BCM2048_MAX_RDS_PS + 1))
> @@ -2060,7 +2060,7 @@ property_read(region_bottom_frequency, unsigned int, 
> "%u")
>  property_read(region_top_frequency, unsigned int, "%u")
>  

[PATCH] iio staging: tsl2x7x: clean up limit checks

2017-08-21 Thread Dan Carpenter
The second part of this patch is probably the most interesting.  We
use "TSL2X7X_MAX_LUX_TABLE_SIZE * 3" as the limit instead of just
"TSL2X7X_MAX_LUX_TABLE_SIZE".  It creates a static checker warning that
we are going of of bounds, but in real life we always hit the break
statement on the last element so it's fine.

The situation is that we normally have arrays with 3 elements of struct
tsl2x7x_lux which has 3 unsigned integers.  If we load the table with
sysfs then we're allow to have 9 elements instead.

So the size of the default table in bytes is sizeof(int) times 3 struct
members times 3 elements.  The original code wrote it as sizeof(int)
times the number of elements in the bigger table (9).  It happens that
9 is the same thing as 3 * 3 but expressing it that way is misleading.

For the second part of the patch, the original code just had an extra
"multiply by three" and now that is removed.  The last element in the
array is always zeroed memory whether this uses the default tables or it
gets loaded with sysfs so we always hit the break statement anyway.

Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/iio/light/tsl2x7x.h 
b/drivers/staging/iio/light/tsl2x7x.h
index ecae92211216..1beb8d2eb848 100644
--- a/drivers/staging/iio/light/tsl2x7x.h
+++ b/drivers/staging/iio/light/tsl2x7x.h
@@ -23,10 +23,6 @@
 #define __TSL2X7X_H
 #include 
 
-/* Max number of segments allowable in LUX table */
-#define TSL2X7X_MAX_LUX_TABLE_SIZE 9
-#define MAX_DEFAULT_TABLE_BYTES (sizeof(int) * TSL2X7X_MAX_LUX_TABLE_SIZE)
-
 struct iio_dev;
 
 struct tsl2x7x_lux {
@@ -35,6 +31,11 @@ struct tsl2x7x_lux {
unsigned int ch1;
 };
 
+/* Max number of segments allowable in LUX table */
+#define TSL2X7X_MAX_LUX_TABLE_SIZE 9
+/* The default tables are all 3 elements */
+#define MAX_DEFAULT_TABLE_BYTES (sizeof(struct tsl2x7x_lux) * 3)
+
 /**
  * struct tsl2x7x_default_settings - power on defaults unless
  *   overridden by platform data.
diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 786e93f16ce9..2db1715ff659 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -1113,7 +1113,7 @@ static ssize_t in_illuminance0_lux_table_show(struct 
device *dev,
int i = 0;
int offset = 0;
 
-   while (i < (TSL2X7X_MAX_LUX_TABLE_SIZE * 3)) {
+   while (i < TSL2X7X_MAX_LUX_TABLE_SIZE) {
offset += snprintf(buf + offset, PAGE_SIZE, "%u,%u,%u,",
chip->tsl2x7x_device_lux[i].ratio,
chip->tsl2x7x_device_lux[i].ch0,
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vboxvideo: constify drm_fb_helper_funcs

2017-08-21 Thread Arvind Yadav
drm_fb_helper_funcs are not supposed to change at runtime.
All functions working with drm_fb_helper_funcs provided by
 work with const drm_fb_helper_funcs.
So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/staging/vboxvideo/vbox_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vboxvideo/vbox_fb.c 
b/drivers/staging/vboxvideo/vbox_fb.c
index 35f6d9f..70d99b7 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -330,7 +330,7 @@ static void vbox_fb_gamma_get(struct drm_crtc *crtc, u16 
*red, u16 *green,
*blue = regno;
 }
 
-static struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
+static const struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
.gamma_set = vbox_fb_gamma_set,
.gamma_get = vbox_fb_gamma_get,
.fb_probe = vboxfb_create,
-- 
1.9.1

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


[PATCH 3/3] staging:rtl8188eu:core Fix coding style issues

2017-08-21 Thread Janani S
This patch solves the following warning shown by
checkpatch script
WARNING: Comparisons should place the constants
on the right side of the test

Signed-off-by: Janani S 
---
 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c 
b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index d8d88b5..767928a 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -56,7 +56,7 @@ u8 rtw_do_join(struct adapter *padapter)
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, 
("rtw_do_join(): site survey if scanned_queue is empty\n."));
/*  submit site_survey_cmd */
ret = rtw_sitesurvey_cmd(padapter, 
>assoc_ssid, 1, NULL, 0);
-   if (_SUCCESS != ret) {
+   if (ret != _SUCCESS) {
pmlmepriv->to_join = false;
RT_TRACE(_module_rtl871x_ioctl_set_c_, 
_drv_err_, ("rtw_do_join(): site survey return error\n."));
}
@@ -110,7 +110,7 @@ u8 rtw_do_join(struct adapter *padapter)
if (!pmlmepriv->LinkDetectInfo.bBusyTraffic ||
pmlmepriv->to_roaming > 0) {
ret = rtw_sitesurvey_cmd(padapter, 
>assoc_ssid, 1, NULL, 0);
-   if (_SUCCESS != ret) {
+   if (ret != _SUCCESS) {
pmlmepriv->to_join = false;

RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("do_join(): site survey 
return error\n."));
}
@@ -621,7 +621,7 @@ int rtw_set_country(struct adapter *adapter, const char 
*country_code)
 
DBG_88E("%s country_code:%s\n", __func__, country_code);
for (i = 0; i < ARRAY_SIZE(channel_table); i++) {
-   if (0 == strcmp(channel_table[i].name, country_code)) {
+   if (strcmp(channel_table[i].name, country_code) == 0) {
channel_plan = channel_table[i].channel_plan;
break;
}
-- 
1.9.1

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


[PATCH 2/2] staging:rtl8188eu:core Fix add spaces around

2017-08-21 Thread Janani S
This patch is created to solve the coding style issues reported
by checkpatch script.

Signed-off-by: Janani S 
---
 drivers/staging/rtl8188eu/core/rtw_ap.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 647a922..66d4e6c 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -119,7 +119,7 @@ static void update_BCNTIM(struct adapter *padapter)
}
*dst_ie++ = _TIM_IE_;
 
-   if ((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc))
+   if ((pstapriv->tim_bitmap & 0xff00) && (pstapriv->tim_bitmap & 0x00fc))
tim_ielen = 5;
else
tim_ielen = 4;
@@ -129,7 +129,7 @@ static void update_BCNTIM(struct adapter *padapter)
*dst_ie++ = 0;/* DTIM count */
*dst_ie++ = 1;/* DTIM period */
 
-   if (pstapriv->tim_bitmap(0))/* for bc/mc frames */
+   if (pstapriv->tim_bitmap & BIT(0))/* for bc/mc frames */
*dst_ie++ = BIT(0);/* bitmap ctrl */
else
*dst_ie++ = 0;
@@ -583,7 +583,7 @@ static void update_bmc_sta(struct adapter *padapter)
{
u8 arg = 0;
 
-   arg = psta->mac_id&0x1f;
+   arg = psta->mac_id & 0x1f;
arg |= BIT(7);
tx_ra_bitmap |= ((raid << 28) & 0xf000);
DBG_88E("update_bmc_sta, mask = 0x%x, arg = 0x%x\n", 
tx_ra_bitmap, arg);
@@ -1043,7 +1043,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
(psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP))
pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY & (0x07 << 2));
else
-   pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
+   pht_cap->ampdu_params_info |= 
(IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00);
 
/* set  Max Rx AMPDU size  to 64K */
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 
0x03);
@@ -1719,7 +1719,7 @@ int rtw_sta_flush(struct adapter *padapter)
 
DBG_88E(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(padapter->pnetdev));
 
-   if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+   if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
return 0;
 
spin_lock_bh(>asoc_list_lock);
@@ -1754,7 +1754,7 @@ void sta_info_update(struct adapter *padapter, struct 
sta_info *psta)
struct mlme_priv *pmlmepriv = >mlmepriv;
 
/* update wmm cap. */
-   if (WLAN_STA_WME)
+   if (WLAN_STA_WME & flags)
psta->qos_option = 1;
else
psta->qos_option = 0;
@@ -1763,7 +1763,7 @@ void sta_info_update(struct adapter *padapter, struct 
sta_info *psta)
psta->qos_option = 0;
 
/* update 802.11n ht cap. */
-   if (WLAN_STA_HT) {
+   if (WLAN_STA_HT & flags) {
psta->htpriv.ht_option = true;
psta->qos_option = 1;
} else {
-- 
1.9.1

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