Re: [PATCH 22/29] drivers, scsi: convert iscsi_task.refcount from atomic_t to refcount_t

2017-03-09 Thread Johannes Thumshirn
On 03/09/2017 08:18 AM, Reshetova, Elena wrote:
>> On Mon, Mar 06, 2017 at 04:21:09PM +0200, Elena Reshetova wrote:
>>> refcount_t type and corresponding API should be
>>> used instead of atomic_t when the variable is used as
>>> a reference counter. This allows to avoid accidental
>>> refcounter overflows that might lead to use-after-free
>>> situations.
>>>
>>> Signed-off-by: Elena Reshetova 
>>> Signed-off-by: Hans Liljestrand 
>>> Signed-off-by: Kees Cook 
>>> Signed-off-by: David Windsor 
>>
>> This looks OK to me.
>>
>> Acked-by: Chris Leech 
> 
> Thank you for review! Do you have a tree that can take this change? 

Hi Elena,

iscsi like fcoe should go via the SCSI tree.

Byte,
Johannes

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging, android: remove lowmemory killer from the tree

2017-03-09 Thread Michal Hocko
Greg, do you see any obstacle to have this merged. The discussion so far
shown that a) vendors are not using the code as is b) there seems to be
an agreement that something else than we have in the kernel is really
needed.

On Wed 22-02-17 13:01:21, Michal Hocko wrote:
> From: Michal Hocko 
> 
> Lowmemory killer is sitting in the staging tree since 2008 without any
> serious interest for fixing issues brought up by the MM folks. The main
> objection is that the implementation is basically broken by design:
>   - it hooks into slab shrinker API which is not suitable for this
> purpose. lowmem_count implementation just shows this nicely.
> There is no scaling based on the memory pressure and no
> feedback to the generic shrinker infrastructure.
> Moreover lowmem_scan is called way too often for the heavy
> work it performs.
>   - it is not reclaim context aware - no NUMA and/or memcg
> awareness.
> 
> As the code stands right now it just adds a maintenance overhead when
> core MM changes have to update lowmemorykiller.c as well. It also seems
> that the alternative LMK implementation will be solely in the userspace
> so this code has no perspective it seems. The staging tree is supposed
> to be for a code which needs to be put in shape before it can be merged
> which is not the case here obviously.
> 
> Signed-off-by: Michal Hocko 
> ---
>  drivers/staging/android/Kconfig   |  10 --
>  drivers/staging/android/Makefile  |   1 -
>  drivers/staging/android/lowmemorykiller.c | 212 
> --
>  include/linux/sched.h |   4 -
>  4 files changed, 227 deletions(-)
>  delete mode 100644 drivers/staging/android/lowmemorykiller.c
> 
> diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
> index 6c00d6f765c6..71a50b99caff 100644
> --- a/drivers/staging/android/Kconfig
> +++ b/drivers/staging/android/Kconfig
> @@ -14,16 +14,6 @@ config ASHMEM
> It is, in theory, a good memory allocator for low-memory devices,
> because it can discard shared memory units when under memory pressure.
>  
> -config ANDROID_LOW_MEMORY_KILLER
> - bool "Android Low Memory Killer"
> - ---help---
> -   Registers processes to be killed when low memory conditions, this is 
> useful
> -   as there is no particular swap space on android.
> -
> -   The registered process will kill according to the priorities in 
> android init
> -   scripts (/init.rc), and it defines priority values with minimum free 
> memory size
> -   for each priority.
> -
>  source "drivers/staging/android/ion/Kconfig"
>  
>  endif # if ANDROID
> diff --git a/drivers/staging/android/Makefile 
> b/drivers/staging/android/Makefile
> index 7ed1be798909..7cf1564a49a5 100644
> --- a/drivers/staging/android/Makefile
> +++ b/drivers/staging/android/Makefile
> @@ -3,4 +3,3 @@ ccflags-y += -I$(src) # needed for trace 
> events
>  obj-y+= ion/
>  
>  obj-$(CONFIG_ASHMEM) += ashmem.o
> -obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER)  += lowmemorykiller.o
> diff --git a/drivers/staging/android/lowmemorykiller.c 
> b/drivers/staging/android/lowmemorykiller.c
> deleted file mode 100644
> index ec3b66561412..
> --- a/drivers/staging/android/lowmemorykiller.c
> +++ /dev/null
> @@ -1,212 +0,0 @@
> -/* drivers/misc/lowmemorykiller.c
> - *
> - * The lowmemorykiller driver lets user-space specify a set of memory 
> thresholds
> - * where processes with a range of oom_score_adj values will get killed. 
> Specify
> - * the minimum oom_score_adj values in
> - * /sys/module/lowmemorykiller/parameters/adj and the number of free pages in
> - * /sys/module/lowmemorykiller/parameters/minfree. Both files take a comma
> - * separated list of numbers in ascending order.
> - *
> - * For example, write "0,8" to /sys/module/lowmemorykiller/parameters/adj and
> - * "1024,4096" to /sys/module/lowmemorykiller/parameters/minfree to kill
> - * processes with a oom_score_adj value of 8 or higher when the free memory
> - * drops below 4096 pages and kill processes with a oom_score_adj value of 0 
> or
> - * higher when the free memory drops below 1024 pages.
> - *
> - * The driver considers memory used for caches to be free, but if a large
> - * percentage of the cached memory is locked this can be very inaccurate
> - * and processes may not get killed until the normal oom killer is triggered.
> - *
> - * Copyright (C) 2007-2008 Google, Inc.
> - *
> - * This software is licensed under the terms of the GNU General Public
> - * License version 2, as published by the Free Software Foundation, and
> - * may be copied, distributed, and modified under those terms.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

RE: [PATCH 22/29] drivers, scsi: convert iscsi_task.refcount from atomic_t to refcount_t

2017-03-09 Thread Reshetova, Elena

> On 03/09/2017 08:18 AM, Reshetova, Elena wrote:
> >> On Mon, Mar 06, 2017 at 04:21:09PM +0200, Elena Reshetova wrote:
> >>> refcount_t type and corresponding API should be
> >>> used instead of atomic_t when the variable is used as
> >>> a reference counter. This allows to avoid accidental
> >>> refcounter overflows that might lead to use-after-free
> >>> situations.
> >>>
> >>> Signed-off-by: Elena Reshetova 
> >>> Signed-off-by: Hans Liljestrand 
> >>> Signed-off-by: Kees Cook 
> >>> Signed-off-by: David Windsor 
> >>
> >> This looks OK to me.
> >>
> >> Acked-by: Chris Leech 
> >
> > Thank you for review! Do you have a tree that can take this change?
> 
> Hi Elena,
> 
> iscsi like fcoe should go via the SCSI tree.

Thanks Johannes! Should I resend with "Acked-by" added in order for it to be 
picked up? 

Best Regards,
Elena.


> 
> Byte,
>   Johannes
> 
> --
> Johannes Thumshirn  Storage
> jthumsh...@suse.de+49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging, android: remove lowmemory killer from the tree

2017-03-09 Thread Greg KH
On Thu, Mar 09, 2017 at 10:15:13AM +0100, Michal Hocko wrote:
> Greg, do you see any obstacle to have this merged. The discussion so far
> shown that a) vendors are not using the code as is b) there seems to be
> an agreement that something else than we have in the kernel is really
> needed.

Well, some vendors are using the code as-is, just not Sony...

I think the ideas that Tim wrote about is the best way forward for this.
I'd prefer to leave the code in the kernel until that solution is
integrated, as dropping support entirely isn't very nice.

But, given that almost no Android system is running mainline at the
moment, I will queue this patch up for 4.12-rc1, which will give the
Google people a bit more of an incentive to get their solution
implemented and working and merged :)

Sound reasonable?  I haven't started to go through my patch queue for
4.12-rc1 stuff just yet, still digging through it for 4.11-final things
at the moment.  Give me a week or so to catch up.

thanks,

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


Re: [PATCH 22/29] drivers, scsi: convert iscsi_task.refcount from atomic_t to refcount_t

2017-03-09 Thread Johannes Thumshirn
On 03/09/2017 10:26 AM, Reshetova, Elena wrote:
> 
>> On 03/09/2017 08:18 AM, Reshetova, Elena wrote:
 On Mon, Mar 06, 2017 at 04:21:09PM +0200, Elena Reshetova wrote:
> refcount_t type and corresponding API should be
> used instead of atomic_t when the variable is used as
> a reference counter. This allows to avoid accidental
> refcounter overflows that might lead to use-after-free
> situations.
>
> Signed-off-by: Elena Reshetova 
> Signed-off-by: Hans Liljestrand 
> Signed-off-by: Kees Cook 
> Signed-off-by: David Windsor 

 This looks OK to me.

 Acked-by: Chris Leech 
>>>
>>> Thank you for review! Do you have a tree that can take this change?
>>
>> Hi Elena,
>>
>> iscsi like fcoe should go via the SCSI tree.
> 
> Thanks Johannes! Should I resend with "Acked-by" added in order for it to be 
> picked up? 

Yes I think this would be a good way to go.

Byte,
Johannes
-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging, android: remove lowmemory killer from the tree

2017-03-09 Thread Michal Hocko
On Thu 09-03-17 10:30:28, Greg KH wrote:
> On Thu, Mar 09, 2017 at 10:15:13AM +0100, Michal Hocko wrote:
> > Greg, do you see any obstacle to have this merged. The discussion so far
> > shown that a) vendors are not using the code as is b) there seems to be
> > an agreement that something else than we have in the kernel is really
> > needed.
> 
> Well, some vendors are using the code as-is, just not Sony...
> 
> I think the ideas that Tim wrote about is the best way forward for this.
> I'd prefer to leave the code in the kernel until that solution is
> integrated, as dropping support entirely isn't very nice.
> 
> But, given that almost no Android system is running mainline at the
> moment, I will queue this patch up for 4.12-rc1, which will give the
> Google people a bit more of an incentive to get their solution
> implemented and working and merged :)
> 
> Sound reasonable?

sounds good to me.
-- 
Michal Hocko
SUSE Labs
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC PATCH 00/12] Ion cleanup in preparation for moving out of staging

2017-03-09 Thread Benjamin Gaignard
2017-03-06 17:04 GMT+01:00 Daniel Vetter :
> On Mon, Mar 06, 2017 at 11:58:05AM +0100, Mark Brown wrote:
>> On Mon, Mar 06, 2017 at 11:40:41AM +0100, Daniel Vetter wrote:
>>
>> > No one gave a thing about android in upstream, so Greg KH just dumped it
>> > all into staging/android/. We've discussed ION a bunch of times, recorded
>> > anything we'd like to fix in staging/android/TODO, and Laura's patch
>> > series here addresses a big chunk of that.
>>
>> > This is pretty much the same approach we (gpu folks) used to de-stage the
>> > syncpt stuff.
>>
>> Well, there's also the fact that quite a few people have issues with the
>> design (like Laurent).  It seems like a lot of them have either got more
>> comfortable with it over time, or at least not managed to come up with
>> any better ideas in the meantime.
>
> See the TODO, it has everything a really big group (look at the patch for
> the full Cc: list) figured needs to be improved at LPC 2015. We don't just
> merge stuff because merging stuff is fun :-)
>
> Laurent was even in that group ...
> -Daniel

For me those patches are going in the right direction.

I still have few questions:
- since alignment management has been remove from ion-core, should it
be also removed from ioctl structure ?
- can you we ride off ion_handle (at least in userland) and only
export a dma-buf descriptor ?

In the future how can we add new heaps ?
Some platforms have very specific memory allocation
requirements (just have a look in the number of gem custom allocator in drm)
Do you plan to add heap type/mask for each ?

Benjamin

> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch


Follow Linaro: Facebook | Twitter | Blog
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Minor Fix to please checkpatch Declaring 'unsigned int' instead of 'unsigned'

2017-03-09 Thread Pushkar Jambhlekar
Signed-off-by: Pushkar Jambhlekar 
---
 drivers/staging/lustre/lustre/llite/vvp_dev.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c 
b/drivers/staging/lustre/lustre/llite/vvp_dev.c
index 12c129f7e..8d78755 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
@@ -381,11 +381,10 @@ int cl_sb_fini(struct super_block *sb)
 #define PGC_DEPTH_SHIFT (32)
 
 struct vvp_pgcache_id {
-   unsigned vpi_bucket;
-   unsigned vpi_depth;
-   uint32_t vpi_index;
-
-   unsigned vpi_curdep;
+   unsigned intvpi_bucket;
+   unsigned intvpi_depth;
+   uint32_tvpi_index;
+   unsigned intvpi_curdep;
struct lu_object_header *vpi_obj;
 };
 
-- 
2.7.4

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


Re: [PATCH] Minor Fix to please checkpatch Declaring 'unsigned int' instead of 'unsigned'

2017-03-09 Thread Greg Kroah-Hartman
On Thu, Mar 09, 2017 at 05:20:51PM +0530, Pushkar Jambhlekar wrote:
> Signed-off-by: Pushkar Jambhlekar 
> ---
>  drivers/staging/lustre/lustre/llite/vvp_dev.c | 9 -
>  1 file changed, 4 insertions(+), 5 deletions(-)

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Minor coding guideline Fix in lusture module

2017-03-09 Thread Pushkar Jambhlekar
Replacing 'unsigned' with 'unsigned int'  in vvp_pgcache_id.
Checkpath.pl passed.

Signed-off-by: Pushkar Jambhlekar 
---
 drivers/staging/lustre/lustre/llite/vvp_dev.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c 
b/drivers/staging/lustre/lustre/llite/vvp_dev.c
index 12c129f7e..8d78755 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
@@ -381,11 +381,10 @@ int cl_sb_fini(struct super_block *sb)
 #define PGC_DEPTH_SHIFT (32)
 
 struct vvp_pgcache_id {
-   unsigned vpi_bucket;
-   unsigned vpi_depth;
-   uint32_t vpi_index;
-
-   unsigned vpi_curdep;
+   unsigned intvpi_bucket;
+   unsigned intvpi_depth;
+   uint32_tvpi_index;
+   unsigned intvpi_curdep;
struct lu_object_header *vpi_obj;
 };
 
-- 
2.7.4

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


Re: [PATCH] drivers: android: staging: ion: cosmetic fixes

2017-03-09 Thread Greg KH
On Sun, Mar 05, 2017 at 11:30:26PM +, P Kapadia wrote:
> - remove extra line 
> - remove unnecessary paranthesis
> 
> Signed-off-by: Purnendu Kapadia 

I can't accept patches sent in html format :(

Please fix up and resend.

thanks,

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


Re: [PATCH] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.

2017-03-09 Thread Greg KH
On Wed, Mar 08, 2017 at 06:18:32PM +0800, zhangshuxia...@gmail.com wrote:
> From: zhangshuxiao 
> 
> vfs_llseek will check whether the file mode has
> FMODE_LSEEK, no return failure. But ashmem can be
> lseek, so add FMODE_LSEEK to ashmem file.

Really?  What is causing this failure?  I haven't heard from anyone else
about this issue, is there something different in your userspace
framework?

> 
> Signed-off-by: zhangshuxiao 

I need a "full" name for a signed-off-by: please.

thanks,

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


Re: [PATCH] staging, android: remove lowmemory killer from the tree

2017-03-09 Thread Greg KH
On Thu, Mar 09, 2017 at 11:00:07AM +0100, Michal Hocko wrote:
> On Thu 09-03-17 10:30:28, Greg KH wrote:
> > On Thu, Mar 09, 2017 at 10:15:13AM +0100, Michal Hocko wrote:
> > > Greg, do you see any obstacle to have this merged. The discussion so far
> > > shown that a) vendors are not using the code as is b) there seems to be
> > > an agreement that something else than we have in the kernel is really
> > > needed.
> > 
> > Well, some vendors are using the code as-is, just not Sony...
> > 
> > I think the ideas that Tim wrote about is the best way forward for this.
> > I'd prefer to leave the code in the kernel until that solution is
> > integrated, as dropping support entirely isn't very nice.
> > 
> > But, given that almost no Android system is running mainline at the
> > moment, I will queue this patch up for 4.12-rc1, which will give the
> > Google people a bit more of an incentive to get their solution
> > implemented and working and merged :)
> > 
> > Sound reasonable?
> 
> sounds good to me.

Oh nevermind, might as well commit it now to my -next branch.  All now
deleted :)

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


Re: [PATCH v2 05/12] staging: ks7010: remove unnecessary parenthesis

2017-03-09 Thread Greg Kroah-Hartman
On Thu, Mar 09, 2017 at 03:47:05PM +1100, Tobin C. Harding wrote:
> Checkpatch emits CHECK: Unnecessary parentheses.
> 
> Remove unnecessary parentheses.
> 
> Signed-off-by: Tobin C. Harding 
> ---
>  drivers/staging/ks7010/ks_hostif.c | 24 
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks_hostif.c 
> b/drivers/staging/ks7010/ks_hostif.c
> index a354e34e..b75ef1d6 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -36,7 +36,7 @@ inline u8 get_BYTE(struct ks_wlan_private *priv)
>  {
>   u8 data;
>  
> - data = *(priv->rxp)++;
> + data = *priv->rxp++;

Are you sure this is ok?  I would have to dig out a book to find the
ordering rules here...

thanks,

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


Re: [PATCH v2 03/12] staging: ks7010: replace C types with kernel types

2017-03-09 Thread Greg Kroah-Hartman
On Thu, Mar 09, 2017 at 03:47:03PM +1100, Tobin C. Harding wrote:
> Checkpatch emits CHECK prefer kernel type. Source and header file use
> C standard types uintN_t.
> 
> Replace C standard types with kernel types. uintN_t -> uN

Can you just replace one type at a time?  Makes it much easier to
review.  As it is, this is almost impossible to verify you got it
correct :(

thanks,

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


Re: [PATCH v4] staging: rtl8192e: remove unnecesary whitespace in rtl_wx.c

2017-03-09 Thread Greg KH
On Wed, Mar 01, 2017 at 04:38:31PM +0530, Sumantro wrote:
> Remove unnecessary whiteshpaces in rtl_wc.
> 
> Problems found by checkpatch.pl.
> 
> Signed-off-by: Sumantro Mukherjee 

Your signed-off-by: line does not match your "From:" name :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] Staging: xgifb: XGI_main_26.c: non-standard C

2017-03-09 Thread Greg KH
On Thu, Mar 09, 2017 at 12:28:43AM +0530, Manoj Sawai wrote:
> Fixed a checkpatch warning about use of %Lx instead of %llx.
> 
> Signed-off-by: Manoj Sawai 
> ---
>  drivers/staging/xgifb/XGI_main_26.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

You sent 2 patches with the same exact subject, yet they did different
things?  Please fix up and resend.

thanks,

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


Re: [PATCH] Minor coding guideline Fix in lusture module

2017-03-09 Thread Greg Kroah-Hartman
On Thu, Mar 09, 2017 at 05:52:07PM +0530, Pushkar Jambhlekar wrote:
> Replacing 'unsigned' with 'unsigned int'  in vvp_pgcache_id.
> Checkpath.pl passed.
> 
> Signed-off-by: Pushkar Jambhlekar 
> ---
>  drivers/staging/lustre/lustre/llite/vvp_dev.c | 9 -
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c 
> b/drivers/staging/lustre/lustre/llite/vvp_dev.c
> index 12c129f7e..8d78755 100644
> --- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
> +++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
> @@ -381,11 +381,10 @@ int cl_sb_fini(struct super_block *sb)
>  #define PGC_DEPTH_SHIFT (32)
>  
>  struct vvp_pgcache_id {
> - unsigned vpi_bucket;
> - unsigned vpi_depth;
> - uint32_t vpi_index;
> -
> - unsigned vpi_curdep;
> + unsigned intvpi_bucket;
> + unsigned intvpi_depth;
> + uint32_tvpi_index;
> + unsigned intvpi_curdep;
>   struct lu_object_header *vpi_obj;
>  };
>  
> -- 
> 2.7.4

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/6] staging: speakup: Add blank line after function/struct/union/enum declarations

2017-03-09 Thread Greg KH
On Sat, Mar 04, 2017 at 01:47:04AM +0530, Arushi Singhal wrote:
> This patch fixes the warnings reported by checkpatch.pl
> for please use a blank line after function/struct/union/enum
> declarations.
> 
> Signed-off-by: Arushi Singhal 
> ---
>  drivers/staging/speakup/main.c | 1 +
>  drivers/staging/speakup/serialio.c | 1 +
>  drivers/staging/speakup/speakup_dtlk.c | 1 +
>  3 files changed, 3 insertions(+)

You seem to have sent me many different series of patches for this
driver, some of them the same, some different, some duplicates.  I have
no idea what to apply and what not to apply, so I'm dropping them all
from my patch queue.  Please fix up and resend a _single_ patch series
with your patches so I know what to review and possibly apply.

thanks,

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


Re: [RFC PATCH v2 12/32] x86: Add early boot support when running with SEV active

2017-03-09 Thread Borislav Petkov
On Thu, Mar 02, 2017 at 10:14:48AM -0500, Brijesh Singh wrote:
> From: Tom Lendacky 
> 
> Early in the boot process, add checks to determine if the kernel is
> running with Secure Encrypted Virtualization (SEV) active by issuing
> a CPUID instruction.
> 
> During early compressed kernel booting, if SEV is active the pagetables are
> updated so that data is accessed and decompressed with encryption.
> 
> During uncompressed kernel booting, if SEV is the memory encryption mask is
> set and a flag is set to indicate that SEV is enabled.

I don't know how many times I have to say this but I'm going to keep
doing it until it sticks: :-)

Please, no "WHAT" in the commit messages - I can see the "WHAT - but
"WHY".

Ok?

> diff --git a/arch/x86/boot/compressed/mem_encrypt.S 
> b/arch/x86/boot/compressed/mem_encrypt.S
> new file mode 100644
> index 000..8313c31
> --- /dev/null
> +++ b/arch/x86/boot/compressed/mem_encrypt.S
> @@ -0,0 +1,75 @@
> +/*
> + * AMD Memory Encryption Support
> + *
> + * Copyright (C) 2016 Advanced Micro Devices, Inc.
> + *
> + * Author: Tom Lendacky 
> + *
> + * 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 
> +#include 
> +
> + .text
> + .code32
> +ENTRY(sev_enabled)
> + xor %eax, %eax
> +
> +#ifdef CONFIG_AMD_MEM_ENCRYPT
> + push%ebx
> + push%ecx
> + push%edx
> +
> + /* Check if running under a hypervisor */
> + movl$0x4000, %eax
> + cpuid
> + cmpl$0x4001, %eax
> + jb  .Lno_sev
> +
> + movl$0x4001, %eax
> + cpuid
> + bt  $KVM_FEATURE_SEV, %eax
> + jnc .Lno_sev
> +
> + /*
> +  * Check for memory encryption feature:
> +  *   CPUID Fn8000_001F[EAX] - Bit 0
> +  */
> + movl$0x801f, %eax
> + cpuid
> + bt  $0, %eax
> + jnc .Lno_sev
> +
> + /*
> +  * Get memory encryption information:
> +  *   CPUID Fn8000_001F[EBX] - Bits 5:0
> +  * Pagetable bit position used to indicate encryption
> +  */
> + movl%ebx, %eax
> + andl$0x3f, %eax
> + movl%eax, sev_enc_bit(%ebp)
> + jmp .Lsev_exit
> +
> +.Lno_sev:
> + xor %eax, %eax
> +
> +.Lsev_exit:
> + pop %edx
> + pop %ecx
> + pop %ebx
> +
> +#endif   /* CONFIG_AMD_MEM_ENCRYPT */
> +
> + ret
> +ENDPROC(sev_enabled)

Right, as said in another mail earlier, this could be written in C. And
then the sme_enable() piece below looks the same as this one above. So
since you want to run it before kernel decompression and after, you
could extract this code into a separate .c file which you can link in
both places, similar to what we do with verify_cpu with the difference
that verify_cpu is getting included.

Alternatively, we still have some room in setup_header.xloadflags to
pass boot info to kernel proper from before the decompression stage.

But I'd prefer linking with both stages as it is cheaper and those flags
we can use for something which really wants to use a flag like that.

> diff --git a/arch/x86/kernel/mem_encrypt_init.c 
> b/arch/x86/kernel/mem_encrypt_init.c
> index 35c5e3d..5d514e6 100644
> --- a/arch/x86/kernel/mem_encrypt_init.c
> +++ b/arch/x86/kernel/mem_encrypt_init.c
> @@ -22,6 +22,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  static char sme_cmdline_arg_on[] __initdata = "mem_encrypt=on";
>  static char sme_cmdline_arg_off[] __initdata = "mem_encrypt=off";
> @@ -232,6 +233,29 @@ unsigned long __init sme_enable(void *boot_data)
>   void *cmdline_arg;
>   u64 msr;
>  
> + /* Check if running under a hypervisor */
> + eax = 0x4000;
> + ecx = 0;
> + native_cpuid(&eax, &ebx, &ecx, &edx);
> + if (eax > 0x4000) {
> + eax = 0x4001;
> + ecx = 0;
> + native_cpuid(&eax, &ebx, &ecx, &edx);
> + if (!(eax & BIT(KVM_FEATURE_SEV)))
> + goto out;
> +
> + eax = 0x801f;
> + ecx = 0;
> + native_cpuid(&eax, &ebx, &ecx, &edx);
> + if (!(eax & 1))
> + goto out;
> +
> + sme_me_mask = 1UL << (ebx & 0x3f);
> + sev_enabled = 1;
> +
> + goto out;
> + }
> +
>   /* Check for an AMD processor */
>   eax = 0;
>   ecx = 0;
> 

-- 
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 
(AG Nürnberg)
-- 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] Staging: xgifb: XGI_main_26.c: Fix a checkpatch warning

2017-03-09 Thread Manoj Sawai
Fixes a checkpatch warning about use of non-standard C

WARNING: %Lx is non-standard C, use %llx

Signed-off-by: Manoj Sawai 
---
 drivers/staging/xgifb/XGI_main_26.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 9870ea3b76b4..a4930c45dae9 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1643,7 +1643,7 @@ static int xgifb_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
xgifb_info->mmio_base = pci_resource_start(pdev, 1);
xgifb_info->mmio_size = pci_resource_len(pdev, 1);
xgifb_info->vga_base = pci_resource_start(pdev, 2) + 0x30;
-   dev_info(&pdev->dev, "Relocate IO address: %Lx [%08lx]\n",
+   dev_info(&pdev->dev, "Relocate IO address: %llx [%08lx]\n",
 (u64)pci_resource_start(pdev, 2),
 xgifb_info->vga_base);
 
-- 
2.11.0

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


[PATCH 2/2] Staging: xgifb: XGI_main_26.c: non-standard C

2017-03-09 Thread Manoj Sawai
Fixes the following warning:

"WARNING: %Lx is non-standard C, use %llx"

Signed-off-by: Manoj Sawai 
---
 drivers/staging/xgifb/XGI_main_26.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index a4930c45dae9..d938da3e8a1e 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1738,13 +1738,13 @@ static int xgifb_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
xgifb_info->mmio_size);
 
dev_info(&pdev->dev,
-"Framebuffer at 0x%Lx, mapped to 0x%p, size %dk\n",
+"Framebuffer at 0x%llx, mapped to 0x%p, size %dk\n",
 (u64)xgifb_info->video_base,
 xgifb_info->video_vbase,
 xgifb_info->video_size / 1024);
 
dev_info(&pdev->dev,
-"MMIO at 0x%Lx, mapped to 0x%p, size %ldk\n",
+"MMIO at 0x%llx, mapped to 0x%p, size %ldk\n",
 (u64)xgifb_info->mmio_base, xgifb_info->mmio_vbase,
 xgifb_info->mmio_size / 1024);
 
-- 
2.11.0

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


[PATCH] staging: lustre: replace simple_strtoul with kstrtoint

2017-03-09 Thread Marcin Ciupak
Replace simple_strtoul with kstrtoint.
simple_strtoul is marked for obsoletion.

Signed-off-by: Marcin Ciupak 
---
 drivers/staging/lustre/lustre/obdclass/obd_mount.c | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c 
b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
index 8e0d4b1d86dc..4a604e9b3e49 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
@@ -924,12 +924,24 @@ static int lmd_parse(char *options, struct 
lustre_mount_data *lmd)
lmd->lmd_flags |= LMD_FLG_ABORT_RECOV;
clear++;
} else if (strncmp(s1, "recovery_time_soft=", 19) == 0) {
-   lmd->lmd_recovery_time_soft = max_t(int,
-   simple_strtoul(s1 + 19, NULL, 10), time_min);
+   int res;
+
+   rc = kstrtoint(s1 + 19, 10, &res);
+   if (rc)
+   lmd->lmd_recovery_time_soft = time_min;
+   else
+   lmd->lmd_recovery_time_soft = max_t(int, res,
+   time_min);
clear++;
} else if (strncmp(s1, "recovery_time_hard=", 19) == 0) {
-   lmd->lmd_recovery_time_hard = max_t(int,
-   simple_strtoul(s1 + 19, NULL, 10), time_min);
+   int res;
+
+   rc = kstrtoint(s1 + 19, 10, &res);
+   if (rc)
+   lmd->lmd_recovery_time_hard = time_min;
+   else
+   lmd->lmd_recovery_time_hard = max_t(int, res,
+   time_min);
clear++;
} else if (strncmp(s1, "noir", 4) == 0) {
lmd->lmd_flags |= LMD_FLG_NOIR; /* test purpose only. */
-- 
2.11.1

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


Re: [RFC PATCH v2 12/32] x86: Add early boot support when running with SEV active

2017-03-09 Thread Paolo Bonzini


On 09/03/2017 15:07, Borislav Petkov wrote:
> + /* Check if running under a hypervisor */
> + eax = 0x4000;
> + ecx = 0;
> + native_cpuid(&eax, &ebx, &ecx, &edx);

This is not how you check if running under a hypervisor; you should
check the HYPERVISOR bit, i.e. bit 31 of cpuid(1).ecx.  This in turn
tells you if leaf 0x4000 is valid.

That said, the main issue with this function is that it hardcodes the
behavior for KVM.  It is possible that another hypervisor defines its
0x4001 leaf in such a way that KVM_FEATURE_SEV has a different meaning.

Instead, AMD should define a "well-known" bit in its own space (i.e.
0x80xx) that is only used by hypervisors that support SEV.  This is
similar to how Intel defined one bit in leaf 1 to say "is leaf
0x4000 valid".

Thanks,

Paolo

> + if (eax > 0x4000) {
> + eax = 0x4001;
> + ecx = 0;
> + native_cpuid(&eax, &ebx, &ecx, &edx);
> + if (!(eax & BIT(KVM_FEATURE_SEV)))
> + goto out;
> +
> + eax = 0x801f;
> + ecx = 0;
> + native_cpuid(&eax, &ebx, &ecx, &edx);
> + if (!(eax & 1))
> + goto out;
> +
> + sme_me_mask = 1UL << (ebx & 0x3f);
> + sev_enabled = 1;
> +
> + goto out;
> + }
> +
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: removed code in comments.

2017-03-09 Thread Arushi Singhal
Commenting Code Is a Bad Idea.
Comments are their to explain the code and how the code achieves its
goal and as codes in the comments  does not explain what the code is
doing so there is no use of commenting them.
So in this patch codes in the comments are removed.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/ks7010/ks7010_sdio.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 14580cb4c755..df90c20fcb69 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -478,8 +478,6 @@ static void ks7010_rw_function(struct work_struct *work)
/* wiat after WAKEUP */
while (time_after(priv->last_wakeup + ((30 * HZ) / 1000), jiffies)) {
DPRINTK(4, "wait after WAKEUP\n");
-/* 
queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq,
-   (priv->last_wakeup + ((30*HZ)/1000) - jiffies));*/
dev_info(&priv->ks_wlan_hw.sdio_card->func->dev,
 "wake: %lu %lu\n",
 priv->last_wakeup + (30 * HZ) / 1000,
-- 
2.11.0

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


Re: [PATCH 1/6] staging: speakup: Add blank line after function/struct/union/enum declarations

2017-03-09 Thread Greg KH
On Thu, Mar 09, 2017 at 07:33:50PM +0530, Arushi Singhal wrote:
> 
> 
> On Thu, Mar 9, 2017 at 6:55 PM, Greg KH  wrote:
> 
> On Sat, Mar 04, 2017 at 01:47:04AM +0530, Arushi Singhal wrote:
> > This patch fixes the warnings reported by checkpatch.pl
> > for please use a blank line after function/struct/union/enum
> > declarations.
> >
> > Signed-off-by: Arushi Singhal 
> > ---
> >  drivers/staging/speakup/main.c         | 1 +
> >  drivers/staging/speakup/serialio.c     | 1 +
> >  drivers/staging/speakup/speakup_dtlk.c | 1 +
> >  3 files changed, 3 insertions(+)
> 
> You seem to have sent me many different series of patches for this
> driver, some of them the same, some different, some duplicates.  I have
> no idea what to apply and what not to apply, so I'm dropping them all
> from my patch queue.  Please fix up and resend a _single_ patch series
> with your patches so I know what to review and possibly apply.
> 
> Hi Greg
> I think the patch series linked below is not confusing and can be applied.
> 
> https://groups.google.com/forum/#!searchin/outreachy-kernel/arushi|
> sort:relevance/outreachy-kernel/9W_8BejvjwU/reEewnffAwAJ

It's not in my queue at all, all speakup patches are now flushed out, so
if I have not applied it, please resend.

thanks,

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


Re: [patch 0/3] speakup: support 16bit unicode screen reading

2017-03-09 Thread Greg Kroah-Hartman
On Sat, Mar 04, 2017 at 03:01:54PM +0100, Samuel Thibault wrote:
> Hello,
> 
> This patch series adds 16bit unicode support to speakup, through three
> patches:
> 
> - extend synth buffer to 16bit unicode characters
> - convert screen reading to 16bit characters
> - add unicode variant of /dev/softsynth

This is the second version of this series, correct?  Next time, please
put a "v2" in them so that I know which to apply.

thanks,

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


Re: [RFC PATCH v2 12/32] x86: Add early boot support when running with SEV active

2017-03-09 Thread Borislav Petkov
On Thu, Mar 09, 2017 at 05:13:33PM +0100, Paolo Bonzini wrote:
> This is not how you check if running under a hypervisor; you should
> check the HYPERVISOR bit, i.e. bit 31 of cpuid(1).ecx.  This in turn
> tells you if leaf 0x4000 is valid.

Ah, good point, I already do that in the microcode loader :)

/*
 * CPUID(1).ECX[31]: reserved for hypervisor use. This is still not
 * completely accurate as xen pv guests don't see that CPUID bit set but
 * that's good enough as they don't land on the BSP path anyway.
 */
if (native_cpuid_ecx(1) & BIT(31))
return *res;

> That said, the main issue with this function is that it hardcodes the
> behavior for KVM.  It is possible that another hypervisor defines its
> 0x4001 leaf in such a way that KVM_FEATURE_SEV has a different meaning.
> 
> Instead, AMD should define a "well-known" bit in its own space (i.e.
> 0x80xx) that is only used by hypervisors that support SEV.  This is
> similar to how Intel defined one bit in leaf 1 to say "is leaf
> 0x4000 valid".
> 
> > +   if (eax > 0x4000) {
> > +   eax = 0x4001;
> > +   ecx = 0;
> > +   native_cpuid(&eax, &ebx, &ecx, &edx);
> > +   if (!(eax & BIT(KVM_FEATURE_SEV)))
> > +   goto out;
> > +
> > +   eax = 0x801f;
> > +   ecx = 0;
> > +   native_cpuid(&eax, &ebx, &ecx, &edx);
> > +   if (!(eax & 1))

Right, so this is testing CPUID_0x801f_ECX(0)[0], SME. Why not
simply set that bit for the guest too, in kvm?

-- 
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 
(AG Nürnberg)
-- 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch 0/3] speakup: support 16bit unicode screen reading

2017-03-09 Thread Samuel Thibault
Greg KH, on jeu. 09 mars 2017 17:25:51 +0100, wrote:
> This is the second version of this series, correct?  Next time, please
> put a "v2" in them so that I know which to apply.

Ah, yes, sorry. The only difference was the Reviewed-by lines.

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


[PATCH 0/4] staging: speakup: checkpatch guided cleanups

2017-03-09 Thread Arushi Singhal
Improve readability by fixing multiple checkpatch.pl
issues in speakup driver. 

Arushi Singhal (4):
  staging: speakup: Comparison to NULL could be written
  staging: speakup:indentation should use tabs
  staging: speakup: Alignment match open parenthesis
  staging: speakup: Placed Logical on the previous line

 drivers/staging/speakup/fakekey.c  |  2 +-
 drivers/staging/speakup/i18n.c |  4 ++--
 drivers/staging/speakup/kobjects.c | 42 +-
 drivers/staging/speakup/main.c | 46 +++---
 4 files changed, 47 insertions(+), 47 deletions(-)

-- 
2.11.0

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


[PATCH 1/4] staging: speakup: Comparison to NULL could be written

2017-03-09 Thread Arushi Singhal
Fixed coding style for null comparisons in speakup driver to be more
consistant with the rest of the kernel coding style.

Signed-off-by: Arushi Singhal 
---
 changes in v2
 - fixed coding style error and upto the coding style.
---
 drivers/staging/speakup/fakekey.c  |  2 +-
 drivers/staging/speakup/kobjects.c |  2 +-
 drivers/staging/speakup/main.c | 38 +++---
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/speakup/fakekey.c 
b/drivers/staging/speakup/fakekey.c
index d76da0a1382c..294c74b47224 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -56,7 +56,7 @@ int speakup_add_virtual_keyboard(void)
 
 void speakup_remove_virtual_keyboard(void)
 {
-   if (virt_keyboard != NULL) {
+   if (virt_keyboard) {
input_unregister_device(virt_keyboard);
virt_keyboard = NULL;
}
diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index 5d871ec3693c..2fef55569bfd 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -391,7 +391,7 @@ static ssize_t synth_store(struct kobject *kobj, struct 
kobj_attribute *attr,
len--;
new_synth_name[len] = '\0';
spk_strlwr(new_synth_name);
-   if ((synth != NULL) && (!strcmp(new_synth_name, synth->name))) {
+   if (synth && !strcmp(new_synth_name, synth->name)) {
pr_warn("%s already in use\n", new_synth_name);
} else if (synth_init(new_synth_name) != 0) {
pr_warn("failed to init synth %s\n", new_synth_name);
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index c2f70ef5b9b3..a12ec2b061fe 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -299,7 +299,7 @@ static void speakup_shut_up(struct vc_data *vc)
spk_shut_up |= 0x01;
spk_parked &= 0xfe;
speakup_date(vc);
-   if (synth != NULL)
+   if (synth)
spk_do_flush();
 }
 
@@ -441,7 +441,7 @@ static void speak_char(u_char ch)
synth_printf("%s", spk_str_caps_stop);
return;
}
-   if (cp == NULL) {
+   if (!cp) {
pr_info("speak_char: cp == NULL!\n");
return;
}
@@ -1157,7 +1157,7 @@ static void do_handle_shift(struct vc_data *vc, u_char 
value, char up_flag)
 {
unsigned long flags;
 
-   if (synth == NULL || up_flag || spk_killed)
+   if (!synth || up_flag || spk_killed)
return;
spin_lock_irqsave(&speakup_info.spinlock, flags);
if (cursor_track == read_all_mode) {
@@ -1195,7 +1195,7 @@ static void do_handle_latin(struct vc_data *vc, u_char 
value, char up_flag)
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return;
}
-   if (synth == NULL || spk_killed) {
+   if (!synth || spk_killed) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return;
}
@@ -1279,7 +1279,7 @@ void spk_reset_default_chars(void)
 
/* First, free any non-default */
for (i = 0; i < 256; i++) {
-   if ((spk_characters[i] != NULL)
+   if (spk_characters[i]
&& (spk_characters[i] != spk_default_chars[i]))
kfree(spk_characters[i]);
}
@@ -1321,10 +1321,10 @@ static int speakup_allocate(struct vc_data *vc)
int vc_num;
 
vc_num = vc->vc_num;
-   if (speakup_console[vc_num] == NULL) {
+   if (!speakup_console[vc_num]) {
speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]),
  GFP_ATOMIC);
-   if (speakup_console[vc_num] == NULL)
+   if (!speakup_console[vc_num])
return -ENOMEM;
speakup_date(vc);
} else if (!spk_parked)
@@ -1373,7 +1373,7 @@ static void kbd_fakekey2(struct vc_data *vc, int command)
 
 static void read_all_doc(struct vc_data *vc)
 {
-   if ((vc->vc_num != fg_console) || synth == NULL || spk_shut_up)
+   if ((vc->vc_num != fg_console) || !synth || spk_shut_up)
return;
if (!synth_supports_indexing())
return;
@@ -1487,7 +1487,7 @@ static int pre_handle_cursor(struct vc_data *vc, u_char 
value, char up_flag)
spin_lock_irqsave(&speakup_info.spinlock, flags);
if (cursor_track == read_all_mode) {
spk_parked &= 0xfe;
-   if (synth == NULL || up_flag || spk_shut_up) {
+   if (!synth || up_flag || spk_shut_up) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return NOTIFY_STOP;
}
@@ -1509,7 +1509,7 @@ static void do_handle_cursor(struct vc_data *vc, u_char 
value, char up_flag)
 
spin_lock_irqsa

[PATCH 2/4] staging: speakup:indentation should use tabs

2017-03-09 Thread Arushi Singhal
Indentation should always use tabs and never spaces.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/i18n.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
index 1a3e34880ac1..11f1418b4006 100644
--- a/drivers/staging/speakup/i18n.c
+++ b/drivers/staging/speakup/i18n.c
@@ -552,7 +552,7 @@ ssize_t spk_msg_set(enum msg_index_t index, char *text, 
size_t length)
if (index >= MSG_FORMATTED_START &&
index <= MSG_FORMATTED_END &&
!fmt_validate(speakup_default_msgs[index],
- newstr)) {
+ newstr)) {
kfree(newstr);
return -EINVAL;
}
-- 
2.11.0

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


[PATCH 3/4] staging: speakup: Alignment match open parenthesis

2017-03-09 Thread Arushi Singhal
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".

Signed-off-by: Arushi Singhal 
---
 changes in v2
 - Aligned the lines which are not aligned in previous patch.
---
 drivers/staging/speakup/i18n.c |  2 +-
 drivers/staging/speakup/kobjects.c | 40 +++---
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
index 11f1418b4006..ac1ebead3c3f 100644
--- a/drivers/staging/speakup/i18n.c
+++ b/drivers/staging/speakup/i18n.c
@@ -607,7 +607,7 @@ void spk_reset_msg_group(struct msg_group_t *group)
 void spk_initialize_msgs(void)
 {
memcpy(speakup_msgs, speakup_default_msgs,
-   sizeof(speakup_default_msgs));
+  sizeof(speakup_default_msgs));
 }
 
 /* Free user-supplied strings when module is unloaded: */
diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index 2fef55569bfd..8c93188b832c 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -79,7 +79,7 @@ static ssize_t chars_chartab_show(struct kobject *kobj,
  * character descriptions or chartab entries.
  */
 static void report_char_chartab_status(int reset, int received, int used,
-   int rejected, int do_characters)
+   int rejected, int do_characters)
 {
static char const *object_type[] = {
"character class entries",
@@ -92,8 +92,8 @@ static void report_char_chartab_status(int reset, int 
received, int used,
pr_info("%s reset to defaults\n", object_type[do_characters]);
} else if (received) {
len = snprintf(buf, sizeof(buf),
-   " updated %d of %d %s\n",
-   used, received, object_type[do_characters]);
+  " updated %d of %d %s\n",
+  used, received, object_type[do_characters]);
if (rejected)
snprintf(buf + (len - 1), sizeof(buf) - (len - 1),
 " with %d reject%s\n",
@@ -213,7 +213,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
 
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
report_char_chartab_status(reset, received, used, rejected,
-   do_characters);
+  do_characters);
return retval;
 }
 
@@ -221,7 +221,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
  * This is called when a user reads the keymap parameter.
  */
 static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr,
-   char *buf)
+   char *buf)
 {
char *cp = buf;
int i;
@@ -257,7 +257,7 @@ static ssize_t keymap_show(struct kobject *kobj, struct 
kobj_attribute *attr,
  * This is called when a user changes the keymap parameter.
  */
 static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
-   const char *buf, size_t count)
+const char *buf, size_t count)
 {
int i;
ssize_t ret = count;
@@ -291,9 +291,9 @@ static ssize_t keymap_store(struct kobject *kobj, struct 
kobj_attribute *attr,
i *= (int)cp1[-1] + 1;
i += 2; /* 0 and last map ver */
if (cp1[-3] != KEY_MAP_VER || cp1[-1] > 10 ||
-   i + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) {
+   i + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) {
pr_warn("i %d %d %d %d\n", i,
-   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
+   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
kfree(in_buff);
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return -EINVAL;
@@ -307,7 +307,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct 
kobj_attribute *attr,
if (i != 0 || cp1[-1] != KEY_MAP_VER || cp1[-2] != 0) {
ret = -EINVAL;
pr_warn("end %d %d %d %d\n", i,
-   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
+   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
} else {
if (spk_set_key_info(in_buff, spk_key_buf)) {
spk_set_key_info(spk_key_defaults, spk_key_buf);
@@ -324,7 +324,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct 
kobj_attribute *attr,
  * This is called when a user changes the value of the silent parameter.
  */
 static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr,
-   const char *buf, size_t count)
+const char *buf, size_t count)
 {
int len;
struct vc_data *vc = vc_cons[fg_console].d;
@@ -363,7 +363,7 @@ static ssize_t silent_store(struct kobject *kobj, struct 
kobj_attribute *attr,
  * This is called when a user reads the synth se

[PATCH 4/4] staging: speakup: Placed Logical on the previous line

2017-03-09 Thread Arushi Singhal
Placed Logical continuations on the previous line as reported by
checkpatch.pl.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/main.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index a12ec2b061fe..25acebb9311f 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2144,10 +2144,10 @@ speakup_key(struct vc_data *vc, int shift_state, int 
keycode, u_short keysym,
if (up_flag || spk_killed || type == KT_SHIFT)
goto out;
spk_shut_up &= 0xfe;
-   kh = (value == KVAL(K_DOWN))
-   || (value == KVAL(K_UP))
-   || (value == KVAL(K_LEFT))
-   || (value == KVAL(K_RIGHT));
+   kh = (value == KVAL(K_DOWN)) ||
+ (value == KVAL(K_UP))  ||
+ (value == KVAL(K_LEFT)) ||
+ (value == KVAL(K_RIGHT));
if ((cursor_track != read_all_mode) || !kh)
if (!spk_no_intr)
spk_do_flush();
-- 
2.11.0

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


Re: [PATCH] Staging: fbtft: fbtft-bus.c: checkpatch error

2017-03-09 Thread Greg KH
On Thu, Mar 09, 2017 at 12:59:57AM +0530, Manoj Sawai wrote:
> Fixes a checkpatch error.
> 
> "ERROR: space prohibited before that close parenthesis ')'"
> 
> Signed-off-by: Manoj Sawai 
> ---
>  drivers/staging/fbtft/fbtft-bus.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft-bus.c 
> b/drivers/staging/fbtft/fbtft-bus.c
> index ec45043c0830..34a7f3aa2c2e 100644
> --- a/drivers/staging/fbtft/fbtft-bus.c
> +++ b/drivers/staging/fbtft/fbtft-bus.c
> @@ -68,9 +68,9 @@ void func(struct fbtft_par *par, int len, ...)  
>   \
>  }
>  \
>  EXPORT_SYMBOL(func);
>  
> -define_fbtft_write_reg(fbtft_write_reg8_bus8, u8, )
> +define_fbtft_write_reg(fbtft_write_reg8_bus8, u8)

Why did you modify this file to break the build???

This doesn't fix anything, you must ALWAYS test build your changes
otherwise you end up with a very grumpy maintainer who knows you didn't
even take the basic time to test your modification.

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


Re: [PATCH 1/7] staging: media: Remove unnecessary typecast of c90 int constant

2017-03-09 Thread Greg KH
On Fri, Mar 03, 2017 at 01:21:56AM +0530, simran singhal wrote:
> This patch removes unnecessary typecast of c90 int constant.
> 
> WARNING: Unnecessary typecast of c90 int constant
> 
> Signed-off-by: simran singhal 
> ---
>  drivers/staging/media/atomisp/i2c/gc2235.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

The subject needs to say which driver is being touched here.  So this
would be:
 [PATCH 1/7] staging: gc2235: Remove unnecessary typecast of c90 int 
constant

Please fix up for all of these and resend.

thanks,

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


Re: [PATCH 1/2] staging: media: Clean up tests if NULL returned on failure

2017-03-09 Thread Greg KH
On Sat, Mar 04, 2017 at 12:25:18AM +0530, simran singhal wrote:
> Some functions like kmalloc/kzalloc return NULL on failure.
> When NULL represents failure, !x is commonly used.
> 
> This was done using Coccinelle:
> @@
> expression *e;
> identifier l1;
> @@
> 
> e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
> ...
> - e == NULL
> + !e
> 
> Signed-off-by: simran singhal 
> ---
>  drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c | 2 +-
>  drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c  | 4 ++--
>  drivers/staging/media/lirc/lirc_zilog.c   | 6 +++---
>  3 files changed, 6 insertions(+), 6 deletions(-)

Please break this up into one patch per driver.

thanks,

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


Re: [PATCH] staging: media: Remove parentheses from return arguments

2017-03-09 Thread Greg KH
On Fri, Mar 03, 2017 at 10:31:39PM +0530, simran singhal wrote:
> The sematic patch used for this is:
> @@
> identifier i;
> constant c;
> @@
> return
> - (
> \(i\|-i\|i(...)\|c\)
> - )
>   ;
> 
> Signed-off-by: simran singhal 
> Acked-by: Julia Lawall 
> ---
>  .../media/atomisp/pci/atomisp2/css2400/sh_css.c  | 20 
> ++--
>  .../atomisp/pci/atomisp2/css2400/sh_css_firmware.c   |  2 +-
>  2 files changed, 11 insertions(+), 11 deletions(-)

Again, one patch per driver.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: speakup: fix "Alignment match open parenthesis"

2017-03-09 Thread Arushi Singhal
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/i18n.c |  2 +-
 drivers/staging/speakup/kobjects.c | 40 +++---
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
index 11f1418b4006..ac1ebead3c3f 100644
--- a/drivers/staging/speakup/i18n.c
+++ b/drivers/staging/speakup/i18n.c
@@ -607,7 +607,7 @@ void spk_reset_msg_group(struct msg_group_t *group)
 void spk_initialize_msgs(void)
 {
memcpy(speakup_msgs, speakup_default_msgs,
-   sizeof(speakup_default_msgs));
+  sizeof(speakup_default_msgs));
 }
 
 /* Free user-supplied strings when module is unloaded: */
diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index 2fef55569bfd..8c93188b832c 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -79,7 +79,7 @@ static ssize_t chars_chartab_show(struct kobject *kobj,
  * character descriptions or chartab entries.
  */
 static void report_char_chartab_status(int reset, int received, int used,
-   int rejected, int do_characters)
+   int rejected, int do_characters)
 {
static char const *object_type[] = {
"character class entries",
@@ -92,8 +92,8 @@ static void report_char_chartab_status(int reset, int 
received, int used,
pr_info("%s reset to defaults\n", object_type[do_characters]);
} else if (received) {
len = snprintf(buf, sizeof(buf),
-   " updated %d of %d %s\n",
-   used, received, object_type[do_characters]);
+  " updated %d of %d %s\n",
+  used, received, object_type[do_characters]);
if (rejected)
snprintf(buf + (len - 1), sizeof(buf) - (len - 1),
 " with %d reject%s\n",
@@ -213,7 +213,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
 
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
report_char_chartab_status(reset, received, used, rejected,
-   do_characters);
+  do_characters);
return retval;
 }
 
@@ -221,7 +221,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
  * This is called when a user reads the keymap parameter.
  */
 static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr,
-   char *buf)
+   char *buf)
 {
char *cp = buf;
int i;
@@ -257,7 +257,7 @@ static ssize_t keymap_show(struct kobject *kobj, struct 
kobj_attribute *attr,
  * This is called when a user changes the keymap parameter.
  */
 static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
-   const char *buf, size_t count)
+const char *buf, size_t count)
 {
int i;
ssize_t ret = count;
@@ -291,9 +291,9 @@ static ssize_t keymap_store(struct kobject *kobj, struct 
kobj_attribute *attr,
i *= (int)cp1[-1] + 1;
i += 2; /* 0 and last map ver */
if (cp1[-3] != KEY_MAP_VER || cp1[-1] > 10 ||
-   i + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) {
+   i + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) {
pr_warn("i %d %d %d %d\n", i,
-   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
+   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
kfree(in_buff);
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return -EINVAL;
@@ -307,7 +307,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct 
kobj_attribute *attr,
if (i != 0 || cp1[-1] != KEY_MAP_VER || cp1[-2] != 0) {
ret = -EINVAL;
pr_warn("end %d %d %d %d\n", i,
-   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
+   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
} else {
if (spk_set_key_info(in_buff, spk_key_buf)) {
spk_set_key_info(spk_key_defaults, spk_key_buf);
@@ -324,7 +324,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct 
kobj_attribute *attr,
  * This is called when a user changes the value of the silent parameter.
  */
 static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr,
-   const char *buf, size_t count)
+const char *buf, size_t count)
 {
int len;
struct vc_data *vc = vc_cons[fg_console].d;
@@ -363,7 +363,7 @@ static ssize_t silent_store(struct kobject *kobj, struct 
kobj_attribute *attr,
  * This is called when a user reads the synth setting.
  */
 static ssize_t synth_show(struct kobject *kobj, struct kobj_attribut

Re: [PATCH] staging: vt6655: Fixed some coding style issues

2017-03-09 Thread Greg KH
On Sat, Mar 04, 2017 at 07:46:04PM +, Tuomo Rinne wrote:
> Copied function argument names from definition to delcaration. This
> fixes some checkpatch warnings.

Which warning did it fix?  Please always be specific here, and in the
subject line.

thanks,

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


Re: [PATCH] staging: rtl8192u: fix spacing around if statements

2017-03-09 Thread Greg Kroah-Hartman
On Thu, Mar 02, 2017 at 11:16:23PM +0100, Robin Krahl wrote:
> Corrects the spacing around two if statements to fix these checkpatch.pl
> errors:
> 
> ERROR: space required before the open brace '{'
> ERROR: space prohibited after that open parenthesis '('
> 
> Signed-off-by: Robin Krahl 
> ---
>  drivers/staging/rtl8192u/r8192U_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Someone else did this same change right before you did, sorry :(

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


Re: [RFC PATCH 00/12] Ion cleanup in preparation for moving out of staging

2017-03-09 Thread Laura Abbott
On 03/09/2017 02:00 AM, Benjamin Gaignard wrote:
> 2017-03-06 17:04 GMT+01:00 Daniel Vetter :
>> On Mon, Mar 06, 2017 at 11:58:05AM +0100, Mark Brown wrote:
>>> On Mon, Mar 06, 2017 at 11:40:41AM +0100, Daniel Vetter wrote:
>>>
 No one gave a thing about android in upstream, so Greg KH just dumped it
 all into staging/android/. We've discussed ION a bunch of times, recorded
 anything we'd like to fix in staging/android/TODO, and Laura's patch
 series here addresses a big chunk of that.
>>>
 This is pretty much the same approach we (gpu folks) used to de-stage the
 syncpt stuff.
>>>
>>> Well, there's also the fact that quite a few people have issues with the
>>> design (like Laurent).  It seems like a lot of them have either got more
>>> comfortable with it over time, or at least not managed to come up with
>>> any better ideas in the meantime.
>>
>> See the TODO, it has everything a really big group (look at the patch for
>> the full Cc: list) figured needs to be improved at LPC 2015. We don't just
>> merge stuff because merging stuff is fun :-)
>>
>> Laurent was even in that group ...
>> -Daniel
> 
> For me those patches are going in the right direction.
> 
> I still have few questions:
> - since alignment management has been remove from ion-core, should it
> be also removed from ioctl structure ?

Yes, I think I'm going to go with the suggestion to fixup the ABI
so we don't need the compat layer and as part of that I'm also
dropping the align argument.

> - can you we ride off ion_handle (at least in userland) and only
> export a dma-buf descriptor ?

Yes, I think this is the right direction given we're breaking
everything anyway. I was debating trying to keep the two but
moving to only dma bufs is probably cleaner. The only reason
I could see for keeping the handles is running out of file
descriptors for dma-bufs but that seems unlikely.
> 
> In the future how can we add new heaps ?
> Some platforms have very specific memory allocation
> requirements (just have a look in the number of gem custom allocator in drm)
> Do you plan to add heap type/mask for each ?

Yes, that was my thinking. 

> 
> Benjamin
> 

Thanks,
Laura

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


[PATCH] staging: speakup: Simplify NULL comparisons

2017-03-09 Thread Arushi Singhal
Fixed coding style for null comparisons in speakup driver to be more
consistant with the rest of the kernel coding style.
Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/fakekey.c  |  2 +-
 drivers/staging/speakup/kobjects.c |  2 +-
 drivers/staging/speakup/main.c | 38 +++---
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/speakup/fakekey.c 
b/drivers/staging/speakup/fakekey.c
index d76da0a1382c..294c74b47224 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -56,7 +56,7 @@ int speakup_add_virtual_keyboard(void)
 
 void speakup_remove_virtual_keyboard(void)
 {
-   if (virt_keyboard != NULL) {
+   if (virt_keyboard) {
input_unregister_device(virt_keyboard);
virt_keyboard = NULL;
}
diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index 5d871ec3693c..2fef55569bfd 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -391,7 +391,7 @@ static ssize_t synth_store(struct kobject *kobj, struct 
kobj_attribute *attr,
len--;
new_synth_name[len] = '\0';
spk_strlwr(new_synth_name);
-   if ((synth != NULL) && (!strcmp(new_synth_name, synth->name))) {
+   if (synth && !strcmp(new_synth_name, synth->name)) {
pr_warn("%s already in use\n", new_synth_name);
} else if (synth_init(new_synth_name) != 0) {
pr_warn("failed to init synth %s\n", new_synth_name);
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index c2f70ef5b9b3..a12ec2b061fe 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -299,7 +299,7 @@ static void speakup_shut_up(struct vc_data *vc)
spk_shut_up |= 0x01;
spk_parked &= 0xfe;
speakup_date(vc);
-   if (synth != NULL)
+   if (synth)
spk_do_flush();
 }
 
@@ -441,7 +441,7 @@ static void speak_char(u_char ch)
synth_printf("%s", spk_str_caps_stop);
return;
}
-   if (cp == NULL) {
+   if (!cp) {
pr_info("speak_char: cp == NULL!\n");
return;
}
@@ -1157,7 +1157,7 @@ static void do_handle_shift(struct vc_data *vc, u_char 
value, char up_flag)
 {
unsigned long flags;
 
-   if (synth == NULL || up_flag || spk_killed)
+   if (!synth || up_flag || spk_killed)
return;
spin_lock_irqsave(&speakup_info.spinlock, flags);
if (cursor_track == read_all_mode) {
@@ -1195,7 +1195,7 @@ static void do_handle_latin(struct vc_data *vc, u_char 
value, char up_flag)
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return;
}
-   if (synth == NULL || spk_killed) {
+   if (!synth || spk_killed) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return;
}
@@ -1279,7 +1279,7 @@ void spk_reset_default_chars(void)
 
/* First, free any non-default */
for (i = 0; i < 256; i++) {
-   if ((spk_characters[i] != NULL)
+   if (spk_characters[i]
&& (spk_characters[i] != spk_default_chars[i]))
kfree(spk_characters[i]);
}
@@ -1321,10 +1321,10 @@ static int speakup_allocate(struct vc_data *vc)
int vc_num;
 
vc_num = vc->vc_num;
-   if (speakup_console[vc_num] == NULL) {
+   if (!speakup_console[vc_num]) {
speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]),
  GFP_ATOMIC);
-   if (speakup_console[vc_num] == NULL)
+   if (!speakup_console[vc_num])
return -ENOMEM;
speakup_date(vc);
} else if (!spk_parked)
@@ -1373,7 +1373,7 @@ static void kbd_fakekey2(struct vc_data *vc, int command)
 
 static void read_all_doc(struct vc_data *vc)
 {
-   if ((vc->vc_num != fg_console) || synth == NULL || spk_shut_up)
+   if ((vc->vc_num != fg_console) || !synth || spk_shut_up)
return;
if (!synth_supports_indexing())
return;
@@ -1487,7 +1487,7 @@ static int pre_handle_cursor(struct vc_data *vc, u_char 
value, char up_flag)
spin_lock_irqsave(&speakup_info.spinlock, flags);
if (cursor_track == read_all_mode) {
spk_parked &= 0xfe;
-   if (synth == NULL || up_flag || spk_shut_up) {
+   if (!synth || up_flag || spk_shut_up) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return NOTIFY_STOP;
}
@@ -1509,7 +1509,7 @@ static void do_handle_cursor(struct vc_data *vc, u_char 
value, char up_flag)
 
spin_lock_irqsave(&speakup_info.s

Re: [PATCH] Staging: fbtft: fbtft-bus.c: checkpatch error

2017-03-09 Thread kbuild test robot
Hi Manoj,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.11-rc1 next-20170309]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Manoj-Sawai/Staging-fbtft-fbtft-bus-c-checkpatch-error/20170310-013736
config: i386-randconfig-x074-201710 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All error/warnings (new ones prefixed by >>):

>> drivers/staging/fbtft/fbtft-bus.c:71:49: error: macro 
>> "define_fbtft_write_reg" requires 3 arguments, but only 2 given
define_fbtft_write_reg(fbtft_write_reg8_bus8, u8)
^
>> drivers/staging/fbtft/fbtft-bus.c:14:1: error: expected '=', ',', ';', 'asm' 
>> or '__attribute__' before 'void'
void func(struct fbtft_par *par, int len, ...)  
  \
^
>> drivers/staging/fbtft/fbtft-bus.c:72:1: note: in expansion of macro 
>> 'define_fbtft_write_reg'
define_fbtft_write_reg(fbtft_write_reg16_bus8, u16, cpu_to_be16)
^~
   drivers/staging/fbtft/fbtft-bus.c:73:52: error: macro 
"define_fbtft_write_reg" requires 3 arguments, but only 2 given
define_fbtft_write_reg(fbtft_write_reg16_bus16, u16)
   ^
   drivers/staging/fbtft/fbtft-bus.c:75:1: error: expected '=', ',', ';', 'asm' 
or '__attribute__' before 'void'
void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
^~~~

vim +/define_fbtft_write_reg +71 drivers/staging/fbtft/fbtft-bus.c

 8   *
 9   *   void (*write_reg)(struct fbtft_par *par, int len, ...);
10   *
11   
*/
12  
13  #define define_fbtft_write_reg(func, type, modifier)
  \
  > 14  void func(struct fbtft_par *par, int len, ...)  
  \
15  {   
  \
16  va_list args;   
  \
17  int i, ret; 
  \
18  int offset = 0; 
  \
19  type *buf = (type *)par->buf;   
  \
20  
  \
21  if (unlikely(par->debug & DEBUG_WRITE_REGISTER)) {  
  \
22  va_start(args, len);
  \
23  for (i = 0; i < len; i++) { 
  \
24  buf[i] = (type)va_arg(args, unsigned int);  
  \
25  }   
  \
26  va_end(args);   
  \
27  fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par, 
par->info->device, type, buf, len, "%s: ", __func__);   \
28  }   
  \
29  
  \
30  va_start(args, len);
  \
31  
  \
32  if (par->startbyte) {   
  \
33  *(u8 *)par->buf = par->startbyte;   
  \
34  buf = (type *)(par->buf + 1);   
  \
35  offset = 1; 
  \
36  }   
  \
37  
  \
38  *buf = modifier((type)va_arg(args, unsigned int));  
  \
39  if (par->gpio.dc != -1) 
  \
40  gpio_set_value(par->gpio.dc, 0);
  \
41  ret = par->fbtftops.write(par, par->buf, sizeof(type) + 
offset);  \
42  if (ret < 0) {  
  \
43  va_end(args);   
  \
44  dev_err(par->inf

Re: [PATCH 1/2] Staging: wlan-ng: Fix sparse warnings by using appropriate endian types

2017-03-09 Thread Greg KH
On Fri, Mar 03, 2017 at 07:58:30PM +0100, Adrien Descamps wrote:
> Fix some sparse warning by using correct endian types in structs and
> local variables.
> This patch only fix sparse warnings and do not change the logic.
> 
> Signed-off-by: Adrien Descamps 
> ---
> Compile tested only
>  drivers/staging/wlan-ng/hfa384x.h | 58 
> +--
>  drivers/staging/wlan-ng/hfa384x_usb.c |  2 +-
>  drivers/staging/wlan-ng/p80211conv.h  | 28 -
>  3 files changed, 44 insertions(+), 44 deletions(-)

Patch does not apply to my staging-next branch.  Can you rebase it and
resend?

thanks,

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


Re: [PATCH 0/4] staging: speakup: checkpatch guided cleanups

2017-03-09 Thread Greg KH
On Thu, Mar 09, 2017 at 10:04:29PM +0530, Arushi Singhal wrote:
> Improve readability by fixing multiple checkpatch.pl
> issues in speakup driver. 

This series does not apply to my staging-testing branch at all.  Please
rebase and resend.

thanks,

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


Re: [PATCH] staging: speakup: fix "Alignment match open parenthesis"

2017-03-09 Thread Greg Kroah-Hartman
On Thu, Mar 09, 2017 at 10:23:30PM +0530, Arushi Singhal wrote:
> Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".
> 
> Signed-off-by: Arushi Singhal 
> ---
>  drivers/staging/speakup/i18n.c |  2 +-
>  drivers/staging/speakup/kobjects.c | 40 
> +++---
>  2 files changed, 21 insertions(+), 21 deletions(-)

Also does not apply to my tree :(

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


Re: [PATCH] staging: speakup: Simplify NULL comparisons

2017-03-09 Thread Greg Kroah-Hartman
On Thu, Mar 09, 2017 at 11:19:49PM +0530, Arushi Singhal wrote:
> Fixed coding style for null comparisons in speakup driver to be more
> consistant with the rest of the kernel coding style.
> Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'.
> 
> Signed-off-by: Arushi Singhal 
> ---
>  drivers/staging/speakup/fakekey.c  |  2 +-
>  drivers/staging/speakup/kobjects.c |  2 +-
>  drivers/staging/speakup/main.c | 38 
> +++---
>  3 files changed, 21 insertions(+), 21 deletions(-)

Also does not apply :(

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


Re: [PATCH 1/2] Staging: xgifb: XGI_main_26.c: Fix a checkpatch warning

2017-03-09 Thread Greg KH
On Thu, Mar 09, 2017 at 07:59:52PM +0530, Manoj Sawai wrote:
> Fixes a checkpatch warning about use of non-standard C
> 
> WARNING: %Lx is non-standard C, use %llx
> 
> Signed-off-by: Manoj Sawai 
> ---
>  drivers/staging/xgifb/XGI_main_26.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Why is this two different patches?  You are doing the same thing in both
of them, please just make this one single patch.

thanks,

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


Re: [PATCH] staging: rtl8192e: fix coding style issue, improve error handling

2017-03-09 Thread kbuild test robot
Hi Suniel,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.11-rc1 next-20170309]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Suniel-Mahesh/staging-rtl8192e-fix-coding-style-issue-improve-error-handling/20170310-015706
config: i386-randconfig-x076-201710 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: In function 
'rtl92e_set_rf_state':
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:220:13: error: 
>> 'WLAN_REASON_DISASSOC_STA_' undeclared (first use in this function)
WLAN_REASON_DISASSOC_STA_
^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:220:13: note: each undeclared 
identifier is reported only once for each function it appears in
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:221:9: error: expected ')' 
>> before 'HAS_LEFT'
HAS_LEFT);
^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: In function 
'_rtl92e_init_priv_variable':
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:970:10: warning: 'return' with 
>> a value, in function returning void
  return -ENOMEM;
 ^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:888:13: note: declared here
static void _rtl92e_init_priv_variable(struct net_device *dev)
^~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: In function 
'_rtl92e_if_silent_reset':
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:24: warning: missing 
>> terminating " character
  RT_TRACE(COMP_RESET, "%s():==>start to down the
   ^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1248:13: warning: missing 
terminating " character
driver\n",  __func__);
^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1251:5: warning: missing 
terminating " character
"%s():==>start to down the
^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1252:13: warning: missing 
terminating " character
driver\n",  __func__);
^
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2751:0: error: unterminated 
>> argument list invoking macro "RT_TRACE"
MODULE_PARM_DESC(channels, " Channel bitmask for specific locales. NYI");

>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: 'RT_TRACE' 
>> undeclared (first use in this function)
  RT_TRACE(COMP_RESET, "%s():==>start to down the
  ^~~~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: expected ';' at 
>> end of input
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: expected 
>> declaration or statement at end of input
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: expected 
>> declaration or statement at end of input
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1232:1: warning: label 
'RESET_START' defined but not used [-Wunused-label]
RESET_START:
^~~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1226:4: error: label 'END' used 
>> but not defined
   goto END;
   ^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1217:24: warning: unused 
variable 'ieee' [-Wunused-variable]
 struct rtllib_device *ieee = priv->rtllib;
   ^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1216:6: warning: unused 
variable 'reset_status' [-Wunused-variable]
 int reset_status = 0;
 ^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1215:5: warning: unused 
variable 'reset_times' [-Wunused-variable]
 u8 reset_times = 0;
^~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: At top level:
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:71:12: warning: 
>> '_rtl92e_pci_probe' used but never defined
static int _rtl92e_pci_probe(struct pci_dev *pdev,
   ^
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:73:13: warning: 
>> '_rtl92e_pci_disconnect' used but never defined
static void _rtl92e_pci_disconnect(struct pci_dev *pdev);
^~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:74:20: warning: '_rtl92e_irq' 
>> used but never defined
static irqreturn_t _rtl92e_irq(int irq, void *netdev);

[PATCH v2 0/5] staging: rtl8192e: Fix coding style, warnings and checks

2017-03-09 Thread sunil . m
From: Suniel Mahesh 

Fixed coding style issues and improved error handling, return -ENOMEM, if 
it is out of memory instead of err message. Pointer comparisions with NUll 
are replaced by logical NOT. Fixed unbalanced braces around else statement
and preferred to pass a pointer as an argument to sizeof() instead of
struct definition.

Rebased on top of next-20170306.

Suniel Mahesh (5):
  staging: rtl8192e: Fix coding style issues
  staging: rtl8192e: Improve error handling
  staging: rtl8192e: Rectify pointer comparisions
  staging: rtl8192e: Fix unbalanced braces around else statement
  staging: rtl8192e: Pass a pointer as an argument to sizeof() instead
of struct

 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 274 +++
 1 file changed, 112 insertions(+), 162 deletions(-)

-- 
1.9.1

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


[PATCH v2 4/5] staging: rtl8192e: Fix unbalanced braces around else statement

2017-03-09 Thread sunil . m
From: Suniel Mahesh 

Fix unbalanced braces around else statement reported by checkpatch.pl

Signed-off-by: Suniel Mahesh 
---
Changes for v2:

- new patch addition to the series
- Rebased on top of next-20170306
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 028755b..fb711d2 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2257,17 +2257,20 @@ static int _rtl92e_ioctl(struct net_device *dev, struct 
ifreq *rq, int cmd)
 
if (ipw->cmd == IEEE_CMD_SET_ENCRYPTION) {
if (ipw->u.crypt.set_tx) {
-   if (strcmp(ipw->u.crypt.alg, "CCMP") == 0)
+   if (strcmp(ipw->u.crypt.alg, "CCMP") == 0) {
ieee->pairwise_key_type = KEY_TYPE_CCMP;
-   else if (strcmp(ipw->u.crypt.alg, "TKIP") == 0)
+   } else if (strcmp(ipw->u.crypt.alg,
+ "TKIP") == 0) {
ieee->pairwise_key_type = KEY_TYPE_TKIP;
-   else if (strcmp(ipw->u.crypt.alg, "WEP") == 0) {
-   if (ipw->u.crypt.key_len == 13)
+   } else if (strcmp(ipw->u.crypt.alg,
+ "WEP") == 0) {
+   if (ipw->u.crypt.key_len == 13) {
ieee->pairwise_key_type =
 KEY_TYPE_WEP104;
-   else if (ipw->u.crypt.key_len == 5)
+   } else if (ipw->u.crypt.key_len == 5) {
ieee->pairwise_key_type =
 KEY_TYPE_WEP40;
+   }
} else {
ieee->pairwise_key_type = KEY_TYPE_NA;
}
@@ -2322,9 +2325,9 @@ static int _rtl92e_ioctl(struct net_device *dev, struct 
ifreq *rq, int cmd)
else if (ipw->u.crypt.key_len == 5)
ieee->group_key_type =
 KEY_TYPE_WEP40;
-   } else
+   } else {
ieee->group_key_type = KEY_TYPE_NA;
-
+   }
if (ieee->group_key_type) {
rtl92e_set_swcam(dev, ipw->u.crypt.idx,
 ipw->u.crypt.idx,
-- 
1.9.1

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


[PATCH v2 5/5] staging: rtl8192e: Pass a pointer as an argument to sizeof() instead of struct

2017-03-09 Thread sunil . m
From: Suniel Mahesh 

Prefer vzalloc(sizeof(*priv->pFirmware)...) over
vzalloc(sizeof(struct rt_firmware)...) as reported by checkpatch.pl

Signed-off-by: Suniel Mahesh 
---
Changes for v2:

- new patch addition to the series
- Rebased on top of next-20170306
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index fb711d2..a099bce 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -965,7 +965,7 @@ static void _rtl92e_init_priv_variable(struct net_device 
*dev)
 
priv->card_type = PCI;
 
-   priv->pFirmware = vzalloc(sizeof(struct rt_firmware));
+   priv->pFirmware = vzalloc(sizeof(*priv->pFirmware));
if (!priv->pFirmware)
return -ENOMEM;
skb_queue_head_init(&priv->skb_queue);
-- 
1.9.1

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


[PATCH v2 1/5] staging: rtl8192e: Fix coding style issues

2017-03-09 Thread sunil . m
From: Suniel Mahesh 

Fix coding style issues and comments in rtl_core.c

Signed-off-by: Suniel Mahesh 
---
Changes for v2:

- Split larger patch into multiple commits as suggested by Dan Carpenter
- This patch fixes coding style issues, comments in rtl_core.c reported by 
checkpatch.pl
- Modified short description to 'Fix coding style issues' from 'Fix coding 
style issues,
  improve error handling'
- Improve error handling is taken care by the following patch in the series
- Removed statements, 'Return -ENOMEM, if it is out of memory', 'Pointer 
comparison with
  NULL replaced by logical NOT' from the body of the patch
- Rebased on top of next-20170306
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 248 +++
 1 file changed, 98 insertions(+), 150 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 4c0caa6..349c49b 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1,4 +1,4 @@
-/**
+/
  * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
  *
  * Based on the r8180 driver, which is:
@@ -17,7 +17,7 @@
  *
  * Contact Information:
  * wlanfae 
-**/
+ */
 #include 
 #include 
 #include 
@@ -37,7 +37,6 @@
 static int channels = 0x3fff;
 static char *ifname = "wlan%d";
 
-
 static const struct rtl819x_ops rtl819xp_ops = {
.nic_type   = NIC_8192E,
.get_eeprom_size= rtl92e_get_eeprom_size,
@@ -100,9 +99,7 @@ static void _rtl92e_hard_data_xmit(struct sk_buff *skb, 
struct net_device *dev,
 static int _rtl92e_down(struct net_device *dev, bool shutdownrf);
 static void _rtl92e_restart(void *data);
 
-/
-   -IO STUFF-
-*/
+/* IO STUFF */
 
 u8 rtl92e_readb(struct net_device *dev, int x)
 {
@@ -140,9 +137,7 @@ void rtl92e_writew(struct net_device *dev, int x, u16 y)
udelay(20);
 }
 
-/
-   -GENERAL FUNCTION-
-*/
+/* GENERAL FUNCTION */
 bool rtl92e_set_rf_state(struct net_device *dev,
 enum rt_rf_power_state StateToSet,
 RT_RF_CHANGE_SOURCE ChangeSource)
@@ -200,7 +195,6 @@ bool rtl92e_set_rf_state(struct net_device *dev,
priv->rtllib->RfOffReason = 0;
bActionAllowed = true;
 
-
if (rtState == eRfOff &&
ChangeSource >= RF_CHANGE_BY_HW)
bConnectBySSID = true;
@@ -223,7 +217,8 @@ bool rtl92e_set_rf_state(struct net_device *dev,
else
priv->blinked_ingpio = false;
rtllib_MgntDisconnect(priv->rtllib,
- 
WLAN_REASON_DISASSOC_STA_HAS_LEFT);
+ WLAN_REASON_DISASSOC_STA_
+   HAS_LEFT);
}
}
if ((ChangeSource == RF_CHANGE_BY_HW) && !priv->bHwRadioOff)
@@ -247,7 +242,6 @@ bool rtl92e_set_rf_state(struct net_device *dev,
 StateToSet, priv->rtllib->RfOffReason);
PHY_SetRFPowerState(dev, StateToSet);
if (StateToSet == eRfOn) {
-
if (bConnectBySSID && priv->blinked_ingpio) {
schedule_delayed_work(
 &ieee->associate_procedure_wq, 0);
@@ -346,16 +340,16 @@ static void _rtl92e_update_cap(struct net_device *dev, 
u16 cap)
}
}
 
-   if (net->mode & (IEEE_G|IEEE_N_24G)) {
+   if (net->mode & (IEEE_G | IEEE_N_24G)) {
u8  slot_time_val;
u8  CurSlotTime = priv->slot_time;
 
if ((cap & WLAN_CAPABILITY_SHORT_SLOT_TIME) &&
-  (!priv->rtllib->pHTInfo->bCurrentRT2RTLongSlotTime)) {
+   (!priv->rtllib->pHTInfo->bCurrentRT2RTLongSlotTime)) {
if (CurSlotTime != SHORT_SLOT_TIME) {
slot_time_val = SHORT_SLOT_TIME;
priv->rtllib->SetHwRegHandler(dev,
-   

[PATCH v2 3/5] staging: rtl8192e: Rectify pointer comparisions

2017-03-09 Thread sunil . m
From: Suniel Mahesh 

Pointer comparison with NULL replaced by logical NOT

Signed-off-by: Suniel Mahesh 
---
Changes for v2:

- Rectify pointer comparisions reported by checkpatch.pl in rtl_core.c
- new patch addition to the series
- Rebased on top of next-20170306
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 2e6b03f..028755b 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -469,7 +469,7 @@ static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv,
u32 size = sizeof(struct rtllib_qos_parameters);
int set_qos_param = 0;
 
-   if ((priv == NULL) || (network == NULL))
+   if (!priv || !network)
return 0;
 
if (priv->rtllib->state != RTLLIB_LINKED)
@@ -782,7 +782,7 @@ static int _rtl92e_sta_down(struct net_device *dev, bool 
shutdownrf)
if (priv->up == 0)
return -1;
 
-   if (priv->rtllib->rtllib_ips_leave != NULL)
+   if (priv->rtllib->rtllib_ips_leave)
priv->rtllib->rtllib_ips_leave(dev);
 
if (priv->rtllib->state == RTLLIB_LINKED)
-- 
1.9.1

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


[PATCH v2 2/5] staging: rtl8192e: Improve error handling

2017-03-09 Thread sunil . m
From: Suniel Mahesh 

Return -ENOMEM, if it is out of memory

Signed-off-by: Suniel Mahesh 
---
Changes for v2:

- Improve error handling reported by checkpatch.pl in rtl_core.c
- new patch addition to the series
- Rebased on top of next-20170306
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 349c49b..2e6b03f 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -967,8 +967,7 @@ static void _rtl92e_init_priv_variable(struct net_device 
*dev)
 
priv->pFirmware = vzalloc(sizeof(struct rt_firmware));
if (!priv->pFirmware)
-   netdev_err(dev,
-  "rtl8192e: Unable to allocate space for firmware\n");
+   return -ENOMEM;
skb_queue_head_init(&priv->skb_queue);
 
for (i = 0; i < MAX_QUEUE_SIZE; i++)
-- 
1.9.1

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


[PATCH 0/6] staging: speakup: multiple checkpatch issues

2017-03-09 Thread Arushi Singhal
Improve readability by fixing multiple checkpatch.pl
issues in speakup driver. 

Arushi Singhal (6):
  staging: speakup: fix "Alignment match open parenthesis"
  staging: speakup: Placed Logical on the previous line
  staging: speakup: spaces preferred around operator
  staging: speakup: identation should use tabs
  staging: speakup: Alignment should match open parenthesis
  staging: speakup: Add blank line after function/struct/union/enum
declarations

 drivers/staging/speakup/i18n.c   |  2 +-
 drivers/staging/speakup/kobjects.c   | 56 
 drivers/staging/speakup/main.c   | 11 ---
 drivers/staging/speakup/selection.c  |  2 +-
 drivers/staging/speakup/serialio.c   |  7 ++--
 drivers/staging/speakup/speakup.h| 12 +++
 drivers/staging/speakup/speakup_acntpc.c | 10 +++---
 drivers/staging/speakup/speakup_apollo.c |  2 +-
 drivers/staging/speakup/speakup_decext.c |  4 +--
 drivers/staging/speakup/speakup_decpc.c  | 22 ++---
 drivers/staging/speakup/speakup_dtlk.c   | 17 +-
 drivers/staging/speakup/speakup_dtlk.h   | 10 +++---
 drivers/staging/speakup/speakup_keypc.c  | 12 +++
 drivers/staging/speakup/speakup_ltlk.c   |  2 +-
 14 files changed, 86 insertions(+), 83 deletions(-)

-- 
2.11.0

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


[PATCH 1/6] staging: speakup: fix "Alignment match open parenthesis"

2017-03-09 Thread Arushi Singhal
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/i18n.c |  2 +-
 drivers/staging/speakup/kobjects.c | 40 +++---
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
index 11f1418b4006..ac1ebead3c3f 100644
--- a/drivers/staging/speakup/i18n.c
+++ b/drivers/staging/speakup/i18n.c
@@ -607,7 +607,7 @@ void spk_reset_msg_group(struct msg_group_t *group)
 void spk_initialize_msgs(void)
 {
memcpy(speakup_msgs, speakup_default_msgs,
-   sizeof(speakup_default_msgs));
+  sizeof(speakup_default_msgs));
 }
 
 /* Free user-supplied strings when module is unloaded: */
diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index 2fef55569bfd..8c93188b832c 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -79,7 +79,7 @@ static ssize_t chars_chartab_show(struct kobject *kobj,
  * character descriptions or chartab entries.
  */
 static void report_char_chartab_status(int reset, int received, int used,
-   int rejected, int do_characters)
+   int rejected, int do_characters)
 {
static char const *object_type[] = {
"character class entries",
@@ -92,8 +92,8 @@ static void report_char_chartab_status(int reset, int 
received, int used,
pr_info("%s reset to defaults\n", object_type[do_characters]);
} else if (received) {
len = snprintf(buf, sizeof(buf),
-   " updated %d of %d %s\n",
-   used, received, object_type[do_characters]);
+  " updated %d of %d %s\n",
+  used, received, object_type[do_characters]);
if (rejected)
snprintf(buf + (len - 1), sizeof(buf) - (len - 1),
 " with %d reject%s\n",
@@ -213,7 +213,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
 
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
report_char_chartab_status(reset, received, used, rejected,
-   do_characters);
+  do_characters);
return retval;
 }
 
@@ -221,7 +221,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
  * This is called when a user reads the keymap parameter.
  */
 static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr,
-   char *buf)
+   char *buf)
 {
char *cp = buf;
int i;
@@ -257,7 +257,7 @@ static ssize_t keymap_show(struct kobject *kobj, struct 
kobj_attribute *attr,
  * This is called when a user changes the keymap parameter.
  */
 static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
-   const char *buf, size_t count)
+const char *buf, size_t count)
 {
int i;
ssize_t ret = count;
@@ -291,9 +291,9 @@ static ssize_t keymap_store(struct kobject *kobj, struct 
kobj_attribute *attr,
i *= (int)cp1[-1] + 1;
i += 2; /* 0 and last map ver */
if (cp1[-3] != KEY_MAP_VER || cp1[-1] > 10 ||
-   i + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) {
+   i + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) {
pr_warn("i %d %d %d %d\n", i,
-   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
+   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
kfree(in_buff);
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return -EINVAL;
@@ -307,7 +307,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct 
kobj_attribute *attr,
if (i != 0 || cp1[-1] != KEY_MAP_VER || cp1[-2] != 0) {
ret = -EINVAL;
pr_warn("end %d %d %d %d\n", i,
-   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
+   (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
} else {
if (spk_set_key_info(in_buff, spk_key_buf)) {
spk_set_key_info(spk_key_defaults, spk_key_buf);
@@ -324,7 +324,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct 
kobj_attribute *attr,
  * This is called when a user changes the value of the silent parameter.
  */
 static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr,
-   const char *buf, size_t count)
+const char *buf, size_t count)
 {
int len;
struct vc_data *vc = vc_cons[fg_console].d;
@@ -363,7 +363,7 @@ static ssize_t silent_store(struct kobject *kobj, struct 
kobj_attribute *attr,
  * This is called when a user reads the synth setting.
  */
 static ssize_t synth_show(struct kobject *kobj, struct kobj_attribut

[PATCH 2/6] staging: speakup: Placed Logical on the previous line

2017-03-09 Thread Arushi Singhal
Placed Logical continuations on the previous line as reported by
checkpatch.pl.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/main.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index a12ec2b061fe..25acebb9311f 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2144,10 +2144,10 @@ speakup_key(struct vc_data *vc, int shift_state, int 
keycode, u_short keysym,
if (up_flag || spk_killed || type == KT_SHIFT)
goto out;
spk_shut_up &= 0xfe;
-   kh = (value == KVAL(K_DOWN))
-   || (value == KVAL(K_UP))
-   || (value == KVAL(K_LEFT))
-   || (value == KVAL(K_RIGHT));
+   kh = (value == KVAL(K_DOWN)) ||
+ (value == KVAL(K_UP))  ||
+ (value == KVAL(K_LEFT)) ||
+ (value == KVAL(K_RIGHT));
if ((cursor_track != read_all_mode) || !kh)
if (!spk_no_intr)
spk_do_flush();
-- 
2.11.0

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


[PATCH 3/6] staging: speakup: spaces preferred around operator

2017-03-09 Thread Arushi Singhal
Fixed the checkpatch.pl issues like:
CHECK: spaces preferred around that '&' (ctx:VxV)
CHECK: spaces preferred around that '|' (ctx:VxV)
CHECK: spaces preferred around that '-' (ctx:VxV)
CHECK: spaces preferred around that '+' (ctx:VxV)
etc.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/serialio.c   |  4 ++--
 drivers/staging/speakup/speakup.h| 12 ++--
 drivers/staging/speakup/speakup_acntpc.c |  4 ++--
 drivers/staging/speakup/speakup_decpc.c  | 22 +++---
 drivers/staging/speakup/speakup_dtlk.c   | 16 
 drivers/staging/speakup/speakup_keypc.c  | 12 ++--
 drivers/staging/speakup/speakup_ltlk.c   |  2 +-
 7 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/speakup/serialio.c 
b/drivers/staging/speakup/serialio.c
index 657a48b6f8d3..aade52ee15a0 100644
--- a/drivers/staging/speakup/serialio.c
+++ b/drivers/staging/speakup/serialio.c
@@ -120,8 +120,8 @@ static void start_serial_interrupt(int irq)
outb(UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2,
speakup_info.port_tts + UART_MCR);
/* Turn on Interrupts */
-   outb(UART_IER_MSI|UART_IER_RLSI|UART_IER_RDI,
-   speakup_info.port_tts + UART_IER);
+   outb(UART_IER_MSI | UART_IER_RLSI | UART_IER_RDI,
+speakup_info.port_tts + UART_IER);
inb(speakup_info.port_tts + UART_LSR);
inb(speakup_info.port_tts + UART_RX);
inb(speakup_info.port_tts + UART_IIR);
diff --git a/drivers/staging/speakup/speakup.h 
b/drivers/staging/speakup/speakup.h
index b203f0f883a9..7a2c3e5ad564 100644
--- a/drivers/staging/speakup/speakup.h
+++ b/drivers/staging/speakup/speakup.h
@@ -20,7 +20,7 @@
 #define A_CAP 0x0007
 #define B_NUM 0x0008
 #define NUM 0x0009
-#define ALPHANUM (B_ALPHA|B_NUM)
+#define ALPHANUM (B_ALPHA | B_NUM)
 #define SOME 0x0010
 #define MOST 0x0020
 #define PUNC 0x0040
@@ -30,13 +30,13 @@
 #define B_EXNUM 0x0100
 #define CH_RPT 0x0200
 #define B_CTL 0x0400
-#define A_CTL (B_CTL+SYNTH_OK)
+#define A_CTL (B_CTL + SYNTH_OK)
 #define B_SYM 0x0800
-#define B_CAPSYM (B_CAP|B_SYM)
+#define B_CAPSYM (B_CAP | B_SYM)
 
-#define IS_WDLM(x) (spk_chartab[((u_char)x)]&B_WDLM)
-#define IS_CHAR(x, type) (spk_chartab[((u_char)x)]&type)
-#define IS_TYPE(x, type) ((spk_chartab[((u_char)x)]&type) == type)
+#define IS_WDLM(x) (spk_chartab[((u_char)x)] & B_WDLM)
+#define IS_CHAR(x, type) (spk_chartab[((u_char)x)] & type)
+#define IS_TYPE(x, type) ((spk_chartab[((u_char)x)] & type) == type)
 
 int speakup_thread(void *data);
 void spk_reset_default_chars(void);
diff --git a/drivers/staging/speakup/speakup_acntpc.c 
b/drivers/staging/speakup/speakup_acntpc.c
index cf6fcd63498d..bca386d9fbd1 100644
--- a/drivers/staging/speakup/speakup_acntpc.c
+++ b/drivers/staging/speakup/speakup_acntpc.c
@@ -280,7 +280,7 @@ static int synth_probe(struct spk_synth *synth)
if (port_val == 0x53fc) {
/* 'S' and out&input bits */
synth_port_control = synth_portlist[i];
-   speakup_info.port_tts = synth_port_control+1;
+   speakup_info.port_tts = synth_port_control + 1;
break;
}
}
@@ -303,7 +303,7 @@ static int synth_probe(struct spk_synth *synth)
 static void accent_release(void)
 {
if (speakup_info.port_tts)
-   synth_release_region(speakup_info.port_tts-1, SYNTH_IO_EXTENT);
+   synth_release_region(speakup_info.port_tts - 1, 
SYNTH_IO_EXTENT);
speakup_info.port_tts = 0;
 }
 
diff --git a/drivers/staging/speakup/speakup_decpc.c 
b/drivers/staging/speakup/speakup_decpc.c
index 6bf38e49a96d..600eb057f830 100644
--- a/drivers/staging/speakup/speakup_decpc.c
+++ b/drivers/staging/speakup/speakup_decpc.c
@@ -251,7 +251,7 @@ static int dt_getstatus(void)
 static void dt_sendcmd(u_int cmd)
 {
outb_p(cmd & 0xFF, speakup_info.port_tts);
-   outb_p((cmd >> 8) & 0xFF, speakup_info.port_tts+1);
+   outb_p((cmd >> 8) & 0xFF, speakup_info.port_tts + 1);
 }
 
 static int dt_waitbit(int bit)
@@ -273,7 +273,7 @@ static int dt_wait_dma(void)
if (!dt_waitbit(STAT_dma_ready))
return 0;
while (--timeout > 0) {
-   if ((dt_getstatus()&STAT_dma_state) == state)
+   if ((dt_getstatus() & STAT_dma_state) == state)
return 1;
udelay(50);
}
@@ -287,11 +287,11 @@ static int dt_ctrl(u_int cmd)
 
if (!dt_waitbit(STAT_cmd_ready))
return -1;
-   outb_p(0, speakup_info.port_tts+2);
-   outb_p(0, speakup_info.port_tts+3);
+   outb_p(0, speakup_info.port_tts + 2);
+   outb_p(0, speakup_info.port_tts + 3);
dt_getstatus();
-   dt_sendcmd(CMD_control|cmd);
-   outb_p(0, speakup_info.port_tts+6);
+   dt_sendcmd(CMD_control 

[PATCH 4/6] staging: speakup: identation should use tabs

2017-03-09 Thread Arushi Singhal
Indentation should always use tabs and never spaces.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/speakup_dtlk.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/speakup/speakup_dtlk.h 
b/drivers/staging/speakup/speakup_dtlk.h
index b3b3cfc3db07..46d885fcfb20 100644
--- a/drivers/staging/speakup/speakup_dtlk.h
+++ b/drivers/staging/speakup/speakup_dtlk.h
@@ -24,11 +24,11 @@
 * usec later.
 */
 #define TTS_ALMOST_FULL0x08/* mask for AF bit: When set to 1,
-* indicates that less than 300 bytes
-* are available in the TTS input
-* buffer. AF is always 0 in the PCM,
-* TGN and CVSD modes.
-*/
+* indicates that less than 300 bytes
+* are available in the TTS input
+* buffer. AF is always 0 in the PCM,
+* TGN and CVSD modes.
+*/
 #define TTS_ALMOST_EMPTY 0x04  /* mask for AE bit: When set to 1,
 * indicates that less than 300 bytes
 * are remaining in DoubleTalk's input
-- 
2.11.0

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


[PATCH 6/6] staging: speakup: Add blank line after function/struct/union/enum declarations

2017-03-09 Thread Arushi Singhal
This patch fixes the warnings reported by checkpatch.pl
for please use a blank line after function/struct/union/enum
declarations.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/main.c | 1 +
 drivers/staging/speakup/serialio.c | 1 +
 drivers/staging/speakup/speakup_dtlk.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 01eabc19039c..17df20ec94be 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -108,6 +108,7 @@ enum {
CT_Window,
CT_Max
 };
+
 #define read_all_mode CT_Max
 
 static struct tty_struct *tty;
diff --git a/drivers/staging/speakup/serialio.c 
b/drivers/staging/speakup/serialio.c
index 7e6bc3b05da3..9b2626e85042 100644
--- a/drivers/staging/speakup/serialio.c
+++ b/drivers/staging/speakup/serialio.c
@@ -21,6 +21,7 @@ static void start_serial_interrupt(int irq);
 static const struct old_serial_port rs_table[] = {
SERIAL_PORT_DFNS
 };
+
 static const struct old_serial_port *serstate;
 static int timeouts;
 
diff --git a/drivers/staging/speakup/speakup_dtlk.c 
b/drivers/staging/speakup/speakup_dtlk.c
index 1ebe5012ec0b..e36360f65f36 100644
--- a/drivers/staging/speakup/speakup_dtlk.c
+++ b/drivers/staging/speakup/speakup_dtlk.c
@@ -43,6 +43,7 @@ static int port_forced;
 static unsigned int synth_portlist[] = {
 0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0
 };
+
 static u_char synth_status;
 
 static struct var_t vars[] = {
-- 
2.11.0

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


[PATCH] Staging: xgifb: XGI_main_26.c: non-standard C

2017-03-09 Thread Manoj Sawai
Fixes following checkpatch warning:

"WARNING: %Lx is non-standard C, use %llx"

Signed-off-by: Manoj Sawai 
---
 drivers/staging/xgifb/XGI_main_26.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 9870ea3b76b4..d938da3e8a1e 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1643,7 +1643,7 @@ static int xgifb_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
xgifb_info->mmio_base = pci_resource_start(pdev, 1);
xgifb_info->mmio_size = pci_resource_len(pdev, 1);
xgifb_info->vga_base = pci_resource_start(pdev, 2) + 0x30;
-   dev_info(&pdev->dev, "Relocate IO address: %Lx [%08lx]\n",
+   dev_info(&pdev->dev, "Relocate IO address: %llx [%08lx]\n",
 (u64)pci_resource_start(pdev, 2),
 xgifb_info->vga_base);
 
@@ -1738,13 +1738,13 @@ static int xgifb_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
xgifb_info->mmio_size);
 
dev_info(&pdev->dev,
-"Framebuffer at 0x%Lx, mapped to 0x%p, size %dk\n",
+"Framebuffer at 0x%llx, mapped to 0x%p, size %dk\n",
 (u64)xgifb_info->video_base,
 xgifb_info->video_vbase,
 xgifb_info->video_size / 1024);
 
dev_info(&pdev->dev,
-"MMIO at 0x%Lx, mapped to 0x%p, size %ldk\n",
+"MMIO at 0x%llx, mapped to 0x%p, size %ldk\n",
 (u64)xgifb_info->mmio_base, xgifb_info->mmio_vbase,
 xgifb_info->mmio_size / 1024);
 
-- 
2.11.0

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


[PATCH 5/6] staging: speakup: Alignment should match open parenthesis

2017-03-09 Thread Arushi Singhal
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/kobjects.c   | 16 
 drivers/staging/speakup/main.c   |  2 +-
 drivers/staging/speakup/selection.c  |  2 +-
 drivers/staging/speakup/serialio.c   |  2 +-
 drivers/staging/speakup/speakup_acntpc.c |  6 +++---
 drivers/staging/speakup/speakup_apollo.c |  2 +-
 drivers/staging/speakup/speakup_decext.c |  4 ++--
 7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index 8c93188b832c..edde9e68779e 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -662,9 +662,9 @@ ssize_t spk_var_store(struct kobject *kobj, struct 
kobj_attribute *attr,
var_data = param->data;
value = var_data->u.n.value;
spk_reset_default_value("pitch", synth->default_pitch,
-   value);
+   value);
spk_reset_default_value("vol", synth->default_vol,
-   value);
+   value);
}
break;
case VAR_STRING:
@@ -679,7 +679,7 @@ ssize_t spk_var_store(struct kobject *kobj, struct 
kobj_attribute *attr,
ret = spk_set_string_var(cp, param, len);
if (ret == -E2BIG)
pr_warn("value too long for %s\n",
-   param->name);
+   param->name);
break;
default:
pr_warn("%s unknown type %d\n",
@@ -699,7 +699,7 @@ EXPORT_SYMBOL_GPL(spk_var_store);
  */
 
 static ssize_t message_show_helper(char *buf, enum msg_index_t first,
-   enum msg_index_t last)
+   enum msg_index_t last)
 {
size_t bufsize = PAGE_SIZE;
char *buf_pointer = buf;
@@ -712,7 +712,7 @@ static ssize_t message_show_helper(char *buf, enum 
msg_index_t first,
if (bufsize <= 1)
break;
printed = scnprintf(buf_pointer, bufsize, "%d\t%s\n",
-   index, spk_msg_get(cursor));
+   index, spk_msg_get(cursor));
buf_pointer += printed;
bufsize -= printed;
}
@@ -721,7 +721,7 @@ static ssize_t message_show_helper(char *buf, enum 
msg_index_t first,
 }
 
 static void report_msg_status(int reset, int received, int used,
-   int rejected, char *groupname)
+  int rejected, char *groupname)
 {
int len;
char buf[160];
@@ -742,7 +742,7 @@ static void report_msg_status(int reset, int received, int 
used,
 }
 
 static ssize_t message_store_helper(const char *buf, size_t count,
-   struct msg_group_t *group)
+struct msg_group_t *group)
 {
char *cp = (char *) buf;
char *end = cp + count;
@@ -843,7 +843,7 @@ static ssize_t message_show(struct kobject *kobj,
 }
 
 static ssize_t message_store(struct kobject *kobj, struct kobj_attribute *attr,
-   const char *buf, size_t count)
+ const char *buf, size_t count)
 {
struct msg_group_t *group = spk_find_msg_group(attr->attr.name);
 
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 25acebb9311f..01eabc19039c 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -1140,7 +1140,7 @@ static void spkup_write(const char *in_buf, int count)
if (last_type & CH_RPT) {
synth_printf(" ");
synth_printf(spk_msg_get(MSG_REPEAT_DESC2),
-   ++rep_count);
+++rep_count);
synth_printf(" ");
}
rep_count = 0;
diff --git a/drivers/staging/speakup/selection.c 
b/drivers/staging/speakup/selection.c
index afd9a446a06f..3d15eec37163 100644
--- a/drivers/staging/speakup/selection.c
+++ b/drivers/staging/speakup/selection.c
@@ -75,7 +75,7 @@ int speakup_set_selection(struct tty_struct *tty)
speakup_clear_selection();
spk_sel_cons = vc_cons[fg_console].d;
dev_warn(tty->dev,
-   "Selection: mark console not the same as cut\n");
+"Selection: mark console not the same as cut\n");
return -EINVAL;
}
 
diff --git a/drivers/staging/speakup/serialio.c 
b/drivers/staging/speakup/serialio.c
index aade52ee15a0..7e6bc3b05da3 100644
--- a/drivers/staging/speakup/serialio.c
+++ b/drivers/staging/speakup/serialio.c
@@ -118,7 +118,7 @@ static void start_serial_interrupt(int irq)
pr_err("Unable to

Re: [RFC PATCH v2 13/32] KVM: SVM: Enable SEV by setting the SEV_ENABLE CPU feature

2017-03-09 Thread Borislav Petkov
On Thu, Mar 02, 2017 at 10:15:01AM -0500, Brijesh Singh wrote:
> From: Tom Lendacky 
> 
> Modify the SVM cpuid update function to indicate if Secure Encrypted
> Virtualization (SEV) is active in the guest by setting the SEV KVM CPU
> features bit. SEV is active if Secure Memory Encryption is enabled in
> the host and the SEV_ENABLE bit of the VMCB is set.
> 
> Signed-off-by: Tom Lendacky 
> ---
>  arch/x86/kvm/cpuid.c |4 +++-
>  arch/x86/kvm/svm.c   |   18 ++
>  2 files changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 1639de8..e0c40a8 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -601,7 +601,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 
> *entry, u32 function,
>   entry->edx = 0;
>   break;
>   case 0x8000:
> - entry->eax = min(entry->eax, 0x801a);
> + entry->eax = min(entry->eax, 0x801f);
>   break;
>   case 0x8001:
>   entry->edx &= kvm_cpuid_8000_0001_edx_x86_features;
> @@ -634,6 +634,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 
> *entry, u32 function,
>   break;
>   case 0x801d:
>   break;
> + case 0x801f:
> + break;

I guess those three case's can be unified:

case 0x801a:
case 0x801d:
case 0x801f:
break;

...

> + sev_info = kvm_find_cpuid_entry(vcpu, 0x801f, 0);
> + if (!sev_info)
> + return;
> +
> + if (ca->nested_ctl & SVM_NESTED_CTL_SEV_ENABLE) {
> + features->eax |= (1 << KVM_FEATURE_SEV);
> + cpuid(0x801f, &sev_info->eax, &sev_info->ebx,
> +   &sev_info->ecx, &sev_info->edx);
> + }

Right, as already mentioned in the previous mail: can we communicate SEV
status to the guest solely through the 0x801f leaf? Then we won't
need KVM_FEATURE_SEV and this way we'll be hypervisor-agnostic, as Paolo
suggested.

-- 
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 
(AG Nürnberg)
-- 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: speakup: Unnecessary parentheses are removed.

2017-03-09 Thread Arushi Singhal
Unnecessary parentheses are removed to improve readability.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/kobjects.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index 9feb97dfd72b..8a586323b728 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -392,7 +392,7 @@ static ssize_t synth_store(struct kobject *kobj, struct 
kobj_attribute *attr,
len--;
new_synth_name[len] = '\0';
spk_strlwr(new_synth_name);
-   if (synth && (!strcmp(new_synth_name, synth->name))) {
+   if (synth && !strcmp(new_synth_name, synth->name)) {
pr_warn("%s already in use\n", new_synth_name);
} else if (synth_init(new_synth_name) != 0) {
pr_warn("failed to init synth %s\n", new_synth_name);
-- 
2.11.0

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


[PATCH] staging: speakup: Simplify "NULL" comparisons

2017-03-09 Thread Arushi Singhal
Fixed coding style for null comparisons in speakup driver to be more
consistant with the rest of the kernel coding style.
Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/fakekey.c |  2 +-
 drivers/staging/speakup/main.c| 36 ++--
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/speakup/fakekey.c 
b/drivers/staging/speakup/fakekey.c
index d76da0a1382c..294c74b47224 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -56,7 +56,7 @@ int speakup_add_virtual_keyboard(void)
 
 void speakup_remove_virtual_keyboard(void)
 {
-   if (virt_keyboard != NULL) {
+   if (virt_keyboard) {
input_unregister_device(virt_keyboard);
virt_keyboard = NULL;
}
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index fb8bef991cdf..6d9c9c858c75 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -300,7 +300,7 @@ static void speakup_shut_up(struct vc_data *vc)
spk_shut_up |= 0x01;
spk_parked &= 0xfe;
speakup_date(vc);
-   if (synth != NULL)
+   if (synth)
spk_do_flush();
 }
 
@@ -446,7 +446,7 @@ static void speak_char(u16 ch)
if (ch >= 0x100)
return;
cp = spk_characters[ch];
-   if (cp == NULL) {
+   if (!cp) {
pr_info("speak_char: cp == NULL!\n");
return;
}
@@ -1169,7 +1169,7 @@ static void do_handle_shift(struct vc_data *vc, u_char 
value, char up_flag)
 {
unsigned long flags;
 
-   if (synth == NULL || up_flag || spk_killed)
+   if (!synth || up_flag || spk_killed)
return;
spin_lock_irqsave(&speakup_info.spinlock, flags);
if (cursor_track == read_all_mode) {
@@ -1207,7 +1207,7 @@ static void do_handle_latin(struct vc_data *vc, u_char 
value, char up_flag)
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return;
}
-   if (synth == NULL || spk_killed) {
+   if (!synth || spk_killed) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return;
}
@@ -1291,8 +1291,8 @@ void spk_reset_default_chars(void)
 
/* First, free any non-default */
for (i = 0; i < 256; i++) {
-   if ((spk_characters[i] != NULL)
-   && (spk_characters[i] != spk_default_chars[i]))
+   if (spk_characters[i] &&
+   (spk_characters[i] != spk_default_chars[i]))
kfree(spk_characters[i]);
}
 
@@ -1333,7 +1333,7 @@ static int speakup_allocate(struct vc_data *vc)
int vc_num;
 
vc_num = vc->vc_num;
-   if (speakup_console[vc_num] == NULL) {
+   if (!speakup_console[vc_num]) {
speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]),
  GFP_ATOMIC);
if (!speakup_console[vc_num])
@@ -1385,7 +1385,7 @@ static void kbd_fakekey2(struct vc_data *vc, int command)
 
 static void read_all_doc(struct vc_data *vc)
 {
-   if ((vc->vc_num != fg_console) || synth == NULL || spk_shut_up)
+   if ((vc->vc_num != fg_console) || !synth || spk_shut_up)
return;
if (!synth_supports_indexing())
return;
@@ -1499,7 +1499,7 @@ static int pre_handle_cursor(struct vc_data *vc, u_char 
value, char up_flag)
spin_lock_irqsave(&speakup_info.spinlock, flags);
if (cursor_track == read_all_mode) {
spk_parked &= 0xfe;
-   if (synth == NULL || up_flag || spk_shut_up) {
+   if (!synth || up_flag || spk_shut_up) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return NOTIFY_STOP;
}
@@ -1521,7 +1521,7 @@ static void do_handle_cursor(struct vc_data *vc, u_char 
value, char up_flag)
 
spin_lock_irqsave(&speakup_info.spinlock, flags);
spk_parked &= 0xfe;
-   if (synth == NULL || up_flag || spk_shut_up || cursor_track == CT_Off) {
+   if (!synth || up_flag || spk_shut_up || cursor_track == CT_Off) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return;
}
@@ -1717,7 +1717,7 @@ static void speakup_bs(struct vc_data *vc)
return;
if (!spk_parked)
speakup_date(vc);
-   if (spk_shut_up || synth == NULL) {
+   if (spk_shut_up || !synth) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return;
}
@@ -1763,7 +1763,7 @@ static void speakup_con_update(struct vc_data *vc)
 {
unsigned long flags;
 
-   if (speakup_console[vc->vc_num] == NULL || spk_parked)
+   if (!speakup_console[vc->vc_num] || spk_parked)

Re: [PATCH v2 05/12] staging: ks7010: remove unnecessary parenthesis

2017-03-09 Thread Tobin C. Harding
On Thu, Mar 09, 2017 at 02:04:20PM +0100, Greg Kroah-Hartman wrote:
> On Thu, Mar 09, 2017 at 03:47:05PM +1100, Tobin C. Harding wrote:
> > Checkpatch emits CHECK: Unnecessary parentheses.
> > 
> > Remove unnecessary parentheses.
> > 
> > Signed-off-by: Tobin C. Harding 
> > ---
> >  drivers/staging/ks7010/ks_hostif.c | 24 
> >  1 file changed, 12 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/staging/ks7010/ks_hostif.c 
> > b/drivers/staging/ks7010/ks_hostif.c
> > index a354e34e..b75ef1d6 100644
> > --- a/drivers/staging/ks7010/ks_hostif.c
> > +++ b/drivers/staging/ks7010/ks_hostif.c
> > @@ -36,7 +36,7 @@ inline u8 get_BYTE(struct ks_wlan_private *priv)
> >  {
> > u8 data;
> >  
> > -   data = *(priv->rxp)++;
> > +   data = *priv->rxp++;
> 
> Are you sure this is ok?  I would have to dig out a book to find the
> ordering rules here...

I also had to get out K&R. The reason I decided to look it up and make
the change wast that with the parenthesis I also still needed to think
about the precedence. Adding the parenthesis in no way makes the
precedence *more* clear. And the checkpatch warning of course.

I ran this code to check it

#include 
#include 

/*
 * Confirm precedence 
 */

int main(void)
{
uint8_t buf[3];
uint8_t *bp = buf;
uint8_t data;

buf[0] = 0;
buf[1] = 1;
buf[2] = 2;

printf("buf = [%d, %d, %d]\n",(int)buf[0], (int)buf[1], (int)buf[2]);
printf("bp before: %d\n", (int)*bp);
  
/* data = *(bp)++; */
data = *bp++;

printf("bp after: %d\n", (int)*bp);

return(0);
}

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


Re: [PATCH v2 03/12] staging: ks7010: replace C types with kernel types

2017-03-09 Thread Tobin C. Harding
On Thu, Mar 09, 2017 at 02:04:45PM +0100, Greg Kroah-Hartman wrote:
> On Thu, Mar 09, 2017 at 03:47:03PM +1100, Tobin C. Harding wrote:
> > Checkpatch emits CHECK prefer kernel type. Source and header file use
> > C standard types uintN_t.
> > 
> > Replace C standard types with kernel types. uintN_t -> uN
> 
> Can you just replace one type at a time?  Makes it much easier to
> review.  As it is, this is almost impossible to verify you got it
> correct :(

Can do, no problem. Will include in v3.

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


[PATCH 1/2] Staging: wlan-ng: Fix sparse warnings by using appropriate endian types

2017-03-09 Thread Adrien Descamps
Fix some sparse warning by using correct endian types in structs and
local variables.
This patch only fix sparse warnings and do not change the logic.

Signed-off-by: Adrien Descamps 
---
Compile tested only
 drivers/staging/wlan-ng/hfa384x.h | 54 +--
 drivers/staging/wlan-ng/hfa384x_usb.c |  2 +-
 drivers/staging/wlan-ng/p80211conv.h  | 28 +-
 3 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x.h 
b/drivers/staging/wlan-ng/hfa384x.h
index 5f1851c..ba67b7a 100644
--- a/drivers/staging/wlan-ng/hfa384x.h
+++ b/drivers/staging/wlan-ng/hfa384x.h
@@ -482,7 +482,7 @@ struct hfa384x_tx_frame {
u8 address3[6];
u16 sequence_control;
u8 address4[6];
-   u16 data_len;   /* little endian format */
+   __le16 data_len;/* little endian format */
 
/*-- 802.3 Header Information --*/
 
@@ -801,41 +801,41 @@ struct hfa384x_usb_txfrm {
 } __packed;
 
 struct hfa384x_usb_cmdreq {
-   u16 type;
-   u16 cmd;
-   u16 parm0;
-   u16 parm1;
-   u16 parm2;
+   __le16 type;
+   __le16 cmd;
+   __le16 parm0;
+   __le16 parm1;
+   __le16 parm2;
u8 pad[54];
 } __packed;
 
 struct hfa384x_usb_wridreq {
-   u16 type;
-   u16 frmlen;
-   u16 rid;
+   __le16 type;
+   __le16 frmlen;
+   __le16 rid;
u8 data[HFA384x_RIDDATA_MAXLEN];
 } __packed;
 
 struct hfa384x_usb_rridreq {
-   u16 type;
-   u16 frmlen;
-   u16 rid;
+   __le16 type;
+   __le16 frmlen;
+   __le16 rid;
u8 pad[58];
 } __packed;
 
 struct hfa384x_usb_wmemreq {
-   u16 type;
-   u16 frmlen;
-   u16 offset;
-   u16 page;
+   __le16 type;
+   __le16 frmlen;
+   __le16 offset;
+   __le16 page;
u8 data[HFA384x_USB_RWMEM_MAXLEN];
 } __packed;
 
 struct hfa384x_usb_rmemreq {
-   u16 type;
-   u16 frmlen;
-   u16 offset;
-   u16 page;
+   __le16 type;
+   __le16 frmlen;
+   __le16 offset;
+   __le16 page;
u8 pad[56];
 } __packed;
 
@@ -854,16 +854,16 @@ struct hfa384x_usb_infofrm {
 
 struct hfa384x_usb_statusresp {
u16 type;
-   u16 status;
-   u16 resp0;
-   u16 resp1;
-   u16 resp2;
+   __le16 status;
+   __le16 resp0;
+   __le16 resp1;
+   __le16 resp2;
 } __packed;
 
 struct hfa384x_usb_rridresp {
u16 type;
-   u16 frmlen;
-   u16 rid;
+   __le16 frmlen;
+   __le16 rid;
u8 data[HFA384x_RIDDATA_MAXLEN];
 } __packed;
 
@@ -1408,7 +1408,7 @@ hfa384x_drvr_setconfig_async(struct hfa384x *hw,
 static inline int
 hfa384x_drvr_setconfig16_async(struct hfa384x *hw, u16 rid, u16 val)
 {
-   u16 value = cpu_to_le16(val);
+   __le16 value = cpu_to_le16(val);
 
return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
NULL, NULL);
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c 
b/drivers/staging/wlan-ng/hfa384x_usb.c
index 6134eba..6484877 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -2316,7 +2316,7 @@ int hfa384x_drvr_ramdl_write(struct hfa384x *hw, u32 
daddr, void *buf, u32 len)
 int hfa384x_drvr_readpda(struct hfa384x *hw, void *buf, unsigned int len)
 {
int result = 0;
-   u16 *pda = buf;
+   __le16 *pda = buf;
int pdaok = 0;
int morepdrs = 1;
int currpdr = 0;/* word offset of the current pdr */
diff --git a/drivers/staging/wlan-ng/p80211conv.h 
b/drivers/staging/wlan-ng/p80211conv.h
index 04bac2e..66332b1 100644
--- a/drivers/staging/wlan-ng/p80211conv.h
+++ b/drivers/staging/wlan-ng/p80211conv.h
@@ -101,20 +101,20 @@ void p80211skb_rxmeta_detach(struct sk_buff *skb);
  * Frame capture header.  (See doc/capturefrm.txt)
  */
 struct p80211_caphdr {
-   u32 version;
-   u32 length;
-   u64 mactime;
-   u64 hosttime;
-   u32 phytype;
-   u32 channel;
-   u32 datarate;
-   u32 antenna;
-   u32 priority;
-   u32 ssi_type;
-   s32 ssi_signal;
-   s32 ssi_noise;
-   u32 preamble;
-   u32 encoding;
+   __be32 version;
+   __be32 length;
+   __be64 mactime;
+   __be64 hosttime;
+   __be32 phytype;
+   __be32 channel;
+   __be32 datarate;
+   __be32 antenna;
+   __be32 priority;
+   __be32 ssi_type;
+   __be32 ssi_signal;
+   __be32 ssi_noise;
+   __be32 preamble;
+   __be32 encoding;
 };
 
 /* buffer free method pointer type */
-- 
2.1.4

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


[PATCH 2/2] Staging: wlan-ng: Fix endian error

2017-03-09 Thread Adrien Descamps
sparse report fixed:
drivers/staging//wlan-ng//hfa384x_usb.c:3517:35: warning: restricted __be64 
degrades to integer
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: warning: incorrect type in 
assignment (different base types)
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33:expected restricted __be64 
[usertype] mactime
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33:got unsigned long long

Computation on the value should be done when in machine format, not in big 
endian format.

Signed-off-by: Adrien Descamps 
---
Compile tested only
 drivers/staging/wlan-ng/hfa384x_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c 
b/drivers/staging/wlan-ng/hfa384x_usb.c
index 6484877..a812e55 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3513,7 +3513,7 @@ static void hfa384x_int_rxmonitor(struct wlandevice 
*wlandev,
 
caphdr->version = htonl(P80211CAPTURE_VERSION);
caphdr->length = htonl(sizeof(struct p80211_caphdr));
-   caphdr->mactime = __cpu_to_be64(rxdesc->time) * 1000;
+   caphdr->mactime = __cpu_to_be64(rxdesc->time * 1000);
caphdr->hosttime = __cpu_to_be64(jiffies);
caphdr->phytype = htonl(4); /* dss_dot11_b */
caphdr->channel = htonl(hw->sniff_channel);
-- 
2.1.4

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


Re: [PATCH v2 05/12] staging: ks7010: remove unnecessary parenthesis

2017-03-09 Thread Greg Kroah-Hartman
On Fri, Mar 10, 2017 at 07:08:28AM +1100, Tobin C. Harding wrote:
> On Thu, Mar 09, 2017 at 02:04:20PM +0100, Greg Kroah-Hartman wrote:
> > On Thu, Mar 09, 2017 at 03:47:05PM +1100, Tobin C. Harding wrote:
> > > Checkpatch emits CHECK: Unnecessary parentheses.
> > > 
> > > Remove unnecessary parentheses.
> > > 
> > > Signed-off-by: Tobin C. Harding 
> > > ---
> > >  drivers/staging/ks7010/ks_hostif.c | 24 
> > >  1 file changed, 12 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/drivers/staging/ks7010/ks_hostif.c 
> > > b/drivers/staging/ks7010/ks_hostif.c
> > > index a354e34e..b75ef1d6 100644
> > > --- a/drivers/staging/ks7010/ks_hostif.c
> > > +++ b/drivers/staging/ks7010/ks_hostif.c
> > > @@ -36,7 +36,7 @@ inline u8 get_BYTE(struct ks_wlan_private *priv)
> > >  {
> > >   u8 data;
> > >  
> > > - data = *(priv->rxp)++;
> > > + data = *priv->rxp++;
> > 
> > Are you sure this is ok?  I would have to dig out a book to find the
> > ordering rules here...
> 
> I also had to get out K&R. The reason I decided to look it up and make
> the change wast that with the parenthesis I also still needed to think
> about the precedence. Adding the parenthesis in no way makes the
> precedence *more* clear. And the checkpatch warning of course.
> 
> I ran this code to check it
> 
> #include 
> #include 
> 
> /*
>  * Confirm precedence 
>  */
> 
> int main(void)
> {
> uint8_t buf[3];
> uint8_t *bp = buf;
> uint8_t data;
> 
> buf[0] = 0;
> buf[1] = 1;
> buf[2] = 2;
> 
> printf("buf = [%d, %d, %d]\n",(int)buf[0], (int)buf[1], (int)buf[2]);
> printf("bp before: %d\n", (int)*bp);
>   
> /* data = *(bp)++; */
> data = *bp++;
> 
> printf("bp after: %d\n", (int)*bp);
> 
> return(0);
> }

Great, so everyone has to check it is valid, so please leave it alone.
We write code for people to read, and be able to modify in the future.
Don't force someone to have to really think hard about something trivial
like this.

thanks,

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


outreachy

2017-03-09 Thread Julia Lawall
Hello,

I discussed the issue of outreachy patches for bcm with Greg, and we are
not convinced that not having the patches CCd to you is such a good idea.
While we don't want to spam you with noise, some of the applicants are
starting to make more significant changes that it could be useful for you
to be aware of.

Could we try a compromise where you are not CCd on whitespace patches, but
you are CCd on patches that actually modify the code?

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


Re: outreachy

2017-03-09 Thread Scott Branden

Hi Julia,

On 17-03-09 12:36 PM, Julia Lawall wrote:

Hello,

I discussed the issue of outreachy patches for bcm with Greg, and we are
not convinced that not having the patches CCd to you is such a good idea.
While we don't want to spam you with noise, some of the applicants are
starting to make more significant changes that it could be useful for you
to be aware of.

Could we try a compromise where you are not CCd on whitespace patches, but
you are CCd on patches that actually modify the code?
All I'm asking is you work through your outreachy patches internal first 
to get rid of the most basic mistakes and email traffic it is geerating. 
 Once that learning process is through then they can be sent out like 
any other patches to the kernel mailing lists and maintainers.


thanks,
julia



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


Re: outreachy

2017-03-09 Thread Stephen Warren

On 03/09/2017 01:51 PM, Scott Branden wrote:

Hi Julia,

On 17-03-09 12:36 PM, Julia Lawall wrote:

Hello,

I discussed the issue of outreachy patches for bcm with Greg, and we are
not convinced that not having the patches CCd to you is such a good idea.
While we don't want to spam you with noise, some of the applicants are
starting to make more significant changes that it could be useful for you
to be aware of.

Could we try a compromise where you are not CCd on whitespace patches,
but
you are CCd on patches that actually modify the code?

>

All I'm asking is you work through your outreachy patches internal first
to get rid of the most basic mistakes and email traffic it is geerating.
 Once that learning process is through then they can be sent out like
any other patches to the kernel mailing lists and maintainers.


+1 from me too; I find these patches rather high volume and had to add a 
filter to keep them out of my primary inbox. I don't know what process 
is in place, but I would suggest:


1) Senders send everything to the outreachy list, where they are 
reviewed for basic issues, like learning to use git send-email, learning 
checkpatch, etc. In this case, only send the patch to the outreachy 
mailing list and nowhere else.


2) Once a patch has passed review there, then send the patch to the 
regular kernel mailing list just like any other patch; follow the output 
of get_maintainers.pl.


We have something like (1) inside NVIDIA for new contributors and 
pre-upstreaming IP review. It helps all the newcomers, but without 
requiring anyone involved in (2) to change behaviour.


The process I suggest is very much inline with the typically suggested 
"asking questions" process: (1) read docs yourself (2) ask local 
contacts for help, (3) start asking wider audiences for help.

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


Re: [PATCH v2 05/12] staging: ks7010: remove unnecessary parenthesis

2017-03-09 Thread Tobin C. Harding
On Thu, Mar 09, 2017 at 09:30:40PM +0100, Greg Kroah-Hartman wrote:
> On Fri, Mar 10, 2017 at 07:08:28AM +1100, Tobin C. Harding wrote:
> > On Thu, Mar 09, 2017 at 02:04:20PM +0100, Greg Kroah-Hartman wrote:
> > > On Thu, Mar 09, 2017 at 03:47:05PM +1100, Tobin C. Harding wrote:
> > > > Checkpatch emits CHECK: Unnecessary parentheses.
> > > > 
> > > > Remove unnecessary parentheses.
> > > > 
> > > > Signed-off-by: Tobin C. Harding 
> > > > ---
> > > >  drivers/staging/ks7010/ks_hostif.c | 24 
> > > >  1 file changed, 12 insertions(+), 12 deletions(-)
> > > > 
> > > > diff --git a/drivers/staging/ks7010/ks_hostif.c 
> > > > b/drivers/staging/ks7010/ks_hostif.c
> > > > index a354e34e..b75ef1d6 100644
> > > > --- a/drivers/staging/ks7010/ks_hostif.c
> > > > +++ b/drivers/staging/ks7010/ks_hostif.c
> > > > @@ -36,7 +36,7 @@ inline u8 get_BYTE(struct ks_wlan_private *priv)
> > > >  {
> > > > u8 data;
> > > >  
> > > > -   data = *(priv->rxp)++;
> > > > +   data = *priv->rxp++;
> > > 
> > > Are you sure this is ok?  I would have to dig out a book to find the
> > > ordering rules here...
> > 
> > I also had to get out K&R. The reason I decided to look it up and make
> > the change wast that with the parenthesis I also still needed to think
> > about the precedence. Adding the parenthesis in no way makes the
> > precedence *more* clear. And the checkpatch warning of course.
> > 
> > I ran this code to check it
> > 
> > #include 
> > #include 
> > 
> > /*
> >  * Confirm precedence 
> >  */
> > 
> > int main(void)
> > {
> > uint8_t buf[3];
> > uint8_t *bp = buf;
> > uint8_t data;
> > 
> > buf[0] = 0;
> > buf[1] = 1;
> > buf[2] = 2;
> > 
> > printf("buf = [%d, %d, %d]\n",(int)buf[0], (int)buf[1], 
> > (int)buf[2]);
> > printf("bp before: %d\n", (int)*bp);
> >   
> > /* data = *(bp)++; */
> > data = *bp++;
> > 
> > printf("bp after: %d\n", (int)*bp);
> > 
> > return(0);
> > }
> 
> Great, so everyone has to check it is valid, so please leave it alone.
> We write code for people to read, and be able to modify in the future.
> Don't force someone to have to really think hard about something trivial
> like this.

Understood. Will drop this change from next version.

Greg please stop reading this email now.

thanks,
Tobin.


For correctness; the dummy code above is not complete. It should be

#include 
#include 

/*
 * Confirm statements equivalent
 *
 * data = *(priv->rxp)++;
 * data = *priv->rxp++;
 */

int one = 1;
int two = 2;

struct foo_t {
int *v;
}foos[] = {
{&one},
{&two},
};

int main(void)
{
struct foo_t *fp = foos;

int data = -1;

printf("before: fp->v: %d (%d) data: %d\n", *fp->v, *(fp->v), data);

data = *(fp->v)++;
/* data = *fp->v++; */

printf("after: fp->v: %d (%d) data: %d\n", *fp->v, *(fp->v), data);

return(0);
}

I was wrong *(foo->baz)++ is easier to read than *foo->baz++

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


Re: outreachy

2017-03-09 Thread Greg KH
On Thu, Mar 09, 2017 at 01:56:49PM -0700, Stephen Warren wrote:
> On 03/09/2017 01:51 PM, Scott Branden wrote:
> > Hi Julia,
> > 
> > On 17-03-09 12:36 PM, Julia Lawall wrote:
> > > Hello,
> > > 
> > > I discussed the issue of outreachy patches for bcm with Greg, and we are
> > > not convinced that not having the patches CCd to you is such a good idea.
> > > While we don't want to spam you with noise, some of the applicants are
> > > starting to make more significant changes that it could be useful for you
> > > to be aware of.
> > > 
> > > Could we try a compromise where you are not CCd on whitespace patches,
> > > but
> > > you are CCd on patches that actually modify the code?
> >
> > All I'm asking is you work through your outreachy patches internal first
> > to get rid of the most basic mistakes and email traffic it is geerating.
> >  Once that learning process is through then they can be sent out like
> > any other patches to the kernel mailing lists and maintainers.
> 
> +1 from me too; I find these patches rather high volume and had to add a
> filter to keep them out of my primary inbox.

Hah!  That's the joy of being a maintainer of a driver in staging.  Even
if you filter out outreachy, you are going to get a lot of "basic
mistakes" and other type patches cc:ed to you.

I strongly suggest, that if you all don't like this type of stuff,
either:
- work to get the code out of staging as soon as possible (i.e.
  send me coding style fixes for everything right now, and then
  fix up the rest of the stuff.)
- take yourself off the maintainer list for this code.

It's your choice, outreachy right now is a lot of patches, but again,
it's not going to keep you from getting the "basic" stuff sent to you
in ways that is totally wrong.

thanks,

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


Re: [Outreachy kernel] [PATCH 5/6] staging: speakup: Alignment should match open parenthesis

2017-03-09 Thread Julia Lawall


On Fri, 10 Mar 2017, Arushi Singhal wrote:

> Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".
>
> Signed-off-by: Arushi Singhal 
> ---
>   if (synth_request_region(speakup_info.port_tts - 1,
> - SYNTH_IO_EXTENT)) {
> + SYNTH_IO_EXTENT)) {
>   pr_warn("sorry, port already reserved\n");
>   return -EBUSY;
>   }
> @@ -270,7 +270,7 @@ static int synth_probe(struct spk_synth *synth)
>   } else {
>   for (i = 0; synth_portlist[i]; i++) {
>   if (synth_request_region(synth_portlist[i],
> - SYNTH_IO_EXTENT)) {
> + SYNTH_IO_EXTENT)) {

These are not correct.  SYNTH_IO_EXTENT should be lines up with the right
side of the ( of the argument list of which it is an element.  So the
original code is either correct or close to correct.

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


Re: outreachy

2017-03-09 Thread Florian Fainelli
On 03/09/2017 01:20 PM, Greg KH wrote:
> On Thu, Mar 09, 2017 at 01:56:49PM -0700, Stephen Warren wrote:
>> On 03/09/2017 01:51 PM, Scott Branden wrote:
>>> Hi Julia,
>>>
>>> On 17-03-09 12:36 PM, Julia Lawall wrote:
 Hello,

 I discussed the issue of outreachy patches for bcm with Greg, and we are
 not convinced that not having the patches CCd to you is such a good idea.
 While we don't want to spam you with noise, some of the applicants are
 starting to make more significant changes that it could be useful for you
 to be aware of.

 Could we try a compromise where you are not CCd on whitespace patches,
 but
 you are CCd on patches that actually modify the code?
>>>
>>> All I'm asking is you work through your outreachy patches internal first
>>> to get rid of the most basic mistakes and email traffic it is geerating.
>>>  Once that learning process is through then they can be sent out like
>>> any other patches to the kernel mailing lists and maintainers.
>>
>> +1 from me too; I find these patches rather high volume and had to add a
>> filter to keep them out of my primary inbox.
> 
> Hah!  That's the joy of being a maintainer of a driver in staging.  Even
> if you filter out outreachy, you are going to get a lot of "basic
> mistakes" and other type patches cc:ed to you.
> 
> I strongly suggest, that if you all don't like this type of stuff,
> either:
>   - work to get the code out of staging as soon as possible (i.e.
> send me coding style fixes for everything right now, and then
> fix up the rest of the stuff.)
>   - take yourself off the maintainer list for this code.

Keep in mind that most people on this CC list are getting these patches
because of the bcm283* regular expression, and maybe that's what needs
fixing here in the first place.

Incidentally, Stephen did send a patch to get him removed from the
MAINTAINERS entry for Raspberry Pi stuff, so I guess, problem solved for
him. We still have a ton of people from Broadcom who are going to
receive these emails, with mild interest in staging patches.

> 
> It's your choice, outreachy right now is a lot of patches, but again,
> it's not going to keep you from getting the "basic" stuff sent to you
> in ways that is totally wrong.

That is absolutely true, but the thing is that we really got a big spike
of patch submissions lately, and that was totally not accepted. I am not
asking for a "heads-up" email telling people that they are going to
receive more traffic than usual (because that would be too much over
head), but if there was an internal review first on the outreachy
mailing-list and second a proper submission which is going to pass your
acceptance criteria, we would be de facto reducing the amount of emails
that we received.

The outreachy list obviously has people like you and Julia who are
willing to help and provide feedback, so I really don't see what's the
problem in setting up a two tier review here, it does not change
anything for you, but it does change a lot for us.
-- 
Florian
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v1 0/7] staging: gc2235: Multiple checkpatch issues

2017-03-09 Thread simran singhal
v1:
  -change the subject of all the patches of the patch-series


simran singhal (7):
  staging: gc2235: Remove unnecessary typecast of c90 int constant
  staging: gc2235: Add blank line after a declaration
  staging: gc2235: Replace NULL with "!"
  staging: gc2235: Remove blank line before '}' and after '{' braces
  staging: gc2235: Remove multiple assignments
  staging: gc2235: Use x instead of x != NULL
  staging: gc2235: Do not use multiple blank lines

 drivers/staging/media/atomisp/i2c/gc2235.c | 32 --
 1 file changed, 17 insertions(+), 15 deletions(-)

-- 
2.7.4

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


[PATCH v1 4/7] staging: gc2235: Remove blank line before '}' and after '{' braces

2017-03-09 Thread simran singhal
Remove unneeded blank lines preceding/following '}' and '{' braces, as
pointed out by checkpatch.

This patch addresses the following checkpatch checks:

CHECK: Blank lines aren't necessary before a close brace '}'
CHECK: Blank lines aren't necessary after an open brace '{'

Signed-off-by: simran singhal 
---
 drivers/staging/media/atomisp/i2c/gc2235.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c 
b/drivers/staging/media/atomisp/i2c/gc2235.c
index 2ef876a..198df22 100644
--- a/drivers/staging/media/atomisp/i2c/gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/gc2235.c
@@ -788,7 +788,6 @@ static int gc2235_set_fmt(struct v4l2_subdev *sd,
  struct v4l2_subdev_pad_config *cfg,
  struct v4l2_subdev_format *format)
 {
-
struct v4l2_mbus_framefmt *fmt = &format->format;
struct gc2235_device *dev = to_gc2235_sensor(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -1070,7 +1069,6 @@ static int gc2235_enum_frame_size(struct v4l2_subdev *sd,
fse->max_height = gc2235_res[index].height;
 
return 0;
-
 }
 
 static int gc2235_g_skip_frames(struct v4l2_subdev *sd, u32 *frames)
@@ -1228,7 +1226,6 @@ static int init_gc2235(void)
 
 static void exit_gc2235(void)
 {
-
i2c_del_driver(&gc2235_driver);
 }
 
-- 
2.7.4

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


[PATCH v1 5/7] staging: gc2235: Remove multiple assignments

2017-03-09 Thread simran singhal
Remove multiple assignments by factorizing them. Problem found using
checkpatch.pl

CHECK: multiple assignments should be avoided

Signed-off-by: simran singhal 
---
 drivers/staging/media/atomisp/i2c/gc2235.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c 
b/drivers/staging/media/atomisp/i2c/gc2235.c
index 198df22..165dcb3 100644
--- a/drivers/staging/media/atomisp/i2c/gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/gc2235.c
@@ -259,7 +259,8 @@ static int gc2235_get_intg_factor(struct i2c_client *client,
return -EINVAL;
 
/* pixel clock calculattion */
-   buf->vt_pix_clk_freq_mhz = dev->vt_pix_clk_freq_mhz = 3000;
+   buf->vt_pix_clk_freq_mhz = 3000;
+   dev->vt_pix_clk_freq_mhz = 3000;
 
/* get integration time */
buf->coarse_integration_time_min = GC2235_COARSE_INTG_TIME_MIN;
-- 
2.7.4

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


[PATCH v1 1/7] staging: gc2235: Remove unnecessary typecast of c90 int constant

2017-03-09 Thread simran singhal
This patch removes unnecessary typecast of c90 int constant.

WARNING: Unnecessary typecast of c90 int constant

Signed-off-by: simran singhal 
---
 drivers/staging/media/atomisp/i2c/gc2235.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c 
b/drivers/staging/media/atomisp/i2c/gc2235.c
index 3dd5e7f..3f2b11ec 100644
--- a/drivers/staging/media/atomisp/i2c/gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/gc2235.c
@@ -706,10 +706,10 @@ static int distance(struct gc2235_resolution *res, u32 w, 
u32 h)
h_ratio = ((res->height << 13) / h);
if (h_ratio == 0)
return -1;
-   match   = abs(((w_ratio << 13) / h_ratio) - ((int)8192));
+   match   = abs(((w_ratio << 13) / h_ratio) - 8192);
 
-   if ((w_ratio < (int)8192) || (h_ratio < (int)8192)  ||
-   (match > LARGEST_ALLOWED_RATIO_MISMATCH))
+   if ((w_ratio < 8192) || (h_ratio < 8192)  ||
+   (match > LARGEST_ALLOWED_RATIO_MISMATCH))
return -1;
 
return w_ratio + h_ratio;
-- 
2.7.4

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


[PATCH v1 2/7] staging: gc2235: Add blank line after a declaration

2017-03-09 Thread simran singhal
Add blank line after a declaration. Problem found
using checkpatch.

This patch fixes these warning messages found by checkpatch.pl:
WARNING : Missing a blank line after declarations.

Signed-off-by: simran singhal 
---
 drivers/staging/media/atomisp/i2c/gc2235.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c 
b/drivers/staging/media/atomisp/i2c/gc2235.c
index 3f2b11ec..7de7e24 100644
--- a/drivers/staging/media/atomisp/i2c/gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/gc2235.c
@@ -359,6 +359,7 @@ static long __gc2235_set_exposure(struct v4l2_subdev *sd, 
int coarse_itg,
u16 coarse_integration = (u16)coarse_itg;
int ret = 0;
u16 expo_coarse_h, expo_coarse_l, gain_val = 0xF0, gain_val2 = 0xF0;
+
expo_coarse_h = coarse_integration>>8;
expo_coarse_l = coarse_integration & 0xff;
 
@@ -410,6 +411,7 @@ static long gc2235_s_exposure(struct v4l2_subdev *sd,
/* we should not accept the invalid value below. */
if (gain == 0) {
struct i2c_client *client = v4l2_get_subdevdata(sd);
+
v4l2_err(client, "%s: invalid value\n", __func__);
return -EINVAL;
}
@@ -546,6 +548,7 @@ static int is_init;
 static int gc2235_init(struct v4l2_subdev *sd)
 {
int ret = 0;
+
ret = __gc2235_init(sd);
 
return ret;
@@ -759,6 +762,7 @@ static int startup(struct v4l2_subdev *sd)
struct gc2235_device *dev = to_gc2235_sensor(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
int ret = 0;
+
if (is_init == 0) {
/* force gc2235 to do a reset in res change, otherwise it
* can not output normal after switching res. and it is not
@@ -893,6 +897,7 @@ static int gc2235_s_stream(struct v4l2_subdev *sd, int 
enable)
struct gc2235_device *dev = to_gc2235_sensor(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
int ret;
+
mutex_lock(&dev->input_lock);
 
if (enable)
@@ -1007,6 +1012,7 @@ static int gc2235_s_parm(struct v4l2_subdev *sd,
struct v4l2_streamparm *param)
 {
struct gc2235_device *dev = to_gc2235_sensor(sd);
+
dev->run_mode = param->parm.capture.capturemode;
 
mutex_lock(&dev->input_lock);
@@ -1112,6 +1118,7 @@ static int gc2235_remove(struct i2c_client *client)
 {
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct gc2235_device *dev = to_gc2235_sensor(sd);
+
dev_dbg(&client->dev, "gc2235_remove...\n");
 
if (dev->platform_data->platform_deinit)
-- 
2.7.4

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


[PATCH v1 3/7] staging: gc2235: Replace NULL with "!"

2017-03-09 Thread simran singhal
Use ! in comparison tests using "==NULL" rather than moving the
"==NULL" to the right side of the test.

Addesses multiple instances of the checkpatch.pl warning:
WARNING: Comparisons should place the constant on the right side of the
test

Signed-off-by: simran singhal 
---
 drivers/staging/media/atomisp/i2c/gc2235.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c 
b/drivers/staging/media/atomisp/i2c/gc2235.c
index 7de7e24..2ef876a 100644
--- a/drivers/staging/media/atomisp/i2c/gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/gc2235.c
@@ -603,7 +603,7 @@ static int power_up(struct v4l2_subdev *sd)
struct i2c_client *client = v4l2_get_subdevdata(sd);
int ret;
 
-   if (NULL == dev->platform_data) {
+   if (!dev->platform_data) {
dev_err(&client->dev,
"no camera_sensor_platform_data");
return -ENODEV;
@@ -647,7 +647,7 @@ static int power_down(struct v4l2_subdev *sd)
struct i2c_client *client = v4l2_get_subdevdata(sd);
int ret = 0;
 
-   if (NULL == dev->platform_data) {
+   if (!dev->platform_data) {
dev_err(&client->dev,
"no camera_sensor_platform_data");
return -ENODEV;
-- 
2.7.4

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


[PATCH v1 6/7] staging: gc2235: Use x instead of x != NULL

2017-03-09 Thread simran singhal
Use x instead of x != NULL .
This patch removes the explicit NULL comparisons.This issue is found by
checkpatch.pl script.

Signed-off-by: simran singhal 
---
 drivers/staging/media/atomisp/i2c/gc2235.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c 
b/drivers/staging/media/atomisp/i2c/gc2235.c
index 165dcb3..40a5a2f 100644
--- a/drivers/staging/media/atomisp/i2c/gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/gc2235.c
@@ -255,7 +255,7 @@ static int gc2235_get_intg_factor(struct i2c_client *client,
u16 reg_val, reg_val_h, dummy;
int ret;
 
-   if (info == NULL)
+   if (!info)
return -EINVAL;
 
/* pixel clock calculattion */
@@ -797,7 +797,7 @@ static int gc2235_set_fmt(struct v4l2_subdev *sd,
int idx;
 
gc2235_info = v4l2_get_subdev_hostdata(sd);
-   if (gc2235_info == NULL)
+   if (!gc2235_info)
return -EINVAL;
if (format->pad)
return -EINVAL;
@@ -917,7 +917,7 @@ static int gc2235_s_config(struct v4l2_subdev *sd,
struct i2c_client *client = v4l2_get_subdevdata(sd);
int ret = 0;
 
-   if (platform_data == NULL)
+   if (!platform_data)
return -ENODEV;
 
dev->platform_data =
-- 
2.7.4

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


[PATCH v1 7/7] staging: gc2235: Do not use multiple blank lines

2017-03-09 Thread simran singhal
Remove multiple blank lines. Problem found using checkpatch.pl
"CHECK: Please don't use multiple blank lines".

Signed-off-by: simran singhal 
---
 drivers/staging/media/atomisp/i2c/gc2235.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c 
b/drivers/staging/media/atomisp/i2c/gc2235.c
index 40a5a2f..b97a74b 100644
--- a/drivers/staging/media/atomisp/i2c/gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/gc2235.c
@@ -244,7 +244,6 @@ static int gc2235_g_fnumber_range(struct v4l2_subdev *sd, 
s32 *val)
return 0;
 }
 
-
 static int gc2235_get_intg_factor(struct i2c_client *client,
struct camera_mipi_info *info,
const struct gc2235_resolution *res)
@@ -388,7 +387,6 @@ static long __gc2235_set_exposure(struct v4l2_subdev *sd, 
int coarse_itg,
return ret;
 }
 
-
 static int gc2235_set_exposure(struct v4l2_subdev *sd, int exposure,
int gain, int digitgain)
 {
@@ -909,7 +907,6 @@ static int gc2235_s_stream(struct v4l2_subdev *sd, int 
enable)
return ret;
 }
 
-
 static int gc2235_s_config(struct v4l2_subdev *sd,
   int irq, void *platform_data)
 {
-- 
2.7.4

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


Re: [PATCH] net: hyperv: use new api ethtool_{get|set}_link_ksettings

2017-03-09 Thread Stephen Hemminger
On Wed,  8 Mar 2017 23:41:04 +0100
Philippe Reynes  wrote:

> The ethtool api {get|set}_settings is deprecated.
> We move this driver to new api {get|set}_link_ksettings.
> 
> As I don't have the hardware, I'd be very pleased if
> someone may test this patch.
> 
> Signed-off-by: Philippe Reynes 

No change in behavior. Same as before driver always reports duplex UNKNOWN and 
speed change
is not useful.

Tested-by: Stephen Hemminger 


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


Re: [PATCH v4 13/36] [media] v4l2: add a frame timeout event

2017-03-09 Thread Steve Longerbeam



On 03/05/2017 02:41 PM, Russell King - ARM Linux wrote:

On Sat, Mar 04, 2017 at 04:37:43PM -0800, Steve Longerbeam wrote:



On 03/04/2017 02:56 AM, Sakari Ailus wrote:

That's a bit of a special situation --- still there are alike conditions on
existing hardware. You should return the buffers to the user with the ERROR
flag set --- or return -EIO from VIDIOC_DQBUF, if the condition will
persist:


On i.MX an EOF timeout is not recoverable without a stream restart, so
I decided to call vb2_queue_error() when the timeout occurs (instead
of sending an event). The user will then get -EIO when it attempts to
queue or dequeue further buffers.


I'm not sure that statement is entirely accurate.  With the IMX219
camera, I _could_ (with previous iterations of the iMX capture code)
stop it streaming, wait a while, and restart it, and everything
continues to work.


Hi Russell, did you see the "EOF timeout" kernel error message when you
stopped the IMX219 from streaming? Only a "EOF timeout" message
indicates the unrecoverable case.




Are you sure that the problem you have here is caused by the iMX6
rather than the ADV718x CVBS decoder (your initial description said
it was the decoder.)


Actually yes I did say it was the adv718x, but in fact I doubt the
adv718x has abruptly stopped data transmission on the bt.656 bus.
I actually suspect the IPU, specifically the CSI. In our experience
the CSI is rather sensitive to glitches and/or truncated frames on the
bt.656 bus and can easily loose vertical sync, and/or lock-up.

Steve



If it _is_ the decoder that's going wrong, that doesn't justify
cripping the rest of the driver for one instance of broken hardware
that _might_ be attached to it.


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


[PATCH] Staging: iio: return expression instead of return ret

2017-03-09 Thread Bo Yu

The following Coccinelle script was used to detect this:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
  e;
-return ret;

Signed-off-by: Bo YU 
---
  drivers/staging/iio/meter/ade7754.c |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7754.c 
b/drivers/staging/iio/meter/ade7754.c
index 024463a11c47..19f8cb144768 100644
--- a/drivers/staging/iio/meter/ade7754.c
+++ b/drivers/staging/iio/meter/ade7754.c
@@ -349,9 +349,8 @@ static int ade7754_set_irq(struct device *dev, bool enable)
else
irqen &= ~BIT(14);

-   ret = ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);
+   return ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);

-   return ret;
  }

  /* Power down the device */
--
1.7.10.4

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


[PATCH v5 02/39] [media] dt-bindings: Add bindings for i.MX media driver

2017-03-09 Thread Steve Longerbeam
Add bindings documentation for the i.MX media driver.

Signed-off-by: Steve Longerbeam 
---
 Documentation/devicetree/bindings/media/imx.txt | 74 +
 1 file changed, 74 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/imx.txt

diff --git a/Documentation/devicetree/bindings/media/imx.txt 
b/Documentation/devicetree/bindings/media/imx.txt
new file mode 100644
index 000..3059c06
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/imx.txt
@@ -0,0 +1,74 @@
+Freescale i.MX Media Video Device
+=
+
+Video Media Controller node
+---
+
+This is the media controller node for video capture support. It is a
+virtual device that lists the camera serial interface nodes that the
+media device will control.
+
+Required properties:
+- compatible : "fsl,imx-capture-subsystem";
+- ports  : Should contain a list of phandles pointing to camera
+   sensor interface ports of IPU devices
+
+example:
+
+capture-subsystem {
+   compatible = "fsl,imx-capture-subsystem";
+   ports = <&ipu1_csi0>, <&ipu1_csi1>;
+};
+
+fim child node
+--
+
+This is an optional child node of the ipu_csi port nodes. If present and
+available, it enables the Frame Interval Monitor. Its properties can be
+used to modify the method in which the FIM measures frame intervals.
+Refer to Documentation/media/v4l-drivers/imx.rst for more info on the
+Frame Interval Monitor.
+
+Optional properties:
+- fsl,input-capture-channel: an input capture channel and channel flags,
+specified as . The channel number
+must be 0 or 1. The flags can be
+IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, or
+IRQ_TYPE_EDGE_BOTH, and specify which input
+capture signal edge will trigger the input
+capture event. If an input capture channel is
+specified, the FIM will use this method to
+measure frame intervals instead of via the EOF
+interrupt. The input capture method is much
+preferred over EOF as it is not subject to
+interrupt latency errors. However it requires
+routing the VSYNC or FIELD output signals of
+the camera sensor to one of the i.MX input
+capture pads (SD1_DAT0, SD1_DAT1), which also
+gives up support for SD1.
+
+
+mipi_csi2 node
+--
+
+This is the device node for the MIPI CSI-2 Receiver, required for MIPI
+CSI-2 sensors.
+
+Required properties:
+- compatible   : "fsl,imx6-mipi-csi2", "snps,dw-mipi-csi2";
+- reg   : physical base address and length of the register set;
+- clocks   : the MIPI CSI-2 receiver requires three clocks: hsi_tx
+ (the D-PHY clock), video_27m (D-PHY PLL reference
+ clock), and eim_podf;
+- clock-names  : must contain "dphy", "ref", "pix";
+- port@*: five port nodes must exist, containing endpoints
+ connecting to the source and sink devices according to
+ of_graph bindings. The first port is an input port,
+ connecting with a MIPI CSI-2 source, and ports 1
+ through 4 are output ports connecting with parallel
+ bus sink endpoint nodes and correspond to the four
+ MIPI CSI-2 virtual channel outputs.
+
+Optional properties:
+- interrupts   : must contain two level-triggered interrupts,
+ in order: 100 and 101;
-- 
2.7.4

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


[PATCH v5 00/39] i.MX Media Driver

2017-03-09 Thread Steve Longerbeam
In version 5:

- ov5640: renamed "pwdn-gpios" to "powerdown-gpios"

- ov5640: add mutex lock around the subdev op entry points.

- ov5640: don't attempt to program the new mode in ov5640_set_fmt().
  Instead set a new flag, pending_mode_change, and program the new
  mode at s_stream() if flag is set.

- ov5640: implement [gs]_frame_interval. As part of that, create
  ov5640_try_frame_interval(), which is used by both [gs]_frame_interval
  and [gs]_parm.

- ov5640: don't attempt to set controls in ov5640_s_ctrl(), or at
  mode change, do it instead after first power-up.

- video-multiplexer: include link_validate in media_entity_operations.

- video-multiplexer: enforce that output pad frame interval must match
  input pad frame interval in vidsw_s_frame_interval().

- video-multiplexer: initialize frame interval to a default 30 fps.

- mipi csi-2: renamed "cfg" clock name property to "ref". This is the
  27 MHz mipi csi-2 PLL reference clock.

- mipi csi-2: create a hsfreq_map[] table based on
  https://community.nxp.com/docs/DOC-94312. Use it to select
  a hsfreqrange_sel value when programming the D-PHY, based on
  a max Mbps per lane. This is computed from the source subdev
  via V4L2_CID_LINK_FREQ control, and if the subdev doesn't implement
  that control, use a default hard-coded max Mbps per lane.

- added required ports property description to imx-media binding doc.

- removed event V4L2_EVENT_FRAME_TIMEOUT. On a frame timeout, which
  is always unrecoverable, call vb2_queue_error() instead.

- export the remaining custom events to V4L2_EVENT_FRAME_INTERVAL_ERROR
  and V4L2_EVENT_NEW_FRAME_BEFORE_EOF.

- vdic: use V4L2_CID_DEINTERLACING_MODE for motion compensation control
  instead of a custom control.

- add v4l2_subdev_link_validate_frame_interval(). Call this in the
  link_validate imx-media subdev callbacks and video-multiplexer.

- fix subdev event registration: implementation of subscribe_event()
  and unsubscribe_event() subdev ops were missing.

- all calls from the pipeline to the sensor subdev have been removed.
  Only the CSI subdev still refers to a sensor, and only to retrieve
  its media bus config, which is necessary to setup the CSI interface.

- add mutex locks around the imx-media subdev op entry points.

- completed the propagation of all pad format parameters from sink
  pads to source pads within every imx-media subdev.

- implement [gs]_frame_interval in all the imx-media subdevs.

- imx-ic-prpencvf: there isn't necessarily a CSI subdev in the pipeline
  in the future, so make sure this is optional when calling the CSI's
  FIM.

- the source pads that attach to capture device nodes now require the
  IPU internal pixel codes. The capture device translates these to
  v4l2 fourcc memory formats.

- fix control inheritance to the capture device. When the pipeline
  was modified, the inherited controls were not being refreshed.
  v4l2_pipeline_inherit_controls() is now called only in imx-media
  link_notify() callback when a pipelink link is disabled or modified.
  imx_media_find_pipeline_video_device() is created to locate the
  capture device in the pipeline.

- fix a possible race when propagating formats to the capture device.
  The subdevs and capture device use different mutex locks when setting
  formats. imx_media_capture_device_set_format() is created which acquires
  the capture device mutex when updating the capture device format.

- verify all subdevs were bound in the async completion callback.
 

Philipp Zabel (7):
  [media] dt-bindings: Add bindings for video-multiplexer device
  ARM: dts: imx6qdl: Add mipi_ipu1/2 multiplexers, mipi_csi, and their
connections
  add mux and video interface bridge entity functions
  platform: add video-multiplexer subdevice driver
  media: imx: csi: fix crop rectangle changes in set_fmt
  media: imx: csi: add frame skipping support
  media: imx: csi: fix crop rectangle reset in sink set_fmt

Russell King (4):
  media: imx: add support for bayer formats
  media: imx: csi: add support for bayer formats
  media: imx: mipi-csi2: enable setting and getting of frame rates
  media: imx: csi/fim: add support for frame intervals

Steve Longerbeam (28):
  [media] dt-bindings: Add bindings for i.MX media driver
  [media] dt/bindings: Add bindings for OV5640
  ARM: dts: imx6qdl: Add compatible, clocks, irqs to MIPI CSI-2 node
  ARM: dts: imx6qdl: add capture-subsystem device
  ARM: dts: imx6qdl-sabrelite: remove erratum ERR006687 workaround
  ARM: dts: imx6-sabrelite: add OV5642 and OV5640 camera sensors
  ARM: dts: imx6-sabresd: add OV5642 and OV5640 camera sensors
  ARM: dts: imx6-sabreauto: create i2cmux for i2c3
  ARM: dts: imx6-sabreauto: add reset-gpios property for max7310_b
  ARM: dts: imx6-sabreauto: add pinctrl for gpt input capture
  ARM: dts: imx6-sabreauto: add the ADV7180 video decoder
  [media] v4l2: add a frame interval error event
  [media] v4l2: add a new-frame before end-of-frame event
  [media] v4l2-mc: add a function to i

[PATCH v5 01/39] [media] dt-bindings: Add bindings for video-multiplexer device

2017-03-09 Thread Steve Longerbeam
From: Philipp Zabel 

Add bindings documentation for the video multiplexer device.

Signed-off-by: Sascha Hauer 
Signed-off-by: Philipp Zabel 
Signed-off-by: Steve Longerbeam 
---
 .../bindings/media/video-multiplexer.txt   | 59 ++
 1 file changed, 59 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/media/video-multiplexer.txt

diff --git a/Documentation/devicetree/bindings/media/video-multiplexer.txt 
b/Documentation/devicetree/bindings/media/video-multiplexer.txt
new file mode 100644
index 000..9d133d9
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/video-multiplexer.txt
@@ -0,0 +1,59 @@
+Video Multiplexer
+=
+
+Video multiplexers allow to select between multiple input ports. Video received
+on the active input port is passed through to the output port. Muxes described
+by this binding may be controlled by a syscon register bitfield or by a GPIO.
+
+Required properties:
+- compatible : should be "video-multiplexer"
+- reg: should be register base of the register containing the control bitfield
+- bit-mask: bitmask of the control bitfield in the control register
+- bit-shift: bit offset of the control bitfield in the control register
+- gpios: alternatively to reg, bit-mask, and bit-shift, a single GPIO phandle
+  may be given to switch between two inputs
+- #address-cells: should be <1>
+- #size-cells: should be <0>
+- port@*: at least three port nodes containing endpoints connecting to the
+  source and sink devices according to of_graph bindings. The last port is
+  the output port, all others are inputs.
+
+Example:
+
+syscon {
+   compatible = "syscon", "simple-mfd";
+
+   mux {
+   compatible = "video-multiplexer";
+   /* Single bit (1 << 19) in syscon register 0x04: */
+   reg = <0x04>;
+   bit-mask = <1>;
+   bit-shift = <19>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+
+   mux_in0: endpoint {
+   remote-endpoint = <&video_source0_out>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+
+   mux_in1: endpoint {
+   remote-endpoint = <&video_source1_out>;
+   };
+   };
+
+   port@2 {
+   reg = <2>;
+
+   mux_out: endpoint {
+   remote-endpoint = <&capture_interface_in>;
+   };
+   };
+   };
+};
-- 
2.7.4

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


[PATCH v5 03/39] [media] dt/bindings: Add bindings for OV5640

2017-03-09 Thread Steve Longerbeam
Add device tree binding documentation for the OV5640 camera sensor.

Signed-off-by: Steve Longerbeam 
---
 .../devicetree/bindings/media/i2c/ov5640.txt   | 45 ++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5640.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/ov5640.txt 
b/Documentation/devicetree/bindings/media/i2c/ov5640.txt
new file mode 100644
index 000..540b36c
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ov5640.txt
@@ -0,0 +1,45 @@
+* Omnivision OV5640 MIPI CSI-2 sensor
+
+Required Properties:
+- compatible: should be "ovti,ov5640"
+- clocks: reference to the xclk input clock.
+- clock-names: should be "xclk".
+- DOVDD-supply: Digital I/O voltage supply, 1.8 volts
+- AVDD-supply: Analog voltage supply, 2.8 volts
+- DVDD-supply: Digital core voltage supply, 1.5 volts
+
+Optional Properties:
+- reset-gpios: reference to the GPIO connected to the reset pin, if any.
+  This is an active low signal to the OV5640.
+- powerdown-gpios: reference to the GPIO connected to the powerdown pin,
+  if any. This is an active high signal to the OV5640.
+
+The device node must contain one 'port' child node for its digital output
+video port, in accordance with the video interface bindings defined in
+Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Example:
+
+&i2c1 {
+   ov5640: camera@3c {
+   compatible = "ovti,ov5640";
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_ov5640>;
+   reg = <0x3c>;
+   clocks = <&clks IMX6QDL_CLK_CKO>;
+   clock-names = "xclk";
+   DOVDD-supply = <&vgen4_reg>; /* 1.8v */
+   AVDD-supply = <&vgen3_reg>;  /* 2.8v */
+   DVDD-supply = <&vgen2_reg>;  /* 1.5v */
+   powerdown-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
+   reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
+
+   port {
+   ov5640_to_mipi_csi2: endpoint {
+   remote-endpoint = <&mipi_csi2_from_ov5640>;
+   clock-lanes = <0>;
+   data-lanes = <1 2>;
+   };
+   };
+   };
+};
-- 
2.7.4

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


[PATCH v5 04/39] ARM: dts: imx6qdl: Add compatible, clocks, irqs to MIPI CSI-2 node

2017-03-09 Thread Steve Longerbeam
Add to the MIPI CSI2 receiver node: compatible strings,
interrupt sources, and clocks.

Signed-off-by: Steve Longerbeam 
---
 arch/arm/boot/dts/imx6qdl.dtsi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 6d7bf64..d28a413 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -1134,7 +1134,14 @@
};
 
mipi_csi: mipi@021dc000 {
+   compatible = "fsl,imx6-mipi-csi2", 
"snps,dw-mipi-csi2";
reg = <0x021dc000 0x4000>;
+   interrupts = <0 100 0x04>, <0 101 0x04>;
+   clocks = <&clks IMX6QDL_CLK_HSI_TX>,
+<&clks IMX6QDL_CLK_VIDEO_27M>,
+<&clks IMX6QDL_CLK_EIM_PODF>;
+   clock-names = "dphy", "ref", "pix";
+   status = "disabled";
};
 
mipi_dsi: mipi@021e {
-- 
2.7.4

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


[PATCH v5 10/39] ARM: dts: imx6-sabreauto: create i2cmux for i2c3

2017-03-09 Thread Steve Longerbeam
The sabreauto uses a steering pin to select between the SDA signal on
i2c3 bus, and a data-in pin for an SPI NOR chip. Use i2cmux to control
this steering pin. Idle state of the i2cmux selects SPI NOR. This is not
a classic way to use i2cmux, since one side of the mux selects something
other than an i2c bus, but it works and is probably the cleanest
solution. Note that if one thread is attempting to access SPI NOR while
another thread is accessing i2c3, the SPI NOR access will fail since the
i2cmux has selected the SDA pin rather than SPI NOR data-in. This couldn't
be avoided in any case, the board is not designed to allow concurrent
i2c3 and SPI NOR functions (and the default device-tree does not enable
SPI NOR anyway).

Devices hanging off i2c3 should now be defined under i2cmux, so
that the steering pin can be properly controlled to access those
devices. The port expanders (MAX7310) are thus moved into i2cmux.

Signed-off-by: Steve Longerbeam 
---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 65 +---
 1 file changed, 44 insertions(+), 21 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi 
b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
index a2a714d..c8e35c4 100644
--- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
@@ -108,6 +108,44 @@
default-brightness-level = <7>;
status = "okay";
};
+
+   i2cmux {
+   compatible = "i2c-mux-gpio";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_i2c3mux>;
+   mux-gpios = <&gpio5 4 0>;
+   i2c-parent = <&i2c3>;
+   idle-state = <0>;
+
+   i2c@1 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <1>;
+
+   max7310_a: gpio@30 {
+   compatible = "maxim,max7310";
+   reg = <0x30>;
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   max7310_b: gpio@32 {
+   compatible = "maxim,max7310";
+   reg = <0x32>;
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   max7310_c: gpio@34 {
+   compatible = "maxim,max7310";
+   reg = <0x34>;
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+   };
+   };
 };
 
 &clks {
@@ -290,27 +328,6 @@
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";
-
-   max7310_a: gpio@30 {
-   compatible = "maxim,max7310";
-   reg = <0x30>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   max7310_b: gpio@32 {
-   compatible = "maxim,max7310";
-   reg = <0x32>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   max7310_c: gpio@34 {
-   compatible = "maxim,max7310";
-   reg = <0x34>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
 };
 
 &iomuxc {
@@ -418,6 +435,12 @@
>;
};
 
+   pinctrl_i2c3mux: i2c3muxgrp {
+   fsl,pins = <
+   MX6QDL_PAD_EIM_A24__GPIO5_IO04 0x0b0b1
+   >;
+   };
+
pinctrl_pwm3: pwm1grp {
fsl,pins = <
MX6QDL_PAD_SD4_DAT1__PWM3_OUT   0x1b0b1
-- 
2.7.4

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


[PATCH v5 06/39] ARM: dts: imx6qdl: add capture-subsystem device

2017-03-09 Thread Steve Longerbeam
Signed-off-by: Steve Longerbeam 
---
 arch/arm/boot/dts/imx6dl.dtsi | 5 +
 arch/arm/boot/dts/imx6q.dtsi  | 5 +
 2 files changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/imx6dl.dtsi b/arch/arm/boot/dts/imx6dl.dtsi
index 8958c4a..a959c76 100644
--- a/arch/arm/boot/dts/imx6dl.dtsi
+++ b/arch/arm/boot/dts/imx6dl.dtsi
@@ -100,6 +100,11 @@
};
};
 
+   capture-subsystem {
+   compatible = "fsl,imx-capture-subsystem";
+   ports = <&ipu1_csi0>, <&ipu1_csi1>;
+   };
+
display-subsystem {
compatible = "fsl,imx-display-subsystem";
ports = <&ipu1_di0>, <&ipu1_di1>;
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index b833b0d..4cc6579 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -206,6 +206,11 @@
};
};
 
+   capture-subsystem {
+   compatible = "fsl,imx-capture-subsystem";
+   ports = <&ipu1_csi0>, <&ipu1_csi1>, <&ipu2_csi0>, <&ipu2_csi1>;
+   };
+
display-subsystem {
compatible = "fsl,imx-display-subsystem";
ports = <&ipu1_di0>, <&ipu1_di1>, <&ipu2_di0>, <&ipu2_di1>;
-- 
2.7.4

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


[PATCH v5 07/39] ARM: dts: imx6qdl-sabrelite: remove erratum ERR006687 workaround

2017-03-09 Thread Steve Longerbeam
There is a pin conflict with GPIO_6. This pin functions as a power
input pin to the OV5642 camera sensor, but ENET uses it as the h/w
workaround for erratum ERR006687, to wake-up the ARM cores on normal
RX and TX packet done events. So we need to remove the h/w workaround
to support the OV5642. The result is that the CPUidle driver will no
longer allow entering the deep idle states on the sabrelite.

This is a partial revert of

commit 6261c4c8f13e ("ARM: dts: imx6qdl-sabrelite: use GPIO_6 for FEC
interrupt.")
commit a28eeb43ee57 ("ARM: dts: imx6: tag boards that have the HW workaround
for ERR006687")

Signed-off-by: Steve Longerbeam 
---
 arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 4 
 1 file changed, 4 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi 
b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
index 8413179..89dce27 100644
--- a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
@@ -270,9 +270,6 @@
txd1-skew-ps = <0>;
txd2-skew-ps = <0>;
txd3-skew-ps = <0>;
-   interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
- <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
-   fsl,err006687-workaround-present;
status = "okay";
 };
 
@@ -373,7 +370,6 @@
MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL   0x1b030
/* Phy reset */
MX6QDL_PAD_EIM_D23__GPIO3_IO23  0x000b0
-   MX6QDL_PAD_GPIO_6__ENET_IRQ 0x000b1
>;
};
 
-- 
2.7.4

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


[PATCH v5 05/39] ARM: dts: imx6qdl: Add mipi_ipu1/2 multiplexers, mipi_csi, and their connections

2017-03-09 Thread Steve Longerbeam
From: Philipp Zabel 

This patch adds the device tree graph connecting the input multiplexers
to the IPU CSIs and the MIPI-CSI2 gasket on i.MX6. The MIPI_IPU
multiplexers are added as children of the iomuxc-gpr syscon device node.
On i.MX6Q/D two two-input multiplexers in front of IPU1 CSI0 and IPU2
CSI1 allow to select between CSI0/1 parallel input pads and the MIPI
CSI-2 virtual channels 0/3.
On i.MX6DL/S two five-input multiplexers in front of IPU1 CSI0 and IPU1
CSI1 allow to select between CSI0/1 parallel input pads and any of the
four MIPI CSI-2 virtual channels.

Signed-off-by: Philipp Zabel 

--

- Removed some dangling/unused endpoints (ipu2_csi0_from_csi2ipu)
- Renamed the mipi virtual channel endpoint labels, from "mipi_csiX_..."
  to "mipi_vcX...".
- Added input endpoint anchors to the video muxes for the connections
  from parallel sensors.

Signed-off-by: Steve Longerbeam 
---
 arch/arm/boot/dts/imx6dl.dtsi  | 180 +
 arch/arm/boot/dts/imx6q.dtsi   | 116 ++
 arch/arm/boot/dts/imx6qdl.dtsi |  10 ++-
 3 files changed, 305 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6dl.dtsi b/arch/arm/boot/dts/imx6dl.dtsi
index 7aa120f..8958c4a 100644
--- a/arch/arm/boot/dts/imx6dl.dtsi
+++ b/arch/arm/boot/dts/imx6dl.dtsi
@@ -181,6 +181,186 @@
  "di0", "di1";
 };
 
+&gpr {
+   ipu1_csi0_mux: ipu1_csi0_mux@34 {
+   compatible = "video-multiplexer";
+   reg = <0x34>;
+   bit-mask = <0x7>;
+   bit-shift = <0>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   port@0 {
+   reg = <0>;
+
+   ipu1_csi0_mux_from_mipi_vc0: endpoint {
+   remote-endpoint = <&mipi_vc0_to_ipu1_csi0_mux>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+
+   ipu1_csi0_mux_from_mipi_vc1: endpoint {
+   remote-endpoint = <&mipi_vc1_to_ipu1_csi0_mux>;
+   };
+   };
+
+   port@2 {
+   reg = <2>;
+
+   ipu1_csi0_mux_from_mipi_vc2: endpoint {
+   remote-endpoint = <&mipi_vc2_to_ipu1_csi0_mux>;
+   };
+   };
+
+   port@3 {
+   reg = <3>;
+
+   ipu1_csi0_mux_from_mipi_vc3: endpoint {
+   remote-endpoint = <&mipi_vc3_to_ipu1_csi0_mux>;
+   };
+   };
+
+   port@4 {
+   reg = <4>;
+
+   ipu1_csi0_mux_from_parallel_sensor: endpoint {
+   };
+   };
+
+   port@5 {
+   reg = <5>;
+
+   ipu1_csi0_mux_to_ipu1_csi0: endpoint {
+   remote-endpoint = 
<&ipu1_csi0_from_ipu1_csi0_mux>;
+   };
+   };
+   };
+
+   ipu1_csi1_mux: ipu1_csi1_mux@34 {
+   compatible = "video-multiplexer";
+   reg = <0x34>;
+   bit-mask = <0x7>;
+   bit-shift = <3>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "okay";
+
+   port@0 {
+   reg = <0>;
+
+   ipu1_csi1_mux_from_mipi_vc0: endpoint {
+   remote-endpoint = <&mipi_vc0_to_ipu1_csi1_mux>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+
+   ipu1_csi1_mux_from_mipi_vc1: endpoint {
+   remote-endpoint = <&mipi_vc1_to_ipu1_csi1_mux>;
+   };
+   };
+
+   port@2 {
+   reg = <2>;
+
+   ipu1_csi1_mux_from_mipi_vc2: endpoint {
+   remote-endpoint = <&mipi_vc2_to_ipu1_csi1_mux>;
+   };
+   };
+
+   port@3 {
+   reg = <3>;
+
+   ipu1_csi1_mux_from_mipi_vc3: endpoint {
+   remote-endpoint = <&mipi_vc3_to_ipu1_csi1_mux>;
+   };
+   };
+
+   port@4 {
+   reg = <4>;
+
+   ipu1_csi1_mux_from_parallel_sensor: endpoint {
+   };
+   };
+
+   port@5 {
+   reg = <5>;
+
+   ipu1_csi1_mux_to_ipu1_csi1: endpoint {
+   remote-endpoint = 
<&ipu1_csi1_from_ipu1_csi1_mux>;
+   };
+   };
+   };
+};
+
+&ipu1_csi1 {
+   ipu1_csi1_from_ipu1_csi1_mux: endpoint {
+   r

[PATCH v5 09/39] ARM: dts: imx6-sabresd: add OV5642 and OV5640 camera sensors

2017-03-09 Thread Steve Longerbeam
Enables the OV5642 parallel-bus sensor, and the OV5640 MIPI CSI-2 sensor.

The OV5642 connects to the parallel-bus mux input port on ipu1_csi0_mux.

The OV5640 connects to the input port on the MIPI CSI-2 receiver on
mipi_csi.

Until the OV5652 sensor module compatible with the SabreSD becomes
available for testing, the ov5642 node is currently disabled.

Signed-off-by: Steve Longerbeam 
---
 arch/arm/boot/dts/imx6dl-sabresd.dts   |   5 ++
 arch/arm/boot/dts/imx6q-sabresd.dts|   5 ++
 arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 114 -
 3 files changed, 123 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6dl-sabresd.dts 
b/arch/arm/boot/dts/imx6dl-sabresd.dts
index 1e45f2f..9607afe 100644
--- a/arch/arm/boot/dts/imx6dl-sabresd.dts
+++ b/arch/arm/boot/dts/imx6dl-sabresd.dts
@@ -15,3 +15,8 @@
model = "Freescale i.MX6 DualLite SABRE Smart Device Board";
compatible = "fsl,imx6dl-sabresd", "fsl,imx6dl";
 };
+
+&ipu1_csi1_from_ipu1_csi1_mux {
+   clock-lanes = <0>;
+   data-lanes = <1 2>;
+};
diff --git a/arch/arm/boot/dts/imx6q-sabresd.dts 
b/arch/arm/boot/dts/imx6q-sabresd.dts
index 9cbdfe7..527772b 100644
--- a/arch/arm/boot/dts/imx6q-sabresd.dts
+++ b/arch/arm/boot/dts/imx6q-sabresd.dts
@@ -23,3 +23,8 @@
 &sata {
status = "okay";
 };
+
+&ipu1_csi1_from_mipi_vc1 {
+   clock-lanes = <0>;
+   data-lanes = <1 2>;
+};
diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi 
b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
index 63bf95e..643c1d4 100644
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -10,6 +10,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
+#include 
 #include 
 #include 
 
@@ -146,6 +147,36 @@
};
 };
 
+&ipu1_csi0_from_ipu1_csi0_mux {
+   bus-width = <8>;
+   data-shift = <12>; /* Lines 19:12 used */
+   hsync-active = <1>;
+   vsync-active = <1>;
+};
+
+&ipu1_csi0_mux_from_parallel_sensor {
+   remote-endpoint = <&ov5642_to_ipu1_csi0_mux>;
+};
+
+&ipu1_csi0 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_ipu1_csi0>;
+};
+
+&mipi_csi {
+   status = "okay";
+
+   port@0 {
+   reg = <0>;
+
+   mipi_csi2_in: endpoint {
+   remote-endpoint = <&ov5640_to_mipi_csi2>;
+   clock-lanes = <0>;
+   data-lanes = <1 2>;
+   };
+   };
+};
+
 &audmux {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_audmux>;
@@ -213,7 +244,32 @@
0x8014 /* 4:FN_DMICCDAT */
0x /* 5:Default */
>;
-   };
+   };
+
+   ov5642: camera@3c {
+   compatible = "ovti,ov5642";
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_ov5642>;
+   clocks = <&clks IMX6QDL_CLK_CKO>;
+   clock-names = "xclk";
+   reg = <0x3c>;
+   DOVDD-supply = <&vgen4_reg>; /* 1.8v */
+   AVDD-supply = <&vgen3_reg>;  /* 2.8v, rev C board is VGEN3
+   rev B board is VGEN5 */
+   DVDD-supply = <&vgen2_reg>;  /* 1.5v*/
+   powerdown-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
+   reset-gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
+   status = "disabled";
+
+   port {
+   ov5642_to_ipu1_csi0_mux: endpoint {
+   remote-endpoint = 
<&ipu1_csi0_mux_from_parallel_sensor>;
+   bus-width = <8>;
+   hsync-active = <1>;
+   vsync-active = <1>;
+   };
+   };
+   };
 };
 
 &i2c2 {
@@ -222,6 +278,32 @@
pinctrl-0 = <&pinctrl_i2c2>;
status = "okay";
 
+   ov5640: camera@3c {
+   compatible = "ovti,ov5640";
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_ov5640>;
+   reg = <0x3c>;
+   clocks = <&clks IMX6QDL_CLK_CKO>;
+   clock-names = "xclk";
+   DOVDD-supply = <&vgen4_reg>; /* 1.8v */
+   AVDD-supply = <&vgen3_reg>;  /* 2.8v, rev C board is VGEN3
+   rev B board is VGEN5 */
+   DVDD-supply = <&vgen2_reg>;  /* 1.5v*/
+   powerdown-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
+   reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
+
+   port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ov5640_to_mipi_csi2: endpoint {
+   remote-endpoint = <&mipi_csi2_in>;
+   clock-lanes = <0>;
+   data-lanes = <1 2>;
+   };
+   };
+   };
+
pmic: pfuze100@08 {
compatib

  1   2   >