[PATCH] staging: octeon-usb: coding style fix

2017-06-14 Thread bincy_k_philip
From: bincy k philip 

trivial fix for extra space error

Signed-off-by: bincy k philip 
---
 drivers/staging/octeon-usb/octeon-hcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon-usb/octeon-hcd.c 
b/drivers/staging/octeon-usb/octeon-hcd.c
index 068aece..c7ec71a 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -146,7 +146,7 @@ enum cvmx_usb_status {
  * status call.
  */
 struct cvmx_usb_port_status {
-   u32 reserved: 25;
+   u32 reserved:25;
u32 port_enabled: 1;
u32 port_over_current   : 1;
u32 port_powered: 1;
-- 
1.8.3.1

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


Re: [PATCH 3/4] staging: ks7010: add initial cfg80211 implementation

2017-06-14 Thread Tobin C. Harding
/drivers/staging/ks7010/Kconfig
> > > index 437b928..71f2026 100644
> > > --- a/drivers/staging/ks7010/Kconfig
> > > +++ b/drivers/staging/ks7010/Kconfig
> > > @@ -1,5 +1,7 @@
> > >  config KS7010
> > >   tristate "KeyStream KS7010 SDIO support"
> > > + depends on CFG80211
> > > +depends on MMC
> > 
> > tabs vs. spaces???
> 
> Face palm.
> 
> > >   ---help---
> > > This is a driver for KeyStream KS7010 based SDIO WIFI cards. It is
> > > found on at least later Spectec SDW-821 (FCC-ID "S2Y-WLAN-11G-K" only,
> > > diff --git a/drivers/staging/ks7010/Makefile 
> > > b/drivers/staging/ks7010/Makefile
> > > index 9444885..1cd570e 100644
> > > --- a/drivers/staging/ks7010/Makefile
> > > +++ b/drivers/staging/ks7010/Makefile
> > > @@ -1 +1,27 @@
> > > -# Makefile intentionally left blank
> > > +#-
> > > +# Driver for KeyStream wireless LAN cards.
> > > +#
> > > +# Copyright (C) 2005-2008 KeyStream Corp.
> > > +# Copyright (C) 2009 Renesas Technology Corp.
> > > +# Copyright (C) 2017 Tobin C. Harding.
> > > +#
> > > +# 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.
> > > +#
> > > +# This program is distributed in the hope that it will be useful, but
> > > +# WITHOUT ANY WARRANTY; without even the implied warranty of
> > > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > > +# General Public License for more details.
> > 
> > It's a makefile, not a "program", so why is all of this here?
> 
> I followed ath6kl for much of the time while writing this, ath6kl does
> this. I will remove it and resubmit.
> 
> > > +#-
> > > +
> > > +ccflags-y += -DDEBUG
> > > +
> > > +obj-$(CONFIG_KS7010) += ks7010.o
> > > +ks7010-y  += main.o
> > > +ks7010-y  += tx.o
> > > +ks7010-y  += rx.o
> > > +ks7010-y  += sdio.o
> > > +ks7010-y  += cfg80211.o
> > > +ks7010-y  += fil.o
> > > +ks7010-y  += hif.o
> > 
> > Wait, is this a whole new driver for this device?  Why not just put it
> > in a new directory and just forget about the old one entirely?
> 
> Thanks for your responses Greg. I do not know the correct protocol to
> follow for what I am attempting with this patch set. I mentioned this in
> the RFC hoping to get some direction. There were no comments so I
> proceeded as I had done in the RFC;
> 
> 1. Move WEXT code to sub-directory.
> 2. Add new driver code to main ks7010 directory.
> 3. Add maintainers entry.

Response from kbuild test robot implies that this is not the best way
to go about it.

  Note: the  
linux-review/Tobin-C-Harding/staging-ks7010-cfg80211-conversion/20170614-224320
HEAD  2b0460aebae71f28fdc7ab54b37af26fca3e4f4e builds fine.
  It only hurts bisectibility.

  All errors (new ones prefixed by >>):

  >> ld: cannot find drivers/staging/ks7010/built-in.o: No such file or 
directory

Better method happily followed if suggested.

> Following my understanding of kernel patching process the driver had
> to build with each patch applied, therefore after moving the WEXT code
> I left a blank Makefile and removed the dependencies from Kconfig
> 
> 
> The WEXT to cfg80211 conversion is basically a complete re-write of
> the driver. Does this mean it is the same driver or a new one, I don't
> know? The WEXT code is still needed for reference, we have only the
> WEXT driver to base the cfg80211 driver on. I know that it is in the git
> history and I could of clobbered the whole thing but I thought it more
> informative to keep the WEXT code in a sub directory to make explicit
> that the cfg80211 driver was being written based off of the WEXT
> driver.
> 
> > And testing it would be good to do :)
> 
> I'm working on the testing. Currently I have the card to test but not
> a machine that supports SDIO with a vanilla kernel. As such I have not
> managed to test the WEXT code either.
> 
> This patch set does not implement a complete functioning driver. I
> have submitted the driver as is in an attempt to get input from the
> kernel community. Failing that, if the driver is in staging as is,
> then I am forced to be follow a more meticulous development
> methodology instead of wildly hacking as I have done for the last
> month. With my minimal knowledge, I believe the design is stable
> enough to enable this. I am happy to be corrected if I am wrong. I am
> very much a learner, I would like to follow [learn] the correct kernel
> development methods.
> 
> thanks,
> Tobin.
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v8 07/10] hyper-v: globalize vp_index

2017-06-14 Thread Vitaly Kuznetsov
Stephen Hemminger  writes:

> On Wed, 14 Jun 2017 04:31:32 +
> Jork Loeser  wrote:
>
>> > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
>> > Sent: Tuesday, June 13, 2017 19:29
>> > 
>> > Stephen Hemminger  writes:
>> >   
>> > > On Fri,  9 Jun 2017 15:27:33 +0200
>> > > Vitaly Kuznetsov  wrote:
>> > >  
>> > >> To support implementing remote TLB flushing on Hyper-V with a
>> > >> hypercall we need to make vp_index available outside of vmbus module.
>> > >> Rename and globalize.
>> > >>
>> > >> Signed-off-by: Vitaly Kuznetsov 
>> > >> Reviewed-by: Andy Shevchenko   
>> > >
>> > > This is correct, but needs to be rebased.
>> > > It conflicts with the PCI protocol version 1.2 patches that are in the
>> > > PCI tree.  
>> > 
>> > :-(
>> > 
>> > The question is - what do we do? As far as I understand the intent was to 
>> > push
>> > this through Greg's char-misc tree. If I rebase it to Bjorn's pci tree 
>> > patches won't
>> > apply to char-misc and Greg won't take them. I see three possible ways to 
>> > go:
>> > 1) Take them into char-misc and resolve the conflict in merge window 
>> > (Linus will
>> > hate us all :-( )
>> > 2) Ask Greg to merge with Bjorn _now_ so we can send the rebased version.
>> > 3) Postpone these patches to the next kernel release. No guarantee we won't
>> > clash with something else :-(
>> > 
>> > So I'm a bit lost. With Hyper-V drivers scattered across multiple trees 
>> > we're
>> > doomed to have such issues with every relatively big series.  
>> 
>> I would like to see Vitaly's patch-set being integrated shortly (option 1).
>> 
>> In anticipation of this, the PCI protocol version 1.2 patches
>> duplicate the CPU-ID/vCPU-ID mapping. The conflict thus is "just" a
>> re-naming conflict - taking either old or new is fine (one
>> occurrence of conflict). Is this acceptable for conflict management
>> without instilling undue despise?
>> 
>> That said, I am more than happy to help in the resolution. Also, once both 
>> changes are merged, I'll remove the duplicated logic.
>> 
>> Regards,
>> Jork
>> 
>
> There a few other options:
> 1) Work with Stephen to resolve merge conflict in linux-next. This means any
>conflict would get resolved before merge window
> 2) Figure out how to get enabling code in (maybe duplicate functions) and then
>delete the extra later. For example 1-6 could go in now.
>
> 3) Just wait. The hypercall patches are optimizations and could be deferred
>the pain with this is carrying more patches and managing the backlog gets
>to be a real nuisance.

IMO we should go with 1) - the conflict we have is minor. While the code
in this series is an optimization it is an important one and we have
some other work which is currently stuck because this series is not
merged (e.g. Jork's PV spinlocks).

K. Y., do you agree to push it to char-misc now? Can you please send it
to Greg then? Thanks!

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


Re: [PATCH 1/4] staging: ks7010: move WEXT files to sub directory

2017-06-14 Thread kbuild test robot
Hi Tobin,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.12-rc5 next-20170614]
[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/Tobin-C-Harding/staging-ks7010-cfg80211-conversion/20170614-224320
config: x86_64-allyesconfig (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=x86_64 

Note: the 
linux-review/Tobin-C-Harding/staging-ks7010-cfg80211-conversion/20170614-224320 
HEAD 2b0460aebae71f28fdc7ab54b37af26fca3e4f4e builds fine.
  It only hurts bisectibility.

All errors (new ones prefixed by >>):

>> ld: cannot find drivers/staging/ks7010/built-in.o: No such file or directory

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/4] staging: ks7010: add initial cfg80211 implementation

2017-06-14 Thread Tobin C. Harding
On Wed, Jun 14, 2017 at 12:24:21PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Jun 14, 2017 at 04:30:37PM +1000, Tobin C. Harding wrote:
> > Currently we are in the process of replacing the WEXT interface with
> > the cfg80211 API. WEXT code is currently within a sub directory and
> > not included in the module build.
> > 
> > The driver is designed with various layers of abstraction;
> > 
> >   - The main layer contains the net_device_ops callbacks. Also included
> > in this layer is the rx/tx code.
> >   - The SDIO layer contains code specific to the SDIO hardware.
> >   - The cfg80211 layer contains the implementation of the cfg80211
> > configuration API.
> >   - The HIF (Host InterFace) layer provides driver policy and interfaces
> > between the cfg80211 layer and the FIL.
> >   - The FIL (Firmware Interface Layer) provides mechanism for
> > interfacing with the firmware.
> > 
> > The firmware interface is derived from the WEXT driver, if we
> > write code to interface with the firmware as a separate abstraction
> > layer then the cfg80211 code and the rest of the driver functionality
> > can be written cleanly from scratch.
> > 
> > The separate layers are restricted to calls as indicated by the
> > following diagram, A --> B indicates layer A calls functions in layer B.
> > 
> > >  main (tx/rx)  <--->  SDIO
> > |
> > | |
> > | |
> > v v
> > 
> > cfg80211  <--->  HIF
> > 
> >   |
> >   |
> >   v
> > 
> >  FIL
> > 
> > Implementation status is outlined in README.rst. A todo list is
> > included in TODO.rst.
> > 
> > Add initial cfg80211 implementation.
> > 
> > Signed-off-by: Tobin C. Harding 
> > ---
> >  drivers/staging/ks7010/Kconfig |2 +
> >  drivers/staging/ks7010/Makefile|   28 +-
> >  drivers/staging/ks7010/README.rst  |   91 +++
> >  drivers/staging/ks7010/TODO.rst|   30 +
> >  drivers/staging/ks7010/cfg80211.c  |  981 +++
> >  drivers/staging/ks7010/cfg80211.h  |   40 ++
> >  drivers/staging/ks7010/common.h|   33 +
> >  drivers/staging/ks7010/eap.h   |   73 ++
> >  drivers/staging/ks7010/fil.c   | 1294 
> > 
> >  drivers/staging/ks7010/fil.h   |  559 
> >  drivers/staging/ks7010/fil_types.h |  851 
> >  drivers/staging/ks7010/hif.c   |  505 ++
> >  drivers/staging/ks7010/hif.h   |  202 ++
> >  drivers/staging/ks7010/ks7010.h|  309 +
> >  drivers/staging/ks7010/main.c  |  337 ++
> >  drivers/staging/ks7010/rx.c|  130 
> >  drivers/staging/ks7010/sdio.c  |  691 +++
> >  drivers/staging/ks7010/sdio.h  |   37 ++
> >  drivers/staging/ks7010/tx.c|  170 +
> >  19 files changed, 6362 insertions(+), 1 deletion(-)
> >  create mode 100644 drivers/staging/ks7010/README.rst
> >  create mode 100644 drivers/staging/ks7010/TODO.rst
> >  create mode 100644 drivers/staging/ks7010/cfg80211.c
> >  create mode 100644 drivers/staging/ks7010/cfg80211.h
> >  create mode 100644 drivers/staging/ks7010/common.h
> >  create mode 100644 drivers/staging/ks7010/eap.h
> >  create mode 100644 drivers/staging/ks7010/fil.c
> >  create mode 100644 drivers/staging/ks7010/fil.h
> >  create mode 100644 drivers/staging/ks7010/fil_types.h
> >  create mode 100644 drivers/staging/ks7010/hif.c
> >  create mode 100644 drivers/staging/ks7010/hif.h
> >  create mode 100644 drivers/staging/ks7010/ks7010.h
> >  create mode 100644 drivers/staging/ks7010/main.c
> >  create mode 100644 drivers/staging/ks7010/rx.c
> >  create mode 100644 drivers/staging/ks7010/sdio.c
> >  create mode 100644 drivers/staging/ks7010/sdio.h
> >  create mode 100644 drivers/staging/ks7010/tx.c
> > 
> > diff --git a/drivers/staging/ks7010/Kconfig b/drivers/staging/ks7010/Kconfig
> > index 437b928..71f2026 100644
> > --- a/drivers/staging/ks7010/Kconfig
> > +++ b/drivers/staging/ks7010/Kconfig
> > @@ -1,5 +1,7 @@
> >  config KS7010
> > tristate "KeyStream KS7010 SDIO support"
> > +   depends on CFG80211
> > +depends on MMC
> 
> tabs vs. spaces???

Face palm.

> > ---help---
> >   This is a driver for KeyStream KS7010 based SDIO WIFI cards. It is
> >   found on at least later Spectec SDW-821 (FCC-ID "S2Y-WLAN-11G-K" only,
> > diff --git a/drivers/staging/ks7010/Makefile 
> > b/drivers/staging/ks7010/Makefile
> > index 9444885..1cd570e 100644
> > --- a/drivers/staging/ks7010/Makefile
> > +++ b/drivers/staging/ks7010/Makefile
> > @@ -1 +1,27 @@
> > -# Makefile intentionally left blank
> > +#-
> > +# Driver for KeyStream wireless LAN cards.
> > +#
> > +# Copyright (C) 2005-2008 KeyStream Corp.
> > +# Copyright (C) 2009 Renesas Technology Corp.
> > +# Copyright (C) 2017 Tobin C. Harding.
> > +#
> > +# 

Re: [PATCH 1/4] staging: ks7010: move WEXT files to sub directory

2017-06-14 Thread Tobin C. Harding
On Wed, Jun 14, 2017 at 12:22:31PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Jun 14, 2017 at 04:30:35PM +1000, Tobin C. Harding wrote:
> > Current driver implements the WEXT interface. WEXT is in maintenance
> > mode, we need to re-write the driver using the cfg80211 API. The current
> > driver is handy as a reference for the new implementation, we can keep
> > it in tree for now.
> > 
> > Move WEXT driver to sub directory, add dummy Makefile and Kconfig so
> > build completes successfully but does not process any files from the
> > WEXT directory.
> > 
> > Signed-off-by: Tobin C. Harding 
> > ---
> >  drivers/staging/ks7010/Kconfig| 6 +-
> >  drivers/staging/ks7010/Makefile   | 5 +
> >  drivers/staging/ks7010/{ => wext}/TODO| 0
> >  drivers/staging/ks7010/{ => wext}/eap_packet.h| 0
> >  drivers/staging/ks7010/{ => wext}/ks7010_sdio.c   | 0
> >  drivers/staging/ks7010/{ => wext}/ks7010_sdio.h   | 0
> >  drivers/staging/ks7010/{ => wext}/ks_hostif.c | 0
> >  drivers/staging/ks7010/{ => wext}/ks_hostif.h | 0
> >  drivers/staging/ks7010/{ => wext}/ks_wlan.h   | 0
> >  drivers/staging/ks7010/{ => wext}/ks_wlan_ioctl.h | 0
> >  drivers/staging/ks7010/{ => wext}/ks_wlan_net.c   | 0
> >  drivers/staging/ks7010/{ => wext}/michael_mic.c   | 0
> >  drivers/staging/ks7010/{ => wext}/michael_mic.h   | 0
> >  13 files changed, 2 insertions(+), 9 deletions(-)
> >  rename drivers/staging/ks7010/{ => wext}/TODO (100%)
> >  rename drivers/staging/ks7010/{ => wext}/eap_packet.h (100%)
> >  rename drivers/staging/ks7010/{ => wext}/ks7010_sdio.c (100%)
> >  rename drivers/staging/ks7010/{ => wext}/ks7010_sdio.h (100%)
> >  rename drivers/staging/ks7010/{ => wext}/ks_hostif.c (100%)
> >  rename drivers/staging/ks7010/{ => wext}/ks_hostif.h (100%)
> >  rename drivers/staging/ks7010/{ => wext}/ks_wlan.h (100%)
> >  rename drivers/staging/ks7010/{ => wext}/ks_wlan_ioctl.h (100%)
> >  rename drivers/staging/ks7010/{ => wext}/ks_wlan_net.c (100%)
> >  rename drivers/staging/ks7010/{ => wext}/michael_mic.c (100%)
> >  rename drivers/staging/ks7010/{ => wext}/michael_mic.h (100%)
> > 
> > diff --git a/drivers/staging/ks7010/Kconfig b/drivers/staging/ks7010/Kconfig
> > index 0b92176..437b928 100644
> > --- a/drivers/staging/ks7010/Kconfig
> > +++ b/drivers/staging/ks7010/Kconfig
> > @@ -1,10 +1,6 @@
> >  config KS7010
> > tristate "KeyStream KS7010 SDIO support"
> > -   depends on MMC && WIRELESS
> > -   select WIRELESS_EXT
> > -   select WEXT_PRIV
> > -   select FW_LOADER
> > -   help
> 
> With this patch, doesn't the code now break as it does depend on
> WIRELESS and MMC still?

The module builds successfully because the build does not include any
source files once this patch is applied.

> Why not keep those depends?

Since there is no code being built there are no dependencies.

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


[PATCH] staging: rtl8723bs: Remove unnecessary cast in kfree

2017-06-14 Thread Amitoj Kaur Chawla
Remove unnecassary casts in the argument to kfree.

Found using Coccinelle. The semantic patch used to find this is as
follows:

//
@@
type T;
expression *f;
@@

- kfree((T *)(f));
+ kfree(f);
//

Signed-off-by: Amitoj Kaur Chawla 
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 9167413..79d8383 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -766,7 +766,7 @@ static int wpa_set_encryption(struct net_device *dev, 
struct ieee_param *param,
 
 exit:
 
-   kfree((u8 *)pwep);
+   kfree(pwep);
return ret;
 }
 
@@ -2500,7 +2500,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev,
ret =  wpa_set_encryption(dev, param, param_len);
 
 exit:
-   kfree((u8 *)param);
+   kfree(param);
 
return ret;
 }
@@ -3767,7 +3767,7 @@ static int wpa_supplicant_ioctl(struct net_device *dev, 
struct iw_point *p)
 
if (copy_from_user(param, p->pointer, p->length))
{
-   kfree((u8 *)param);
+   kfree(param);
ret = -EFAULT;
goto out;
}
@@ -3801,7 +3801,7 @@ static int wpa_supplicant_ioctl(struct net_device *dev, 
struct iw_point *p)
if (ret == 0 && copy_to_user(p->pointer, param, p->length))
ret = -EFAULT;
 
-   kfree((u8 *)param);
+   kfree(param);
 
 out:
 
@@ -4130,7 +4130,7 @@ static int rtw_set_encryption(struct net_device *dev, 
struct ieee_param *param,
}
 
 exit:
-   kfree((u8 *)pwep);
+   kfree(pwep);
 
return ret;
 
@@ -4713,7 +4713,7 @@ static int rtw_hostapd_ioctl(struct net_device *dev, 
struct iw_point *p)
 
if (copy_from_user(param, p->pointer, p->length))
{
-   kfree((u8 *)param);
+   kfree(param);
ret = -EFAULT;
goto out;
}
@@ -4817,7 +4817,7 @@ static int rtw_hostapd_ioctl(struct net_device *dev, 
struct iw_point *p)
ret = -EFAULT;
 
 
-   kfree((u8 *)param);
+   kfree(param);
 
 out:
 
-- 
2.7.4

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


Re: [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors

2017-06-14 Thread Joe Perches
On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote:
> Due to the way the DFID was embedded in our debug strings checkpatch
> would report the following error:

unrelated trivia

> diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h 
> b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
[]
> @@ -532,7 +532,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, 
> int buflen)
>  #define FID_NOBRACE_LEN 40
>  #define FID_LEN (FID_NOBRACE_LEN + 2)
>  #define DFID_NOBRACE "%#llx:0x%x:0x%x"

It's odd to use a mixture of %#x and 0x%x.

Using
#define DFID_NOBRACE "%#llx:%#x:%#x"
would also save a couple bytes per use.

Does there need to be a difference between an SFID
and a DFID_NOBRACE?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: vc04_services: bcm2835-audio: bcm2835-ctl.c: Fixed alignment to match open parenthesis

2017-06-14 Thread srishti sharma
Fixed alignment so that it matched open parenthesis.

Signed-off-by: srishti sharma 
---
 .../staging/vc04_services/bcm2835-audio/bcm2835-ctl.c  | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
index f484bb0..ce8ab36 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
@@ -105,7 +105,7 @@ static int snd_bcm2835_ctl_get(struct snd_kcontrol 
*kcontrol,
 }

 static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_value *ucontrol)
+  struct snd_ctl_elem_value *ucontrol)
 {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
@@ -185,7 +185,7 @@ static struct snd_kcontrol_new snd_bcm2835_ctl[] = {
 };

 static int snd_bcm2835_spdif_default_info(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_info *uinfo)
+ struct snd_ctl_elem_info *uinfo)
 {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
@@ -193,7 +193,7 @@ static int snd_bcm2835_spdif_default_info(struct 
snd_kcontrol *kcontrol,
 }

 static int snd_bcm2835_spdif_default_get(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_value *ucontrol)
+struct snd_ctl_elem_value *ucontrol)
 {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
int i;
@@ -210,7 +210,7 @@ static int snd_bcm2835_spdif_default_get(struct 
snd_kcontrol *kcontrol,
 }

 static int snd_bcm2835_spdif_default_put(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_value *ucontrol)
+struct snd_ctl_elem_value *ucontrol)
 {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
unsigned int val = 0;
@@ -230,7 +230,7 @@ static int snd_bcm2835_spdif_default_put(struct 
snd_kcontrol *kcontrol,
 }

 static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_info *uinfo)
+  struct snd_ctl_elem_info *uinfo)
 {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
@@ -238,7 +238,7 @@ static int snd_bcm2835_spdif_mask_info(struct snd_kcontrol 
*kcontrol,
 }

 static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_value *ucontrol)
+ struct snd_ctl_elem_value *ucontrol)
 {
/*
 * bcm2835 supports only consumer mode and sets all other format flags
@@ -249,7 +249,7 @@ static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol 
*kcontrol,
 }

 static int snd_bcm2835_spdif_stream_info(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_info *uinfo)
+struct snd_ctl_elem_info *uinfo)
 {
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
uinfo->count = 1;
@@ -257,7 +257,7 @@ static int snd_bcm2835_spdif_stream_info(struct 
snd_kcontrol *kcontrol,
 }

 static int snd_bcm2835_spdif_stream_get(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_value *ucontrol)
+   struct snd_ctl_elem_value *ucontrol)
 {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
int i;
@@ -274,7 +274,7 @@ static int snd_bcm2835_spdif_stream_get(struct snd_kcontrol 
*kcontrol,
 }

 static int snd_bcm2835_spdif_stream_put(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_value *ucontrol)
+   struct snd_ctl_elem_value *ucontrol)
 {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
unsigned int val = 0;
--
2.7.4

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


[PATCH 2/2] staging: rtl8192e: remove dead code rtllib_wpa_supplicant_ioctl

2017-06-14 Thread Malcolm Priestley
Following removal of _rtl92e_ioctl this function along with associated
macros, structure ieee_param and functions become dead code.

Remove functions rtllib_wpa_enable, rtllib_wpa_assoc_frame, rtllib_wpa_mlme,
rtllib_wpa_set_wpa_ie, rtllib_wpa_set_auth_algs, rtllib_wpa_set_param,
rtllib_wpa_set_encryption and rtllib_wpa_supplicant_ioctl.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/rtl8192e/rtllib.h |  54 -
 drivers/staging/rtl8192e/rtllib_softmac.c | 383 --
 2 files changed, 437 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index 827651b62791..0042a0f6cf79 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -335,60 +335,8 @@ enum rt_op_mode {
 
 #define MGMT_QUEUE_NUM 5
 
-#define IEEE_CMD_SET_WPA_PARAM 1
-#defineIEEE_CMD_SET_WPA_IE 2
-#define IEEE_CMD_SET_ENCRYPTION3
-#define IEEE_CMD_MLME  4
-
-#define IEEE_PARAM_WPA_ENABLED 1
-#define IEEE_PARAM_TKIP_COUNTERMEASURES2
-#define IEEE_PARAM_DROP_UNENCRYPTED3
-#define IEEE_PARAM_PRIVACY_INVOKED 4
-#define IEEE_PARAM_AUTH_ALGS   5
-#define IEEE_PARAM_IEEE_802_1X 6
-#define IEEE_PARAM_WPAX_SELECT 7
-
-#define IEEE_MLME_STA_DEAUTH   1
-#define IEEE_MLME_STA_DISASSOC 2
-
-
-#define IEEE_CRYPT_ERR_UNKNOWN_ALG 2
-#define IEEE_CRYPT_ERR_CRYPT_INIT_FAILED   4
-#define IEEE_CRYPT_ERR_KEY_SET_FAILED  5
-#define IEEE_CRYPT_ERR_CARD_CONF_FAILED7
-#defineIEEE_CRYPT_ALG_NAME_LEN 16
-
 #define MAX_IE_LEN  0xff
 
-struct ieee_param {
-   u32 cmd;
-   u8 sta_addr[ETH_ALEN];
-   union {
-   struct {
-   u8 name;
-   u32 value;
-   } wpa_param;
-   struct {
-   u32 len;
-   u8 reserved[32];
-   u8 data[0];
-   } wpa_ie;
-   struct {
-   int command;
-   int reason_code;
-   } mlme;
-   struct {
-   u8 alg[IEEE_CRYPT_ALG_NAME_LEN];
-   u8 set_tx;
-   u32 err;
-   u8 idx;
-   u8 seq[8]; /* sequence counter (set: RX, get: TX) */
-   u16 key_len;
-   u8 key[0];
-   } crypt;
-   } u;
-};
-
 #define msleep_interruptible_rsl  msleep_interruptible
 
 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
@@ -2066,8 +2014,6 @@ void rtllib_stop_all_queues(struct rtllib_device *ieee);
 struct sk_buff *rtllib_get_beacon(struct rtllib_device *ieee);
 void rtllib_start_send_beacons(struct rtllib_device *ieee);
 void rtllib_stop_send_beacons(struct rtllib_device *ieee);
-int rtllib_wpa_supplicant_ioctl(struct rtllib_device *ieee,
-   struct iw_point *p, u8 is_mesh);
 
 void notify_wx_assoc_event(struct rtllib_device *ieee);
 void rtllib_ps_tx_ack(struct rtllib_device *ieee, short success);
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c 
b/drivers/staging/rtl8192e/rtllib_softmac.c
index 776e99741431..f629e99956b7 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -3077,333 +3077,6 @@ void rtllib_softmac_free(struct rtllib_device *ieee)
tasklet_kill(>ps_task);
 }
 
-/
- * Start of WPA code.  *
- * this is stolen from the ipw2200 driver  *
- /
-
-
-static int rtllib_wpa_enable(struct rtllib_device *ieee, int value)
-{
-   /* This is called when wpa_supplicant loads and closes the driver
-* interface.
-*/
-   netdev_info(ieee->dev, "%s WPA\n", value ? "enabling" : "disabling");
-   ieee->wpa_enabled = value;
-   eth_zero_addr(ieee->ap_mac_addr);
-   return 0;
-}
-
-
-static void rtllib_wpa_assoc_frame(struct rtllib_device *ieee, char *wpa_ie,
-  int wpa_ie_len)
-{
-   /* make sure WPA is enabled */
-   rtllib_wpa_enable(ieee, 1);
-
-   rtllib_disassociate(ieee);
-}
-
-
-static int rtllib_wpa_mlme(struct rtllib_device *ieee, int command, int reason)
-{
-
-   int ret = 0;
-
-   switch (command) {
-   case IEEE_MLME_STA_DEAUTH:
-   break;
-
-   case IEEE_MLME_STA_DISASSOC:
-   rtllib_disassociate(ieee);
-   break;
-
-   default:
-   netdev_info(ieee->dev, "Unknown MLME request: %d\n", command);
-   ret = -EOPNOTSUPP;
-   }
-
-   return 

Re: [PATCH] Staging: vc04_services: bcm2835-audio: bcm2835-ctl.c: Fixed alignment to match open paranthesis.

2017-06-14 Thread Joe Perches
On Wed, 2017-06-14 at 19:36 +0530, srishti sharma wrote:
> Fixed alignment so that it matched open paranthesis.

Please try to avoid typos in your commit message and as
well try to do all of alignment warnings in a single patch.

Ideally, all the files in a driver would be modified.

$ ./scripts/checkpatch.pl -f drivers/staging/vc04_services/bcm2835-audio/*.[ch] 
 --types=parenthesis_alignment --terse
drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:108: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:188: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:196: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:213: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:233: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:241: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:252: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:260: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:277: CHECK: Alignment 
should match open parenthesis
total: 0 errors, 0 warnings, 9 checks, 426 lines checked
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:70: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:85: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:256: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:305: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:328: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:336: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:371: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:378: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:421: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:431: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:436: CHECK: Alignment 
should match open parenthesis
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:525: CHECK: Alignment 
should match open parenthesis
total: 0 errors, 0 warnings, 12 checks, 567 lines checked


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


[PATCH 1/2] staging: rtl8192e: remove dead private call to _rtl92e_ioctl.

2017-06-14 Thread Malcolm Priestley
A RTL_IOCTL_WPA_SUPPLICANT call is a proprietary version of
wpa supplicant.

All kernel calls use SIOCSIWENCODEEXT call via wireless handlers
already used in this driver.

Remove dead code.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 126 ---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h |   2 -
 2 files changed, 128 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index a4d1bac4a844..aca52654825b 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2275,131 +2275,6 @@ static int _rtl92e_set_mac_adr(struct net_device *dev, 
void *mac)
return 0;
 }
 
-/* based on ipw2200 driver */
-static int _rtl92e_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
-{
-   struct r8192_priv *priv = rtllib_priv(dev);
-   struct iwreq *wrq = (struct iwreq *)rq;
-   int ret = -1;
-   struct rtllib_device *ieee = priv->rtllib;
-   u32 key[4];
-   const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 
0xff};
-   struct iw_point *p = >u.data;
-   struct ieee_param *ipw = NULL;
-
-   mutex_lock(>wx_mutex);
-
-   switch (cmd) {
-   case RTL_IOCTL_WPA_SUPPLICANT:
-   if (p->length < sizeof(struct ieee_param) || !p->pointer) {
-   ret = -EINVAL;
-   goto out;
-   }
-
-   ipw = memdup_user(p->pointer, p->length);
-   if (IS_ERR(ipw)) {
-   ret = PTR_ERR(ipw);
-   goto out;
-   }
-
-   if (ipw->cmd == IEEE_CMD_SET_ENCRYPTION) {
-   if (ipw->u.crypt.set_tx) {
-   if (strcmp(ipw->u.crypt.alg, "CCMP") == 0)
-   ieee->pairwise_key_type = KEY_TYPE_CCMP;
-   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)
-   ieee->pairwise_key_type =
-KEY_TYPE_WEP104;
-   else if (ipw->u.crypt.key_len == 5)
-   ieee->pairwise_key_type =
-KEY_TYPE_WEP40;
-   } else {
-   ieee->pairwise_key_type = KEY_TYPE_NA;
-   }
-
-   if (ieee->pairwise_key_type) {
-   if 
(is_zero_ether_addr(ieee->ap_mac_addr))
-   ieee->iw_mode = IW_MODE_ADHOC;
-   memcpy((u8 *)key, ipw->u.crypt.key, 16);
-   rtl92e_enable_hw_security_config(dev);
-   rtl92e_set_swcam(dev, 4,
-ipw->u.crypt.idx,
-
ieee->pairwise_key_type,
-(u8 
*)ieee->ap_mac_addr,
-0, key, 0);
-   rtl92e_set_key(dev, 4, ipw->u.crypt.idx,
-  ieee->pairwise_key_type,
-  (u8 *)ieee->ap_mac_addr,
-  0, key);
-   if (ieee->iw_mode == IW_MODE_ADHOC) {
-   rtl92e_set_swcam(dev,
-
ipw->u.crypt.idx,
-
ipw->u.crypt.idx,
-
ieee->pairwise_key_type,
-(u8 
*)ieee->ap_mac_addr,
-0, key, 0);
-   rtl92e_set_key(dev,
-  ipw->u.crypt.idx,
-  ipw->u.crypt.idx,
-  
ieee->pairwise_key_type,
-  (u8 
*)ieee->ap_mac_addr,
-  0, key);
-   }
-  

Re: [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch

2017-06-14 Thread Joe Perches
On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote:
> Cleanup all braces that was reported by checkpatch. The only
> issue not fixed up is in mdc_lock.c. Removing the braces in
> the case of mdc_lock.c will break the build.

[]

> diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c 
> b/drivers/staging/lustre/lustre/llite/vvp_dev.c
[]
> @@ -591,9 +591,10 @@ static void *vvp_pgcache_start(struct seq_file *f, 
> loff_t *pos)
>   env = cl_env_get();
>   if (!IS_ERR(env)) {
>   sbi = f->private;
> - if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT)
> + if (sbi->ll_site->ls_obj_hash->hs_cur_bits >
> + 64 - PGC_OBJ_SHIFT) {
>   pos = ERR_PTR(-EFBIG);
> - else {
> + } else {
>   *pos = vvp_pgcache_find(env, >ll_cl->cd_lu_dev,
>   *pos);
>   if (*pos == ~0ULL)

Sometimes is nicer to rearrange the code with smaller
indentation by using early returns and/or goto .

Something like:

static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos)
{
struct ll_sb_info *sbi;
struct lu_env *env;
u16 refcheck;

sbi = f->private;

env = cl_env_get();
if (IS_ERR(env))
return pos;

sbi = f->private;
if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT) {
pos = ERR_PTR(-EFBIG);
goto out;
}

*pos = vvp_pgcache_find(env, >ll_cl->cd_lu_dev, *pos);
if (*pos == ~0ULL)
pos = NULL;

out:
cl_env_put(env, );

return pos;
}

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


Re: [PATCH 5/6] staging: lustre: lustre: several over 80 characters cleanups

2017-06-14 Thread Joe Perches
On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote:
> Cleanup many of the over 80 characters reported by checkpatch

Please don't let checkpatch get in the way of lustre
readability.

lustre commonly uses very long identifiers.
Long identifiers and 80 columns don't mix well.

It might be simpler to declare in some document that
lustre uses lines of up to whatever length and require
that checkpatch should be used with the --max-line-length
option when run on lustre code.

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


Re: [PATCH v8 07/10] hyper-v: globalize vp_index

2017-06-14 Thread Stephen Hemminger
On Wed, 14 Jun 2017 04:31:32 +
Jork Loeser  wrote:

> > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> > Sent: Tuesday, June 13, 2017 19:29
> > 
> > Stephen Hemminger  writes:
> >   
> > > On Fri,  9 Jun 2017 15:27:33 +0200
> > > Vitaly Kuznetsov  wrote:
> > >  
> > >> To support implementing remote TLB flushing on Hyper-V with a
> > >> hypercall we need to make vp_index available outside of vmbus module.
> > >> Rename and globalize.
> > >>
> > >> Signed-off-by: Vitaly Kuznetsov 
> > >> Reviewed-by: Andy Shevchenko   
> > >
> > > This is correct, but needs to be rebased.
> > > It conflicts with the PCI protocol version 1.2 patches that are in the
> > > PCI tree.  
> > 
> > :-(
> > 
> > The question is - what do we do? As far as I understand the intent was to 
> > push
> > this through Greg's char-misc tree. If I rebase it to Bjorn's pci tree 
> > patches won't
> > apply to char-misc and Greg won't take them. I see three possible ways to 
> > go:
> > 1) Take them into char-misc and resolve the conflict in merge window (Linus 
> > will
> > hate us all :-( )
> > 2) Ask Greg to merge with Bjorn _now_ so we can send the rebased version.
> > 3) Postpone these patches to the next kernel release. No guarantee we won't
> > clash with something else :-(
> > 
> > So I'm a bit lost. With Hyper-V drivers scattered across multiple trees 
> > we're
> > doomed to have such issues with every relatively big series.  
> 
> I would like to see Vitaly's patch-set being integrated shortly (option 1).
> 
> In anticipation of this, the PCI protocol version 1.2 patches duplicate the 
> CPU-ID/vCPU-ID mapping. The conflict thus is "just" a re-naming conflict - 
> taking either old or new is fine (one occurrence of conflict). Is this 
> acceptable for conflict management without instilling undue despise?
> 
> That said, I am more than happy to help in the resolution. Also, once both 
> changes are merged, I'll remove the duplicated logic.
> 
> Regards,
> Jork
> 

There a few other options:
1) Work with Stephen to resolve merge conflict in linux-next. This means any
   conflict would get resolved before merge window
2) Figure out how to get enabling code in (maybe duplicate functions) and then
   delete the extra later. For example 1-6 could go in now.

3) Just wait. The hypercall patches are optimizations and could be deferred
   the pain with this is carrying more patches and managing the backlog gets
   to be a real nuisance.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls

2017-06-14 Thread Dmitry V. Levin
On Wed, Jun 14, 2017 at 07:08:39AM +0200, Greg Kroah-Hartman wrote:
> On Tue, Jun 13, 2017 at 09:17:05PM +0300, Gleb Fotengauer-Malinovskiy wrote:
> > On Tue, May 30, 2017 at 04:33:57PM -0700, Laura Abbott wrote:
> > > On 05/30/2017 07:11 AM, Gleb Fotengauer-Malinovskiy wrote:
> > > > This problem was found by strace ioctl list generator.
> > > > 
> > > > Fixes: 15c6098cfec5 ("staging: android: ion: Remove ion_handle and 
> > > > ion_client")
> > 
> > As this commit fixes a regression, please apply it to the tree which will
> > be merged before 4.12 release, too.
> 
> What "regression" is there?  The fact that a staging driver has a few
> spare ioctls floating around in a header file?  How is that bad?

I thought it was pretty obvious.
OK, here is a bit more detailed explanation.

There is an uapi header that after commit 15c6098cfec5 provides
definitions of ioctl macros that do not compile when used.

Imagine a userspace code that does something as harmless as
#ifdef ION_IOC_FREE
use(ION_IOC_FREE);
#endif
This simple code is broken by commit 15c6098cfec5.

The regression is not a pure virtual one, there is a quite real userspace
(strace ioctl list generator) broken by the change.


-- 
ldv


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


[PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors

2017-06-14 Thread James Simmons
Due to the way the DFID was embedded in our debug strings checkpatch
would report the following error:

CHECK: Concatenated strings should use spaces between elements

This patch introduces proper space to resolve these reports.

Signed-off-by: James Simmons 
---
 drivers/staging/lustre/lustre/fid/fid_request.c|  2 +-
 drivers/staging/lustre/lustre/fld/fld_cache.c  |  6 ++--
 .../lustre/lustre/include/lustre/lustre_idl.h  |  6 ++--
 .../lustre/lustre/include/lustre/lustre_user.h |  2 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |  6 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  4 +--
 drivers/staging/lustre/lustre/llite/dcache.c   |  4 +--
 drivers/staging/lustre/lustre/llite/dir.c  | 12 +++
 drivers/staging/lustre/lustre/llite/file.c | 42 +++---
 .../staging/lustre/lustre/llite/llite_internal.h   |  4 +--
 drivers/staging/lustre/lustre/llite/llite_lib.c| 34 +-
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  2 +-
 drivers/staging/lustre/lustre/llite/llite_nfs.c| 10 +++---
 drivers/staging/lustre/lustre/llite/namei.c| 38 ++--
 drivers/staging/lustre/lustre/llite/rw26.c |  2 +-
 drivers/staging/lustre/lustre/llite/statahead.c| 14 
 drivers/staging/lustre/lustre/llite/symlink.c  |  4 +--
 drivers/staging/lustre/lustre/llite/vvp_io.c   |  2 +-
 drivers/staging/lustre/lustre/llite/vvp_object.c   |  2 +-
 drivers/staging/lustre/lustre/llite/xattr.c|  6 ++--
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  4 +--
 drivers/staging/lustre/lustre/lmv/lmv_fld.c|  2 +-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c |  6 ++--
 drivers/staging/lustre/lustre/lmv/lmv_obd.c| 40 ++---
 drivers/staging/lustre/lustre/lov/lov_io.c |  2 +-
 drivers/staging/lustre/lustre/lov/lov_merge.c  |  4 +--
 drivers/staging/lustre/lustre/lov/lov_object.c |  7 ++--
 drivers/staging/lustre/lustre/lov/lov_pack.c   |  6 ++--
 drivers/staging/lustre/lustre/lov/lov_pool.c   |  8 ++---
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  |  6 ++--
 drivers/staging/lustre/lustre/mdc/mdc_reint.c  |  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c| 16 -
 drivers/staging/lustre/lustre/mgc/mgc_request.c|  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |  2 +-
 drivers/staging/lustre/lustre/obdclass/llog_cat.c  | 12 +++
 drivers/staging/lustre/lustre/obdclass/llog_swab.c |  2 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |  2 +-
 .../staging/lustre/lustre/obdecho/echo_client.c|  4 +--
 drivers/staging/lustre/lustre/osc/osc_cache.c  |  8 ++---
 drivers/staging/lustre/lustre/osc/osc_request.c|  3 +-
 drivers/staging/lustre/lustre/ptlrpc/client.c  |  4 +--
 .../staging/lustre/lustre/ptlrpc/pack_generic.c|  2 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c |  2 +-
 45 files changed, 175 insertions(+), 177 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c 
b/drivers/staging/lustre/lustre/fid/fid_request.c
index cd84b42..c05e928 100644
--- a/drivers/staging/lustre/lustre/fid/fid_request.c
+++ b/drivers/staging/lustre/lustre/fid/fid_request.c
@@ -279,7 +279,7 @@ int seq_client_alloc_fid(const struct lu_env *env,
*fid = seq->lcs_fid;
mutex_unlock(>lcs_mutex);
 
-   CDEBUG(D_INFO, "%s: Allocated FID "DFID"\n", seq->lcs_name,  PFID(fid));
+   CDEBUG(D_INFO, "%s: Allocated FID " DFID "\n", seq->lcs_name,  
PFID(fid));
return rc;
 }
 EXPORT_SYMBOL(seq_client_alloc_fid);
diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c 
b/drivers/staging/lustre/lustre/fld/fld_cache.c
index 11f6974..b852fed 100644
--- a/drivers/staging/lustre/lustre/fld/fld_cache.c
+++ b/drivers/staging/lustre/lustre/fld/fld_cache.c
@@ -151,7 +151,7 @@ static void fld_fix_new_list(struct fld_cache *cache)
continue;
 
LASSERTF(c_range->lsr_start <= n_range->lsr_start,
-"cur lsr_start "DRANGE" next lsr_start "DRANGE"\n",
+"cur lsr_start " DRANGE " next lsr_start " DRANGE "\n",
 PRANGE(c_range), PRANGE(n_range));
 
/* check merge possibility with next range */
@@ -349,7 +349,7 @@ static void fld_cache_overlap_handle(struct fld_cache 
*cache,
f_curr->fce_range.lsr_end = new_start;
fld_cache_entry_add(cache, f_new, _curr->fce_list);
} else
-   CERROR("NEW range ="DRANGE" curr = "DRANGE"\n",
+   CERROR("NEW range =" DRANGE " curr = " DRANGE "\n",
   PRANGE(range), PRANGE(_curr->fce_range));
 }
 
@@ -415,7 +415,7 @@ static int fld_cache_insert_nolock(struct fld_cache *cache,

[PATCH 5/6] staging: lustre: lustre: several over 80 characters cleanups

2017-06-14 Thread James Simmons
Cleanup many of the over 80 characters reported by checkpatch

Signed-off-by: James Simmons 
---
 drivers/staging/lustre/lustre/include/cl_object.h  |  2 +-
 .../staging/lustre/lustre/include/lprocfs_status.h |  3 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |  5 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 13 +
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 33 ++
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c |  3 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 14 +
 drivers/staging/lustre/lustre/llite/file.c |  3 +-
 .../staging/lustre/lustre/llite/llite_internal.h   | 10 +--
 drivers/staging/lustre/lustre/llite/llite_lib.c|  5 ++--
 drivers/staging/lustre/lustre/llite/llite_nfs.c|  3 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |  6 ++--
 drivers/staging/lustre/lustre/llite/namei.c|  6 ++--
 drivers/staging/lustre/lustre/llite/rw.c   |  6 ++--
 drivers/staging/lustre/lustre/llite/statahead.c|  9 --
 drivers/staging/lustre/lustre/llite/super25.c  |  3 +-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c |  3 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c| 10 ---
 drivers/staging/lustre/lustre/lov/lov_pack.c   |  3 +-
 drivers/staging/lustre/lustre/lov/lov_pool.c   |  9 --
 drivers/staging/lustre/lustre/lov/lproc_lov.c  | 12 +---
 drivers/staging/lustre/lustre/mdc/mdc_lib.c| 15 ++
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  |  5 ++--
 drivers/staging/lustre/lustre/mgc/mgc_request.c|  3 +-
 drivers/staging/lustre/lustre/obdclass/genops.c|  6 ++--
 .../staging/lustre/lustre/obdecho/echo_client.c|  3 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c  |  6 ++--
 drivers/staging/lustre/lustre/osc/osc_cache.c  | 10 +--
 .../staging/lustre/lustre/osc/osc_cl_internal.h|  4 ++-
 drivers/staging/lustre/lustre/osc/osc_request.c| 14 +
 drivers/staging/lustre/lustre/ptlrpc/client.c  | 21 --
 drivers/staging/lustre/lustre/ptlrpc/import.c  |  8 +++---
 drivers/staging/lustre/lustre/ptlrpc/layout.c  |  7 +++--
 drivers/staging/lustre/lustre/ptlrpc/llog_client.c |  3 +-
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c| 15 ++
 drivers/staging/lustre/lustre/ptlrpc/sec.c |  3 +-
 36 files changed, 184 insertions(+), 100 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
b/drivers/staging/lustre/lustre/include/cl_object.h
index 90a0c50..6e3b149 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -1012,7 +1012,7 @@ struct cl_page_operations {
 #define CL_PAGE_HEADER(mask, env, page, format, ...) \
 do { \
if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {\
-   LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);
\
+   LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);\
cl_page_header_print(env, , lu_cdebug_printer, page); \
CDEBUG(mask, format, ## __VA_ARGS__);   \
}\
diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 915283c..2d92055 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -577,7 +577,8 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int 
idx,
{   \
return lprocfs_wr_##type(file, buffer, count, off); \
}   \
-   static int name##_##type##_open(struct inode *inode, struct file *file) 
\
+   static int name##_##type##_open(struct inode *inode,\
+   struct file *file)  \
{   \
return single_open(file, NULL, inode->i_private);   \
}   \
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
index 08f97e2..8011368 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
@@ -241,8 +241,9 @@ void ldlm_extent_unlink_lock(struct ldlm_lock *lock)
}
 }
 
-void ldlm_extent_policy_wire_to_local(const union ldlm_wire_policy_data 
*wpolicy,
- union ldlm_policy_data *lpolicy)
+void
+ldlm_extent_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
+  

[PATCH 0/6] staging: lustre: lustre: assortment of checkpatch cleanups

2017-06-14 Thread James Simmons
This patch series covers a good chunk of the checkpatch issues in the
current lustre client code.

James Simmons (6):
  staging: lustre: lustre: resolve "use spaces between elements" checkpatch 
errors
  staging: lustre: lustre: make all struct file_operations constant
  staging: lustre: lustre: fix all bare unsigned usage
  staging: lustre: lustre: add all missing indentifier names
  staging: lustre: lustre: several over 80 characters cleanups
  staging: lustre: lustre: fix all braces issues reported by checkpatch

 drivers/staging/lustre/lustre/fid/fid_request.c|  2 +-
 drivers/staging/lustre/lustre/fld/fld_cache.c  |  9 ++--
 drivers/staging/lustre/lustre/fld/lproc_fld.c  |  2 +-
 drivers/staging/lustre/lustre/include/cl_object.h  |  6 +--
 .../staging/lustre/lustre/include/lprocfs_status.h | 15 ---
 drivers/staging/lustre/lustre/include/lu_object.h  |  4 +-
 .../lustre/lustre/include/lustre/lustre_idl.h  |  6 +--
 .../lustre/lustre/include/lustre/lustre_user.h |  2 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h |  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |  5 ++-
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 40 +
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 42 +++---
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c |  3 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 20 +
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |  4 +-
 drivers/staging/lustre/lustre/llite/dcache.c   |  4 +-
 drivers/staging/lustre/lustre/llite/dir.c  | 12 ++---
 drivers/staging/lustre/lustre/llite/file.c | 51 +++---
 .../staging/lustre/lustre/llite/llite_internal.h   | 36 ---
 drivers/staging/lustre/lustre/llite/llite_lib.c| 39 +
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  2 +-
 drivers/staging/lustre/lustre/llite/llite_nfs.c| 13 +++---
 drivers/staging/lustre/lustre/llite/lproc_llite.c  | 12 ++---
 drivers/staging/lustre/lustre/llite/namei.c| 46 +--
 drivers/staging/lustre/lustre/llite/rw.c   |  6 ++-
 drivers/staging/lustre/lustre/llite/rw26.c |  4 +-
 drivers/staging/lustre/lustre/llite/statahead.c| 23 +-
 drivers/staging/lustre/lustre/llite/super25.c  |  3 +-
 drivers/staging/lustre/lustre/llite/symlink.c  |  4 +-
 drivers/staging/lustre/lustre/llite/vvp_dev.c  | 11 ++---
 drivers/staging/lustre/lustre/llite/vvp_io.c   |  2 +-
 drivers/staging/lustre/lustre/llite/vvp_object.c   |  2 +-
 drivers/staging/lustre/lustre/llite/xattr.c|  6 +--
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  4 +-
 drivers/staging/lustre/lustre/lmv/lmv_fld.c|  2 +-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c |  9 ++--
 drivers/staging/lustre/lustre/lmv/lmv_obd.c| 50 +++--
 drivers/staging/lustre/lustre/lov/lov_io.c |  2 +-
 drivers/staging/lustre/lustre/lov/lov_merge.c  |  4 +-
 drivers/staging/lustre/lustre/lov/lov_object.c |  7 ++-
 drivers/staging/lustre/lustre/lov/lov_pack.c   |  9 ++--
 drivers/staging/lustre/lustre/lov/lov_pool.c   | 19 +---
 drivers/staging/lustre/lustre/lov/lproc_lov.c  | 12 +++--
 drivers/staging/lustre/lustre/mdc/mdc_lib.c| 15 ---
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  | 11 ++---
 drivers/staging/lustre/lustre/mdc/mdc_reint.c  |  2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c| 16 +++
 drivers/staging/lustre/lustre/mgc/mgc_request.c|  5 ++-
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |  2 +-
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |  2 +-
 drivers/staging/lustre/lustre/obdclass/genops.c|  6 ++-
 drivers/staging/lustre/lustre/obdclass/llog_cat.c  | 12 ++---
 drivers/staging/lustre/lustre/obdclass/llog_swab.c |  2 +-
 .../lustre/lustre/obdclass/lprocfs_status.c|  2 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |  2 +-
 .../staging/lustre/lustre/obdecho/echo_client.c|  7 +--
 drivers/staging/lustre/lustre/osc/lproc_osc.c  |  6 ++-
 drivers/staging/lustre/lustre/osc/osc_cache.c  | 24 +-
 .../staging/lustre/lustre/osc/osc_cl_internal.h|  4 +-
 drivers/staging/lustre/lustre/osc/osc_internal.h   |  2 +-
 drivers/staging/lustre/lustre/osc/osc_request.c| 17 +---
 drivers/staging/lustre/lustre/ptlrpc/client.c  | 25 ++-
 drivers/staging/lustre/lustre/ptlrpc/import.c  |  8 ++--
 drivers/staging/lustre/lustre/ptlrpc/layout.c  |  7 +--
 drivers/staging/lustre/lustre/ptlrpc/llog_client.c |  3 +-
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c| 15 ---
 .../staging/lustre/lustre/ptlrpc/pack_generic.c|  2 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  4 +-
 drivers/staging/lustre/lustre/ptlrpc/sec.c |  3 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c |  2 +-
 70 files changed, 425 insertions(+), 337 deletions(-)


[PATCH 3/6] staging: lustre: lustre: fix all bare unsigned usage

2017-06-14 Thread James Simmons
Turn all bare unsigned usage in the lustre code to proper
unsigned int.

Signed-off-by: James Simmons 
---
 drivers/staging/lustre/lustre/include/cl_object.h | 4 ++--
 drivers/staging/lustre/lustre/include/lu_object.h | 4 ++--
 drivers/staging/lustre/lustre/llite/namei.c   | 2 +-
 drivers/staging/lustre/lustre/llite/rw26.c| 2 +-
 drivers/staging/lustre/lustre/llite/vvp_dev.c | 6 +++---
 drivers/staging/lustre/lustre/osc/osc_cache.c | 6 +++---
 drivers/staging/lustre/lustre/osc/osc_internal.h  | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
b/drivers/staging/lustre/lustre/include/cl_object.h
index 2bc3ee5..90a0c50 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -1287,7 +1287,7 @@ struct cl_lock_operations {
  * @{
  */
 struct cl_page_list {
-   unsigned pl_nr;
+   unsigned int pl_nr;
struct list_head   pl_pages;
struct task_struct  *pl_owner;
 };
@@ -1842,7 +1842,7 @@ struct cl_io {
/**
 * Number of pages owned by this IO. For invariant checking.
 */
-   unsigned ci_owned_nr;
+   unsigned int ci_owned_nr;
 };
 
 /** @} cl_io */
diff --git a/drivers/staging/lustre/lustre/include/lu_object.h 
b/drivers/staging/lustre/lustre/include/lu_object.h
index 73ecc23..2e70602 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -968,11 +968,11 @@ struct lu_context {
 * Version counter used to skip calls to lu_context_refill() when no
 * keys were registered.
 */
-   unsigned   lc_version;
+   unsigned intlc_version;
/**
 * Debugging cookie.
 */
-   unsigned   lc_cookie;
+   unsigned intlc_cookie;
 };
 
 /**
diff --git a/drivers/staging/lustre/lustre/llite/namei.c 
b/drivers/staging/lustre/lustre/llite/namei.c
index 9f118a1..a208a8b 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -678,7 +678,7 @@ static struct dentry *ll_lookup_nd(struct inode *parent, 
struct dentry *dentry,
  * together.
  */
 static int ll_atomic_open(struct inode *dir, struct dentry *dentry,
- struct file *file, unsigned open_flags,
+ struct file *file, unsigned int open_flags,
  umode_t mode, int *opened)
 {
struct lookup_intent *it;
diff --git a/drivers/staging/lustre/lustre/llite/rw26.c 
b/drivers/staging/lustre/lustre/llite/rw26.c
index 22dc6a5..3619cd8 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -547,7 +547,7 @@ static int ll_write_begin(struct file *file, struct 
address_space *mapping,
 }
 
 static int ll_write_end(struct file *file, struct address_space *mapping,
-   loff_t pos, unsigned len, unsigned copied,
+   loff_t pos, unsigned int len, unsigned int copied,
struct page *vmpage, void *fsdata)
 {
struct ll_cl_context *lcc = fsdata;
diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c 
b/drivers/staging/lustre/lustre/llite/vvp_dev.c
index 6cb2db2..8e45672 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
@@ -381,11 +381,11 @@ int cl_sb_fini(struct super_block *sb)
 #define PGC_DEPTH_SHIFT (32)
 
 struct vvp_pgcache_id {
-   unsigned vpi_bucket;
-   unsigned vpi_depth;
+   unsigned int vpi_bucket;
+   unsigned int vpi_depth;
uint32_t vpi_index;
 
-   unsigned vpi_curdep;
+   unsigned int vpi_curdep;
struct lu_object_header *vpi_obj;
 };
 
diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c 
b/drivers/staging/lustre/lustre/osc/osc_cache.c
index 4db8116..d8a95f8 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -1889,10 +1889,10 @@ struct extent_rpc_data {
unsigned interd_max_chunks;
 };
 
-static inline unsigned osc_extent_chunks(const struct osc_extent *ext)
+static inline unsigned int osc_extent_chunks(const struct osc_extent *ext)
 {
struct client_obd *cli = osc_cli(ext->oe_obj);
-   unsigned ppc_bits = cli->cl_chunkbits - PAGE_SHIFT;
+   unsigned int ppc_bits = cli->cl_chunkbits - PAGE_SHIFT;
 
return (ext->oe_end >> ppc_bits) - (ext->oe_start >> ppc_bits) + 1;
 }
@@ -1950,7 +1950,7 @@ static int try_to_add_extent_for_io(struct client_obd 
*cli,
return 1;
 }
 
-static inline unsigned osc_max_write_chunks(const struct client_obd *cli)
+static inline unsigned int 

[PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch

2017-06-14 Thread James Simmons
Cleanup all braces that was reported by checkpatch. The only
issue not fixed up is in mdc_lock.c. Removing the braces in
the case of mdc_lock.c will break the build.

Signed-off-by: James Simmons 
---
 drivers/staging/lustre/lustre/fld/fld_cache.c  | 3 ++-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 9 +
 drivers/staging/lustre/lustre/llite/vvp_dev.c  | 5 +++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c 
b/drivers/staging/lustre/lustre/fld/fld_cache.c
index b852fed..adaa094 100644
--- a/drivers/staging/lustre/lustre/fld/fld_cache.c
+++ b/drivers/staging/lustre/lustre/fld/fld_cache.c
@@ -348,9 +348,10 @@ static void fld_cache_overlap_handle(struct fld_cache 
*cache,
 
f_curr->fce_range.lsr_end = new_start;
fld_cache_entry_add(cache, f_new, _curr->fce_list);
-   } else
+   } else {
CERROR("NEW range =" DRANGE " curr = " DRANGE "\n",
   PRANGE(range), PRANGE(_curr->fce_range));
+   }
 }
 
 struct fld_cache_entry
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 8599134..f47343a 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -1029,11 +1029,11 @@ void ldlm_grant_lock(struct ldlm_lock *lock, struct 
list_head *work_list)
if (work_list && lock->l_completion_ast)
ldlm_add_ast_work_item(lock, NULL, work_list);
 
-   if (res->lr_type == LDLM_PLAIN || res->lr_type == LDLM_IBITS)
+   if (res->lr_type == LDLM_PLAIN || res->lr_type == LDLM_IBITS) {
ldlm_grant_lock_with_skiplist(lock);
-   else if (res->lr_type == LDLM_EXTENT)
+   } else if (res->lr_type == LDLM_EXTENT) {
ldlm_extent_add_lock(res, lock);
-   else if (res->lr_type == LDLM_FLOCK) {
+   } else if (res->lr_type == LDLM_FLOCK) {
/*
 * We should not add locks to granted list in the following
 * cases:
@@ -1046,8 +1046,9 @@ void ldlm_grant_lock(struct ldlm_lock *lock, struct 
list_head *work_list)
ldlm_is_test_lock(lock) || ldlm_is_flock_deadlock(lock))
return;
ldlm_resource_add_lock(res, >lr_granted, lock);
-   } else
+   } else {
LBUG();
+   }
 
ldlm_pool_add(_res_to_ns(res)->ns_pool, lock);
 }
diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c 
b/drivers/staging/lustre/lustre/llite/vvp_dev.c
index 8e45672..2b60699 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
@@ -591,9 +591,10 @@ static void *vvp_pgcache_start(struct seq_file *f, loff_t 
*pos)
env = cl_env_get();
if (!IS_ERR(env)) {
sbi = f->private;
-   if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT)
+   if (sbi->ll_site->ls_obj_hash->hs_cur_bits >
+   64 - PGC_OBJ_SHIFT) {
pos = ERR_PTR(-EFBIG);
-   else {
+   } else {
*pos = vvp_pgcache_find(env, >ll_cl->cd_lu_dev,
*pos);
if (*pos == ~0ULL)
-- 
1.8.3.1

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


[PATCH 2/6] staging: lustre: lustre: make all struct file_operations constant

2017-06-14 Thread James Simmons
Checkpatch reported several cases of struct file_operations
not being const. This resolves those warnings.

Signed-off-by: James Simmons 
---
 drivers/staging/lustre/lustre/fld/lproc_fld.c   | 2 +-
 drivers/staging/lustre/lustre/include/lprocfs_status.h  | 8 
 drivers/staging/lustre/lustre/llite/file.c  | 6 +++---
 drivers/staging/lustre/lustre/llite/llite_internal.h| 8 
 drivers/staging/lustre/lustre/llite/lproc_llite.c   | 6 +++---
 drivers/staging/lustre/lustre/lov/lov_pool.c| 2 +-
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
 7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c 
b/drivers/staging/lustre/lustre/fld/lproc_fld.c
index 61ac420..b83d7eb 100644
--- a/drivers/staging/lustre/lustre/fld/lproc_fld.c
+++ b/drivers/staging/lustre/lustre/fld/lproc_fld.c
@@ -136,7 +136,7 @@
return 0;
 }
 
-static struct file_operations fld_debugfs_cache_flush_fops = {
+static const struct file_operations fld_debugfs_cache_flush_fops = {
.owner  = THIS_MODULE,
.open   = simple_open,
.write  = fld_debugfs_cache_flush_write,
diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 242abb8..1e68c77 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -49,7 +49,7 @@
 
 struct lprocfs_vars {
const char  *name;
-   struct file_operations  *fops;
+   const struct file_operations*fops;
void*data;
/**
 * sysfs file mode.
@@ -449,7 +449,7 @@ void lprocfs_counter_init(struct lprocfs_stats *stats, int 
index,
 struct dentry *ldebugfs_add_simple(struct dentry *root,
   char *name,
   void *data,
-  struct file_operations *fops);
+  const struct file_operations *fops);
 
 int ldebugfs_register_stats(struct dentry *parent,
const char *name,
@@ -536,7 +536,7 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int 
idx,
 {  \
return single_open(file, name##_seq_show, inode->i_private);\
 }  \
-static struct file_operations name##_fops = {  \
+static const struct file_operations name##_fops = {\
.owner   = THIS_MODULE, \
.open= name##_single_open,   \
.read= seq_read,   \
@@ -581,7 +581,7 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int 
idx,
{   \
return single_open(file, NULL, inode->i_private);   \
}   \
-   static struct file_operations name##_##type##_fops = {  \
+   static const struct file_operations name##_##type##_fops = {\
.open   = name##_##type##_open, \
.write  = name##_##type##_write,\
.release = lprocfs_single_release,  \
diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 711fbb0..ab1c85c 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -3114,7 +3114,7 @@ int ll_inode_permission(struct inode *inode, int mask)
 }
 
 /* -o localflock - only provides locally consistent flock locks */
-struct file_operations ll_file_operations = {
+const struct file_operations ll_file_operations = {
.read_iter = ll_file_read_iter,
.write_iter = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
@@ -3127,7 +3127,7 @@ struct file_operations ll_file_operations = {
.flush= ll_flush
 };
 
-struct file_operations ll_file_operations_flock = {
+const struct file_operations ll_file_operations_flock = {
.read_iter= ll_file_read_iter,
.write_iter   = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
@@ -3143,7 +3143,7 @@ struct file_operations ll_file_operations_flock = {
 };
 
 /* These are for -o noflock - to return ENOSYS on flock calls */
-struct file_operations ll_file_operations_noflock = {
+const struct file_operations ll_file_operations_noflock = {
.read_iter= ll_file_read_iter,
.write_iter   = ll_file_write_iter,
.unlocked_ioctl = ll_file_ioctl,
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 

[PATCH 4/6] staging: lustre: lustre: add all missing indentifier names

2017-06-14 Thread James Simmons
Create identifier names missing from function prototypes as
reported by checkpatch.

Signed-off-by: James Simmons 
---
 .../staging/lustre/lustre/include/lprocfs_status.h |  4 ++--
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 27 --
 .../staging/lustre/lustre/llite/llite_internal.h   | 14 +--
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|  2 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  4 ++--
 5 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h 
b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 1e68c77..915283c 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -523,8 +523,8 @@ char *lprocfs_find_named_value(const char *buffer, const 
char *name,
 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
   struct lprocfs_counter *cnt);
 
-int lprocfs_single_release(struct inode *, struct file *);
-int lprocfs_seq_release(struct inode *, struct file *);
+int lprocfs_single_release(struct inode *inode, struct file *file);
+int lprocfs_seq_release(struct inode *inode, struct file *file);
 
 /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only
  * proc entries; otherwise, you will define name##_seq_write function also for
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h 
b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
index 5d24b48..ec3b23c 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
@@ -79,11 +79,11 @@ static inline int ldlm_ns_empty(struct ldlm_namespace *ns)
return atomic_read(>ns_bref) == 0;
 }
 
-void ldlm_namespace_move_to_active_locked(struct ldlm_namespace *,
- enum ldlm_side);
-void ldlm_namespace_move_to_inactive_locked(struct ldlm_namespace *,
-   enum ldlm_side);
-struct ldlm_namespace *ldlm_namespace_first_locked(enum ldlm_side);
+void ldlm_namespace_move_to_active_locked(struct ldlm_namespace *ns,
+ enum ldlm_side client);
+void ldlm_namespace_move_to_inactive_locked(struct ldlm_namespace *ns,
+   enum ldlm_side client);
+struct ldlm_namespace *ldlm_namespace_first_locked(enum ldlm_side client);
 
 /* ldlm_request.c */
 /* Cancel lru flag, it indicates we cancel aged locks. */
@@ -130,16 +130,19 @@ enum ldlm_desc_ast_t {
 int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill,
  enum req_location loc, void *data, int size);
 struct ldlm_lock *
-ldlm_lock_create(struct ldlm_namespace *ns, const struct ldlm_res_id *,
+ldlm_lock_create(struct ldlm_namespace *ns, const struct ldlm_res_id *id,
 enum ldlm_type type, enum ldlm_mode mode,
 const struct ldlm_callback_suite *cbs,
 void *data, __u32 lvb_len, enum lvb_type lvb_type);
-enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **,
- void *cookie, __u64 *flags);
-void ldlm_lock_addref_internal(struct ldlm_lock *, enum ldlm_mode mode);
-void ldlm_lock_addref_internal_nolock(struct ldlm_lock *, enum ldlm_mode mode);
-void ldlm_lock_decref_internal(struct ldlm_lock *, enum ldlm_mode mode);
-void ldlm_lock_decref_internal_nolock(struct ldlm_lock *, enum ldlm_mode mode);
+enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns,
+ struct ldlm_lock **lock, void *cookie,
+ __u64 *flags);
+void ldlm_lock_addref_internal(struct ldlm_lock *lock, enum ldlm_mode mode);
+void ldlm_lock_addref_internal_nolock(struct ldlm_lock *lock,
+ enum ldlm_mode mode);
+void ldlm_lock_decref_internal(struct ldlm_lock *lock, enum ldlm_mode mode);
+void ldlm_lock_decref_internal_nolock(struct ldlm_lock *lock,
+ enum ldlm_mode mode);
 int ldlm_run_ast_work(struct ldlm_namespace *ns, struct list_head *rpc_list,
  enum ldlm_desc_ast_t ast_type);
 int ldlm_lock_remove_from_lru_check(struct ldlm_lock *lock, time_t last_use);
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 41a0c8d..cd3311a 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -718,14 +718,14 @@ struct page *ll_get_dir_page(struct inode *dir, struct 
md_op_data *op_data,
 struct inode *ll_iget(struct super_block *sb, ino_t hash,
  struct lustre_md *lic);
 int ll_test_inode_by_fid(struct inode *inode, void *opaque);
-int ll_md_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *,
+int 

Re: [PATCH v2] staging: vboxvideo: Add vboxvideo to drivers/staging

2017-06-14 Thread Hans de Goede

Hi,

On 14-06-17 15:40, Michael Thayer wrote:

Hello Hans,

14.06.2017 15:30, Hans de Goede wrote:
[Discussion of vboxvideo and vboxguest driver clean-up.]

As I already mentioned in previous mails on this, for the vboxguest driver
my plan is to simply do a fork and remove anything related to the
portability. It currently weighs in at 10+ lines of code which is a bit
much for what it does I believe I will be able to get a Linux only version
of it down to a small fraction of that and the result will be a much
cleaner
and better driver.

FWIW I've already stared looking into cleaning up the vboxguest driver and
my first target is to remove all dependencies on the r0drv code.


Moving off-topic, but please let me know if you set up a git repository
for it as you did for vboxvideo.


Will do.


Do you have plans (applies to
vboxvideo too) for how to merge changes to our code into the cleaned-up
code?


The git repo will have an "upstream" branch which will contain the vboxguest
dir from the tarbal created by the src/VBox/Additions/linux/export_modules
script. My plan is to sync that branch regularly by coping over a fresh
copy of that dir, then commit that as a commit on top of the previous
sync and look at the git diff to see what changed. Then where necessary
I will port over the changes to the cleaned up version.

>Of course, I am open to patches or suggestions as to how to

simplify the code in our repository as long as they do not affect other
platforms (vboxguest builds and runs for five different operating system
kernels).

Regards
Michael


Regards,

Hans



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


Re: [PATCH v2] staging: vboxvideo: Add vboxvideo to drivers/staging

2017-06-14 Thread Michael Thayer
14.06.2017 16:42, Sean Paul wrote:
[Discussion of vboxvideo driver kernel integration and clean-up.]
> Once the code is upstream, it's going to be difficult to motivate developers 
> to
> keep the driver close to your downstream version. If I'm working on feature X
> which touches your driver, I'm not going to figure out how your internal 
> version
> works so that I might ease your pain. I don't mean that to be rude, just
> realistic.

I would not expect many changes to happen to the vboxvideo-specific
parts of the driver - what is currently in osdependent -  at least not
without someone talking to me about it first.  If changes happen to the
other parts I would expect to monitor that myself and integrate them
into our out-of-tree driver at regular intervals.  Up until now I have
been tracking the AST driver in this way - not as diligently as I should
have been.  I would expect this to be made easier, not harder if I
switch to tracking in-kernel vboxvideo.  Perhaps I will be proven wrong,
but I do not expect much to be made in the way of changes that will not
make sense for me to integrate, if only because keeping the difference
as small as possible will make sense for me.

Regards
Michael

[...]
-- 
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: vboxvideo: Add vboxvideo to drivers/staging

2017-06-14 Thread Sean Paul
On Wed, Jun 14, 2017 at 11:34:10AM +0200, Michael Thayer wrote:
> Hello Sean,
> 
> 13.06.2017 20:03, Sean Paul wrote:
> [Discussion of vboxvideo driver clean-up.]
> 
> > First, thank you for your submission.
> 
> Thank you for your feedback.
> 
> [Discussion of the OS-independent code in the driver submission.]
> 
> > I took a quick skim through your driver, and there doesn't seem to be much
> > secret sauce there that will be tough to keep up-to-date across platforms.
> 
> I have two particular concerns there: first if we add new functionality
> (which we would do out of tree first) it will need porting over.
> Acceleration support is the most likely candidate.  And if someone does
> make fixes to that part of the code in the kernel tree they will also
> need porting over.  I agree, that concern is probably overblown, and
> best addressed by keeping that part of the code as close to our tree as
> possible while still meeting kernel standards (hence my question as to
> what that would be).

Once the code is upstream, it's going to be difficult to motivate developers to
keep the driver close to your downstream version. If I'm working on feature X
which touches your driver, I'm not going to figure out how your internal version
works so that I might ease your pain. I don't mean that to be rude, just
realistic.

Sean

> 
> The second concern is not relevant to DRI, but it concerns our other
> guest drivers (not the host one with the C++ in it Greg!) which Hans
> also expressed interest in putting upstream after seeing how vboxvideo
> fares.  The OS-independent part is quite a bit larger and more volatile,
> though it has thankfully stablised a lot.  That concern is probably also
> overblown, though I do wonder whether upstreaming those driver is the
> best solution (that would be Hans's call though).
> 
> > One other concern I have is that I noticed there are a few functions
> > declared/defined in the osindependent code that are never used outside of 
> > it, so
> > we have dead code off the hop.
> 
> If the OS-independent part gets converted then they would be removed in
> the process.  Thank you for the reminder.
> 
> [...]
> 
> > IMO, in order to accept the driver in drm, the osindependent code needs to 
> > be
> > stripped out and it needs to be converted to atomic. Whether you want to do
> > this out of tree, or in staging is up to you. As Dave mentioned, people 
> > often
> > overlook staging when making drm core changes, so you'll likely face the 
> > same
> > moving target issues either way.
> 
> Conversion to Atomic would probably have to happen at some time or
> another anyway.  I have put that off (out-of-tree) so far because I was
> tracking the AST driver as closely as possible as the simplest way of
> picking up fixes, and because Dave, who wrote that, knows much more
> about drm drivers than me.
> 
> [...]
> 
> Regards
> Michael
> -- 
> Michael Thayer | VirtualBox engineer
> ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt
> 
> ORACLE Deutschland B.V. & Co. KG
> Hauptverwaltung: Riesstraße 25, D-80992 München
> Registergericht: Amtsgericht München, HRA 95603
> 
> Komplementärin: ORACLE Deutschland Verwaltung B.V.
> Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister
> der Handelskammer Midden-Nederland, Nr. 30143697
> Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher

-- 
Sean Paul, Software Engineer, Google / Chromium OS
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: vc04_services: bcm2835-audio: bcm2835-ctl.c: Fixed alignment to match open paranthesis.

2017-06-14 Thread srishti sharma
Fixed alignment so that it matched open paranthesis.

Signed-off-by: srishti sharma 
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c 
b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
index f484bb0..2148ed0 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
@@ -105,7 +105,7 @@ static int snd_bcm2835_ctl_get(struct snd_kcontrol 
*kcontrol,
 }

 static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol,
-   struct snd_ctl_elem_value *ucontrol)
+  struct snd_ctl_elem_value *ucontrol)
 {
struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
int changed = 0;
--
2.7.4

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


Re: [PATCH] Staging: vc04_services: bcm2835-audio: bcm2835-ctl.c: Fixed alignment to match open parenthesis.

2017-06-14 Thread srishti sharma
On Wed, Jun 14, 2017 at 7:19 PM, Greg KH  wrote:
> On Wed, Jun 14, 2017 at 07:11:01PM +0530, srishti sharma wrote:
>> On Wed, Jun 14, 2017 at 10:39 AM, Greg KH  wrote:
>> > On Wed, Jun 14, 2017 at 03:15:11AM +0530, srishti sharma wrote:
>> >> On Tue, Jun 13, 2017 at 8:17 PM, Dan Carpenter  
>> >> wrote:
>> >> > On Tue, Jun 13, 2017 at 08:07:14PM +0530, srishti sharma wrote:
>> >> >> On Tue, Jun 13, 2017 at 6:30 PM, Greg KH  
>> >> >> wrote:
>> >> >> > On Sat, Jun 10, 2017 at 02:37:22AM +0530, srishti sharma wrote:
>> >> >> >> Fixed alignment so that it matched open parenthesis.
>> >> >> >>
>> >> >> >> Signed-off-by: srishti sharma 
>> >> >> >> ---
>> >> >> >>  drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c | 2 +-
>> >> >> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >> >> >>
>> >> >> >> diff --git 
>> >> >> >> a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c 
>> >> >> >> b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
>> >> >> >> index f484bb0..2148ed0 100644
>> >> >> >> --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
>> >> >> >> +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
>> >> >> >> @@ -105,7 +105,7 @@ static int snd_bcm2835_ctl_get(struct 
>> >> >> >> snd_kcontrol *kcontrol,
>> >> >> >>  }
>> >> >> >>
>> >> >> >>  static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol,
>> >> >> >> - struct snd_ctl_elem_value *ucontrol)
>> >> >> >> +struct snd_ctl_elem_value *ucontrol)
>> >> >> >>  {
>> >> >> >>   struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
>> >> >> >>   int changed = 0;
>> >> >> >
>> >> >> > This patch is corrupted and can not be applied :(
>> >> >>
>> >> >>
>> >> >> Why is this corrupted ?
>> >> >
>> >> > Try applying it with `git am`.  There should be space characters at the
>> >> > start of these lines but your email client deleted them:
>> >> >
>> >> > struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
>> >> > int changed = 0;
>> >> >
>> >> > Read Documentation/process/email-clients.rst
>> >> >
>> >> > regards,
>> >> > dan carpenter
>> >>
>> >>
>> >> Hello,
>> >>
>> >> I tried applying it with ' git am ' and it was giving me this error:
>> >>
>> >> fatal: corrupt patch at line XX
>> >
>> > Exactly.
>> >
>> >> I think this was produced because of running ./scripts/cleanfile on the 
>> >> patch .
>> >
>> > Why would you do that?  By doing that you corrupted the patch file :(
>>
>> After I run ./scritps/checkpatch.pl on the patch produced by git
>> format-patch it has trailing whitespaces . So I was using
>> ./scripts/cleanfile to fix that , I am not doing that anymore and am
>> also not getting the corrupt patch error .
>
> That means your code had trailing whitespaces, always fix that and NEVER
> hand-edit or modify a patch unless you really know what you are doing.
>
>> > Just use the proper output of 'git format-patch' and all will be fine.
>>
>> I have done this and am still getting these errors:
>>
>> error: patch failed:
>> drivers/staging/vc04_services/bcm2835-audio/bcm2835-  ctl.c:105
>>
>> error: drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:
>> patch does not apply
>>
>>
>> Why is it not applying ?
>
> That is up to you to figure out, we have no idea as to exactly what you
> are doing :)

I guess , I was applying the patch to the same repository I made the
change in :P , I am not getting any errors now .
>
> good luck!
>
> greg k-h

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


Re: [PATCH] Staging: vc04_services: bcm2835-audio: bcm2835-ctl.c: Fixed alignment to match open parenthesis.

2017-06-14 Thread Greg KH
On Wed, Jun 14, 2017 at 07:11:01PM +0530, srishti sharma wrote:
> On Wed, Jun 14, 2017 at 10:39 AM, Greg KH  wrote:
> > On Wed, Jun 14, 2017 at 03:15:11AM +0530, srishti sharma wrote:
> >> On Tue, Jun 13, 2017 at 8:17 PM, Dan Carpenter  
> >> wrote:
> >> > On Tue, Jun 13, 2017 at 08:07:14PM +0530, srishti sharma wrote:
> >> >> On Tue, Jun 13, 2017 at 6:30 PM, Greg KH  
> >> >> wrote:
> >> >> > On Sat, Jun 10, 2017 at 02:37:22AM +0530, srishti sharma wrote:
> >> >> >> Fixed alignment so that it matched open parenthesis.
> >> >> >>
> >> >> >> Signed-off-by: srishti sharma 
> >> >> >> ---
> >> >> >>  drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c | 2 +-
> >> >> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >> >> >>
> >> >> >> diff --git 
> >> >> >> a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c 
> >> >> >> b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
> >> >> >> index f484bb0..2148ed0 100644
> >> >> >> --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
> >> >> >> +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
> >> >> >> @@ -105,7 +105,7 @@ static int snd_bcm2835_ctl_get(struct 
> >> >> >> snd_kcontrol *kcontrol,
> >> >> >>  }
> >> >> >>
> >> >> >>  static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol,
> >> >> >> - struct snd_ctl_elem_value *ucontrol)
> >> >> >> +struct snd_ctl_elem_value *ucontrol)
> >> >> >>  {
> >> >> >>   struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
> >> >> >>   int changed = 0;
> >> >> >
> >> >> > This patch is corrupted and can not be applied :(
> >> >>
> >> >>
> >> >> Why is this corrupted ?
> >> >
> >> > Try applying it with `git am`.  There should be space characters at the
> >> > start of these lines but your email client deleted them:
> >> >
> >> > struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
> >> > int changed = 0;
> >> >
> >> > Read Documentation/process/email-clients.rst
> >> >
> >> > regards,
> >> > dan carpenter
> >>
> >>
> >> Hello,
> >>
> >> I tried applying it with ' git am ' and it was giving me this error:
> >>
> >> fatal: corrupt patch at line XX
> >
> > Exactly.
> >
> >> I think this was produced because of running ./scripts/cleanfile on the 
> >> patch .
> >
> > Why would you do that?  By doing that you corrupted the patch file :(
> 
> After I run ./scritps/checkpatch.pl on the patch produced by git
> format-patch it has trailing whitespaces . So I was using
> ./scripts/cleanfile to fix that , I am not doing that anymore and am
> also not getting the corrupt patch error .

That means your code had trailing whitespaces, always fix that and NEVER
hand-edit or modify a patch unless you really know what you are doing.

> > Just use the proper output of 'git format-patch' and all will be fine.
> 
> I have done this and am still getting these errors:
> 
> error: patch failed:
> drivers/staging/vc04_services/bcm2835-audio/bcm2835-  ctl.c:105
> 
> error: drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:
> patch does not apply
> 
> 
> Why is it not applying ?

That is up to you to figure out, we have no idea as to exactly what you
are doing :)

good luck!

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


Re: [PATCH v7 10/10] staging: fsl-mc: move bus driver out of staging

2017-06-14 Thread Greg KH
On Wed, Jun 14, 2017 at 01:38:04PM +, Laurentiu Tudor wrote:
> Hi Greg,
> 
> On 06/13/2017 01:22 PM, Greg KH wrote:
> > On Thu, Jun 08, 2017 at 05:28:55PM +0300, laurentiu.tu...@nxp.com wrote:
> >> From: Stuart Yoder 
> >>
> >> Move the source files out of staging into their final locations:
> >>-include files in drivers/staging/fsl-mc/include go to include/linux/fsl
> >>-irq-gic-v3-its-fsl-mc-msi.c goes to drivers/irqchip
> >
> > Why do you have so many different .h files?  You should only need 1
> > "external" one, and one "internal" one, right?  Can you please work on
> > cleaning that up first?
> >
> 
> So here's the list of headers, for quick reference.
> 
> dpbp.h
> dpcon-cmd.h
> dpmng.h
> dprc.h
> mc-bus.h
> mc-cmd.h
> mc-sys.h
> mc.h
> 
> And here's a proposal on how to reorganize them:
> 
>   - dpbp.h (together with dbbp.c) be left behind in staging as they are
> not used by the bus itself but by the drivers probing on this bus.
> They will be moved out of staging at a later time.
>   - same for dpcon-cmd.h. Will handle it when we'll start work on
> getting dpcon.c & dpcon.h out of staging.
>   - dprc.h contains APIs for handling mc-bus "device containers" that are
> managed by the mc-bus driver itself. I'd leave this as is, but i
> think i can make it private.
>   - regarding the multiple mc*.h files, i'll see what it takes to
> refactor them in a mc-bus.h + mc-bus-private.h
>   - dpmng.h merged in the public header
> 
> Regarding the future plans for dpbp.h and dpcon.h, these expose common 
> APIs used throughout all the drivers, so i think it makes sense to leave 
> them as they are and, when their time comes, move them in the public 
> include/linux/fsl.

Ok, that sounds like a good start, let's see how that goes...

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


Re: [PATCH] Staging: vc04_services: bcm2835-audio: bcm2835-ctl.c: Fixed alignment to match open parenthesis.

2017-06-14 Thread srishti sharma
On Wed, Jun 14, 2017 at 10:39 AM, Greg KH  wrote:
> On Wed, Jun 14, 2017 at 03:15:11AM +0530, srishti sharma wrote:
>> On Tue, Jun 13, 2017 at 8:17 PM, Dan Carpenter  
>> wrote:
>> > On Tue, Jun 13, 2017 at 08:07:14PM +0530, srishti sharma wrote:
>> >> On Tue, Jun 13, 2017 at 6:30 PM, Greg KH  
>> >> wrote:
>> >> > On Sat, Jun 10, 2017 at 02:37:22AM +0530, srishti sharma wrote:
>> >> >> Fixed alignment so that it matched open parenthesis.
>> >> >>
>> >> >> Signed-off-by: srishti sharma 
>> >> >> ---
>> >> >>  drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c | 2 +-
>> >> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >> >>
>> >> >> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c 
>> >> >> b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
>> >> >> index f484bb0..2148ed0 100644
>> >> >> --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
>> >> >> +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
>> >> >> @@ -105,7 +105,7 @@ static int snd_bcm2835_ctl_get(struct snd_kcontrol 
>> >> >> *kcontrol,
>> >> >>  }
>> >> >>
>> >> >>  static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol,
>> >> >> - struct snd_ctl_elem_value *ucontrol)
>> >> >> +struct snd_ctl_elem_value *ucontrol)
>> >> >>  {
>> >> >>   struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
>> >> >>   int changed = 0;
>> >> >
>> >> > This patch is corrupted and can not be applied :(
>> >>
>> >>
>> >> Why is this corrupted ?
>> >
>> > Try applying it with `git am`.  There should be space characters at the
>> > start of these lines but your email client deleted them:
>> >
>> > struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol);
>> > int changed = 0;
>> >
>> > Read Documentation/process/email-clients.rst
>> >
>> > regards,
>> > dan carpenter
>>
>>
>> Hello,
>>
>> I tried applying it with ' git am ' and it was giving me this error:
>>
>> fatal: corrupt patch at line XX
>
> Exactly.
>
>> I think this was produced because of running ./scripts/cleanfile on the 
>> patch .
>
> Why would you do that?  By doing that you corrupted the patch file :(

After I run ./scritps/checkpatch.pl on the patch produced by git
format-patch it has trailing whitespaces . So I was using
./scripts/cleanfile to fix that , I am not doing that anymore and am
also not getting the corrupt patch error .
>
> Just use the proper output of 'git format-patch' and all will be fine.

I have done this and am still getting these errors:

error: patch failed:
drivers/staging/vc04_services/bcm2835-audio/bcm2835-  ctl.c:105

error: drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c:
patch does not apply


Why is it not applying ?

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


Re: [PATCH v2] staging: vboxvideo: Add vboxvideo to drivers/staging

2017-06-14 Thread Michael Thayer
Hello Hans,

14.06.2017 15:30, Hans de Goede wrote:
[Discussion of vboxvideo and vboxguest driver clean-up.]
> As I already mentioned in previous mails on this, for the vboxguest driver
> my plan is to simply do a fork and remove anything related to the
> portability. It currently weighs in at 10+ lines of code which is a bit
> much for what it does I believe I will be able to get a Linux only version
> of it down to a small fraction of that and the result will be a much
> cleaner
> and better driver.
> 
> FWIW I've already stared looking into cleaning up the vboxguest driver and
> my first target is to remove all dependencies on the r0drv code.

Moving off-topic, but please let me know if you set up a git repository
for it as you did for vboxvideo.  Do you have plans (applies to
vboxvideo too) for how to merge changes to our code into the cleaned-up
code?  Of course, I am open to patches or suggestions as to how to
simplify the code in our repository as long as they do not affect other
platforms (vboxguest builds and runs for five different operating system
kernels).

Regards
Michael

> Regards,
> 
> Hans

-- 
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v7 10/10] staging: fsl-mc: move bus driver out of staging

2017-06-14 Thread Laurentiu Tudor
Hi Greg,

On 06/13/2017 01:22 PM, Greg KH wrote:
> On Thu, Jun 08, 2017 at 05:28:55PM +0300, laurentiu.tu...@nxp.com wrote:
>> From: Stuart Yoder 
>>
>> Move the source files out of staging into their final locations:
>>-include files in drivers/staging/fsl-mc/include go to include/linux/fsl
>>-irq-gic-v3-its-fsl-mc-msi.c goes to drivers/irqchip
>
> Why do you have so many different .h files?  You should only need 1
> "external" one, and one "internal" one, right?  Can you please work on
> cleaning that up first?
>

So here's the list of headers, for quick reference.

dpbp.h
dpcon-cmd.h
dpmng.h
dprc.h
mc-bus.h
mc-cmd.h
mc-sys.h
mc.h

And here's a proposal on how to reorganize them:

  - dpbp.h (together with dbbp.c) be left behind in staging as they are
not used by the bus itself but by the drivers probing on this bus.
They will be moved out of staging at a later time.
  - same for dpcon-cmd.h. Will handle it when we'll start work on
getting dpcon.c & dpcon.h out of staging.
  - dprc.h contains APIs for handling mc-bus "device containers" that are
managed by the mc-bus driver itself. I'd leave this as is, but i
think i can make it private.
  - regarding the multiple mc*.h files, i'll see what it takes to
refactor them in a mc-bus.h + mc-bus-private.h
  - dpmng.h merged in the public header

Regarding the future plans for dpbp.h and dpcon.h, these expose common 
APIs used throughout all the drivers, so i think it makes sense to leave 
them as they are and, when their time comes, move them in the public 
include/linux/fsl.

---
Thanks & Best Regards, Laurentiu
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/7] staging: rtl8723bs: wifi_regd.c: put spaces around binary operators

2017-06-14 Thread Joe Perches
On Wed, 2017-06-14 at 15:19 +0300, Dan Carpenter wrote:
> On Wed, Jun 14, 2017 at 09:49:10PM +1000, Ian W MORRISON wrote:
> > On 14 June 2017 at 00:36, Dan Carpenter  wrote:
> > > Kernel style is to have spaces around the operators.  This is staging
> > > code so we do all the style fixes.  We don't always update older drivers
> > > but sometimes we do.  No one is planning to change those drivers though
> > > so I guess the answer is no we're not going to update those unless you
> > > are?
> > > 
> > 
> > Thanks for the explanation. I assume submitting changes for the
> > drivers I identified would only be seen as minor corrections to 'the
> > chaff' resulting in unnecessary churn. If however it is expected that
> > corrections should be made when identified then I'm willing to prepare
> > a patch set. I'm happy to take advice either way.
> 
> I would just leave the old drivers as-is.

There would be some value in converting them, if only to
note what functions are identical across multiple drivers
and could be consolidated.

> Having spaces around operators has always been kernel style, but it's
> only fairly recently that checkpatch.pl started to complain.

Not really.  Linux is a relatively old project.

The CodingStyle for spaces around operators was added about
ten years ago.  Bit shifts were and still are not mentioned.

Messages for spaces around arithmetic were not emitted because
so much old code had various styles and it would have been a
lot of churn to update with many complaints from various
maintainers.  checkpatch today would emit about a quarter
million error messages for spacing on the kernel source tree.
That's a lot of whitespace churn.

There is a lot of code in drivers and a few other areas that
hasn't been touched in those ten years that doesn't follow
today's commonly accepted coding styles.

CodingStyle still doesn't mention a lot of style nits and bits.

About spacing around bit shifts:

This is just a --strict preference that several people had
expressed a desire to warn about spaces around arithmetic
and bit operators.  

It was added a couple years ago to checkpatch but not to
CodingStyle.

The --strict test applies by default to net/and drivers/net
because DaveM is pretty style conscious and asks for rework
when patches don't have the style he prefers.

And the --strict test applies to drivers/staging as well
because it gives more opportunities for first-time patch
submitters to send cleanup style patches (and GregKH can
be a stickler too).

> We keep making checkpatch.pl more stict as time goes on.

I try to add things to checkpatch only when there seems to
be a general consensus about a style or when a significant
percentage of code throughout the kernel already follows a 
specific style.

Actively developed Kernel code now has a fairly uniform
style and additions to checkpatch seem less necessary.

One area where checkpatch could use some enhancing is in
tracking indentation better.

checkpatch doesn't emit warnings with indentation like:

statement(1);
statement(2);

where the statements should be aligned on the same tabstop.

I'm playing with it but patches welcome...

> I think that's good
> because some reviewers will make you redo patches for style issues so
> having checkpatch.pl complain early on means you don't have redo the
> patch.  But it also means that old code will never be checkpatch.pl
> clean because we keep adding new checkpatch warnings.
> 
> And it's fine that old code has checkpatch warnings.  The point of
> checkpatch is to check new patches not to churn through old code.  As a
> reviewer, I find that checkpatch saves my time because I can often tell
> people to run it instead of listing all the style complaints.

All very true.

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


Re: [PATCH v2] staging: vboxvideo: Add vboxvideo to drivers/staging

2017-06-14 Thread Hans de Goede

Hi all,

On 14-06-17 11:34, Michael Thayer wrote:

Hello Sean,

13.06.2017 20:03, Sean Paul wrote:
[Discussion of vboxvideo driver clean-up.]


First, thank you for your submission.


Thank you for your feedback.

[Discussion of the OS-independent code in the driver submission.]


I took a quick skim through your driver, and there doesn't seem to be much
secret sauce there that will be tough to keep up-to-date across platforms.


I have two particular concerns there: first if we add new functionality
(which we would do out of tree first) it will need porting over.
Acceleration support is the most likely candidate.  And if someone does
make fixes to that part of the code in the kernel tree they will also
need porting over.  I agree, that concern is probably overblown, and
best addressed by keeping that part of the code as close to our tree as
possible while still meeting kernel standards (hence my question as to
what that would be).

The second concern is not relevant to DRI, but it concerns our other
guest drivers (not the host one with the C++ in it Greg!) which Hans
also expressed interest in putting upstream after seeing how vboxvideo
fares.  The OS-independent part is quite a bit larger and more volatile,
though it has thankfully stablised a lot.  That concern is probably also
overblown, though I do wonder whether upstreaming those driver is the
best solution (that would be Hans's call though).


As I already mentioned in previous mails on this, for the vboxguest driver
my plan is to simply do a fork and remove anything related to the
portability. It currently weighs in at 10+ lines of code which is a bit
much for what it does I believe I will be able to get a Linux only version
of it down to a small fraction of that and the result will be a much cleaner
and better driver.

FWIW I've already stared looking into cleaning up the vboxguest driver and
my first target is to remove all dependencies on the r0drv code.

Regards,

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


RE: [PATCH 15/18] staging: fsl-dpaa2/eth: Reorder priv fields

2017-06-14 Thread Ruxandra Ioana Radulescu
> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Tuesday, June 13, 2017 1:04 PM
> To: Ruxandra Ioana Radulescu 
> Cc: de...@driverdev.osuosl.org; stuyo...@gmail.com; a...@arndb.de;
> linux-ker...@vger.kernel.org; ag...@suse.de; Bharat Bhushan
> ; Bogdan Purcareata
> ; linux-arm-ker...@lists.infradead.org;
> Laurentiu Tudor 
> Subject: Re: [PATCH 15/18] staging: fsl-dpaa2/eth: Reorder priv fields
> 
> On Tue, Jun 06, 2017 at 10:00:38AM -0500, Ioana Radulescu wrote:
> > Reorder fields in the device's private structure such that
> > the ones most used on the hotpath are at the beginning of
> > the structure.
> >
> > This brings a small performance improvement due to better
> > cache usage.
> 
> Really?  What kind of performance improvement?  Always be specific.

Fair point, thanks.

The test scenario was ipfwd with small frames and the improvement ~1%,
but I took this patch from an internal repo, so I need to redo the
measurements on the current tree before resending.

> 
> Please fix up and resend.

We're preparing a larger patchset with several optimizations, I'll
probably include the v2 there.

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


Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-14 Thread Greg Kroah-Hartman
On Wed, Jun 14, 2017 at 03:36:30PM +0300, Andy Shevchenko wrote:
> On Wed, Jun 14, 2017 at 3:18 PM, Samuel Thibault
>  wrote:
> > Greg KH, on mer. 14 juin 2017 13:48:02 +0200, wrote:
> >> On Wed, Jun 14, 2017 at 01:26:09PM +0200, Samuel Thibault wrote:
> >> > Greg KH, on mer. 14 juin 2017 12:15:41 +0200, wrote:
> 
> >> And trying to have the kernel do the mapping based on strings like this
> >> is not ok, sorry.
> >
> > So what is the solution?  Users would find it completely crazy to have
> > to provide major/minor numbers.
> 
> Shouldn't udev take care of major/minor and alike stuff in user space?

No, that's all handled by the kernel now, in devtmpfs.

The console stuff is odd though, but that is each driver defining the
name for itself, major/minor does not apply.  Also, a separate driver is
not having to figure this all out.  I wonder if we could just add a tty
core function for this as it does know the name of everything that has
been registered with it, right?

thanks,

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


Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-14 Thread Samuel Thibault
Andy Shevchenko, on mer. 14 juin 2017 15:36:30 +0300, wrote:
> On Wed, Jun 14, 2017 at 3:18 PM, Samuel Thibault
>  wrote:
> > Greg KH, on mer. 14 juin 2017 13:48:02 +0200, wrote:
> >> On Wed, Jun 14, 2017 at 01:26:09PM +0200, Samuel Thibault wrote:
> >> > Greg KH, on mer. 14 juin 2017 12:15:41 +0200, wrote:
> 
> >> And trying to have the kernel do the mapping based on strings like this
> >> is not ok, sorry.
> >
> > So what is the solution?  Users would find it completely crazy to have
> > to provide major/minor numbers.
> 
> Shouldn't udev take care of major/minor and alike stuff in user space?

We want speakup to get initialized before udev etc., just like the early
console.

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


Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-14 Thread Andy Shevchenko
On Wed, Jun 14, 2017 at 3:18 PM, Samuel Thibault
 wrote:
> Greg KH, on mer. 14 juin 2017 13:48:02 +0200, wrote:
>> On Wed, Jun 14, 2017 at 01:26:09PM +0200, Samuel Thibault wrote:
>> > Greg KH, on mer. 14 juin 2017 12:15:41 +0200, wrote:

>> And trying to have the kernel do the mapping based on strings like this
>> is not ok, sorry.
>
> So what is the solution?  Users would find it completely crazy to have
> to provide major/minor numbers.

Shouldn't udev take care of major/minor and alike stuff in user space?

-- 
With Best Regards,
Andy Shevchenko
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v7 02/10] staging: fsl-mc: fix macros with possible side effects

2017-06-14 Thread Laurentiu Tudor


On 06/13/2017 01:12 PM, Greg KH wrote:
> On Thu, Jun 08, 2017 at 05:28:47PM +0300, laurentiu.tu...@nxp.com wrote:
>> From: Laurentiu Tudor 
>>
>> Several macros were triggering this checkpatch.pl warning:
>>"Macro argument reuse '$arg' - possible side-effects?"
>> Fix the warning by avoiding multiple macro argument use.
>>
>> Signed-off-by: Laurentiu Tudor 
>> ---
>>
>> Notes:
>>  -v7
>>-no changes
>>
>>   drivers/staging/fsl-mc/bus/dprc-driver.c  | 10 +++---
>>   drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 11 +++
>>   2 files changed, 14 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c 
>> b/drivers/staging/fsl-mc/bus/dprc-driver.c
>> index d723c69..39c9a3b 100644
>> --- a/drivers/staging/fsl-mc/bus/dprc-driver.c
>> +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
>> @@ -21,9 +21,13 @@
>>
>>   #define FSL_MC_DPRC_DRIVER_NAME"fsl_mc_dprc"
>>
>> -#define FSL_MC_DEVICE_MATCH(_mc_dev, _obj_desc) \
>> -(strcmp((_mc_dev)->obj_desc.type, (_obj_desc)->type) == 0 && \
>> - (_mc_dev)->obj_desc.id == (_obj_desc)->id)
>> +#define FSL_MC_DEVICE_MATCH(_mc_dev, _obj_desc) 
>> \
>> +({  \
>> +struct fsl_mc_device *__mc_dev = _mc_dev;   \
>> +struct dprc_obj_desc *__obj_desc = _obj_desc;   \
>> +(strcmp(__mc_dev->obj_desc.type, __obj_desc->type) == 0 &&  \
>> +__mc_dev->obj_desc.id == __obj_desc->id);   \
>> +})
>
> Ick, no.  Just make this a real function please.
>
>>
>>   struct dprc_child_objs {
>>  int child_count;
>> diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c 
>> b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
>> index ce07096..d3def40 100644
>> --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
>> +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
>> @@ -17,10 +17,13 @@
>>   #include "dpcon-cmd.h"
>>   #include "fsl-mc-private.h"
>>
>> -#define FSL_MC_IS_ALLOCATABLE(_obj_type) \
>> -(strcmp(_obj_type, "dpbp") == 0 || \
>> - strcmp(_obj_type, "dpmcp") == 0 || \
>> - strcmp(_obj_type, "dpcon") == 0)
>> +#define FSL_MC_IS_ALLOCATABLE(_obj_type)\
>> +({  \
>> +const char *__obj_type = _obj_type; \
>> +(strcmp(__obj_type, "dpbp") == 0 || \
>> + strcmp(__obj_type, "dpmcp") == 0 ||\
>> + strcmp(__obj_type, "dpcon") == 0); \
>> +})
>
> Same here.  Don't put real logic in a #define, it never makes sense to
> do it and only makes things much harder to debug.
>

Ok, will do. Lets drop this patch and i'll send another one changing all 
these to functions.

---
Thanks & Best Regards, Laurentiu
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-14 Thread Samuel Thibault
Greg KH, on mer. 14 juin 2017 13:48:02 +0200, wrote:
> On Wed, Jun 14, 2017 at 01:26:09PM +0200, Samuel Thibault wrote:
> > Greg KH, on mer. 14 juin 2017 12:15:41 +0200, wrote:
> > > Ah, no, nevermind, you just need the major/minor.  So why not just take
> > > that as the input here, and not a string?
> > 
> > Because real users don't know about major/minor numbers.
> 
> I'm not disagreeing, it's just that the kernel doesn't know about
> "device names" either :)

Well, it does for the console= parameter, for instance.  I know it's not
actually related with major/minor numbering, but it's still meant to
designate the same thing.

> And trying to have the kernel do the mapping based on strings like this
> is not ok, sorry.

So what is the solution?  Users would find it completely crazy to have
to provide major/minor numbers.

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


Re: [PATCH 1/7] staging: rtl8723bs: wifi_regd.c: put spaces around binary operators

2017-06-14 Thread Dan Carpenter
On Wed, Jun 14, 2017 at 09:49:10PM +1000, Ian W MORRISON wrote:
> On 14 June 2017 at 00:36, Dan Carpenter  wrote:
> > Kernel style is to have spaces around the operators.  This is staging
> > code so we do all the style fixes.  We don't always update older drivers
> > but sometimes we do.  No one is planning to change those drivers though
> > so I guess the answer is no we're not going to update those unless you
> > are?
> >
> 
> Thanks for the explanation. I assume submitting changes for the
> drivers I identified would only be seen as minor corrections to 'the
> chaff' resulting in unnecessary churn. If however it is expected that
> corrections should be made when identified then I'm willing to prepare
> a patch set. I'm happy to take advice either way.

I would just leave the old drivers as-is.

Having spaces around operators has always been kernel style, but it's
only fairly recently that checkpatch.pl started to complain.  We keep
making checkpatch.pl more stict as time goes on.  I think that's good
because some reviewers will make you redo patches for style issues so
having checkpatch.pl complain early on means you don't have redo the
patch.  But it also means that old code will never be checkpatch.pl
clean because we keep adding new checkpatch warnings.

And it's fine that old code has checkpatch warnings.  The point of
checkpatch is to check new patches not to churn through old code.  As a
reviewer, I find that checkpatch saves my time because I can often tell
people to run it instead of listing all the style complaints.

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


Re: [PATCH 1/7] staging: rtl8723bs: wifi_regd.c: put spaces around binary operators

2017-06-14 Thread Ian W MORRISON
On 14 June 2017 at 00:36, Dan Carpenter  wrote:
> Kernel style is to have spaces around the operators.  This is staging
> code so we do all the style fixes.  We don't always update older drivers
> but sometimes we do.  No one is planning to change those drivers though
> so I guess the answer is no we're not going to update those unless you
> are?
>

Thanks for the explanation. I assume submitting changes for the
drivers I identified would only be seen as minor corrections to 'the
chaff' resulting in unnecessary churn. If however it is expected that
corrections should be made when identified then I'm willing to prepare
a patch set. I'm happy to take advice either way.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-14 Thread Greg Kroah-Hartman
On Wed, Jun 14, 2017 at 01:26:09PM +0200, Samuel Thibault wrote:
> Greg KH, on mer. 14 juin 2017 12:15:41 +0200, wrote:
> > Ah, no, nevermind, you just need the major/minor.  So why not just take
> > that as the input here, and not a string?
> 
> Because real users don't know about major/minor numbers.

I'm not disagreeing, it's just that the kernel doesn't know about
"device names" either :)

And trying to have the kernel do the mapping based on strings like this
is not ok, sorry.

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


Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-14 Thread Samuel Thibault
Greg KH, on mer. 14 juin 2017 12:15:41 +0200, wrote:
> Ah, no, nevermind, you just need the major/minor.  So why not just take
> that as the input here, and not a string?

Because real users don't know about major/minor numbers.

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


Re: [PATCH 1/2] staging: rtl8723bs: Convert LIST_CONTAINOR to use kernel container_of

2017-06-14 Thread Joe Perches
On Wed, 2017-06-14 at 12:48 +0200, Greg Kroah-Hartman wrote:
> On Wed, Jun 14, 2017 at 03:38:21AM -0700, Joe Perches wrote:
> > On Wed, 2017-06-14 at 12:18 +0200, Greg Kroah-Hartman wrote:
> > > On Tue, Jun 13, 2017 at 02:12:56PM -0700, Joe Perches wrote:
> > > > These are similar macros so use the normal kernel one.
> > > > 
> > > > As well, there are odd games being played with casting a plist to
> > > > a union recv_frame by using LIST_CONTAINOR.  Just use a direct cast
> > > > to union recv_frame instead.
> > 
> > []
> > > > diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c 
> > > > b/drivers/staging/rtl8723bs/core/rtw_recv.c
> > 
> > []
> > > > @@ -129,7 +129,7 @@ union recv_frame *_rtw_alloc_recvframe(struct 
> > > > __queue *pfree_recv_queue)
> > > >  
> > > > plist = get_next(phead);
> > > >  
> > > > -   precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
> > > > +   precvframe = (union recv_frame *)plist;
> > > 
> > > No, you are "assuming" that the list_head is going to stay the first
> > > object of this structure, and what if it isn't?
> > > 
> > > Just use container_of, that way at least you get the type safeness of
> > > the call, and if something changes in the future, you don't instantly
> > > break the code everywhere without knowing it.
> > 
> > It's a named union u and it's exactly at the beginning.
> > It's unlikely to change.
> > 
> > The container_of macro doesn't work here as there it has
> > a BUILD_BUG_ON_MSG and there are pointer type mismatches
> > on those uses.
> 
> Yeah, but random pointer casts like this are not good, I don't want to
> see that here, sorry.
> 
> Fix up the pointer mismatches, if there are any, as that implies there
> are bugs here...

.

No thanks.

That's what the current code is doing now.

Ignore the whole thing if you want.

Someone else might fix it eventually, but more
likely the current rtl8723bs driver will be
dropped and completely rewritten anyway.

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


Re: [PATCH 1/2] staging: rtl8723bs: Convert LIST_CONTAINOR to use kernel container_of

2017-06-14 Thread Greg Kroah-Hartman
On Wed, Jun 14, 2017 at 03:38:21AM -0700, Joe Perches wrote:
> On Wed, 2017-06-14 at 12:18 +0200, Greg Kroah-Hartman wrote:
> > On Tue, Jun 13, 2017 at 02:12:56PM -0700, Joe Perches wrote:
> > > These are similar macros so use the normal kernel one.
> > > 
> > > As well, there are odd games being played with casting a plist to
> > > a union recv_frame by using LIST_CONTAINOR.  Just use a direct cast
> > > to union recv_frame instead.
> []
> > > diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c 
> > > b/drivers/staging/rtl8723bs/core/rtw_recv.c
> []
> > > @@ -129,7 +129,7 @@ union recv_frame *_rtw_alloc_recvframe(struct __queue 
> > > *pfree_recv_queue)
> > >  
> > >   plist = get_next(phead);
> > >  
> > > - precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
> > > + precvframe = (union recv_frame *)plist;
> > 
> > No, you are "assuming" that the list_head is going to stay the first
> > object of this structure, and what if it isn't?
> > 
> > Just use container_of, that way at least you get the type safeness of
> > the call, and if something changes in the future, you don't instantly
> > break the code everywhere without knowing it.
> 
> It's a named union u and it's exactly at the beginning.
> It's unlikely to change.
> 
> The container_of macro doesn't work here as there it has
> a BUILD_BUG_ON_MSG and there are pointer type mismatches
> on those uses.

Yeah, but random pointer casts like this are not good, I don't want to
see that here, sorry.

Fix up the pointer mismatches, if there are any, as that implies there
are bugs here...

thanks,

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


Re: [PATCH 1/2] staging: rtl8723bs: Convert LIST_CONTAINOR to use kernel container_of

2017-06-14 Thread Joe Perches
On Wed, 2017-06-14 at 12:18 +0200, Greg Kroah-Hartman wrote:
> On Tue, Jun 13, 2017 at 02:12:56PM -0700, Joe Perches wrote:
> > These are similar macros so use the normal kernel one.
> > 
> > As well, there are odd games being played with casting a plist to
> > a union recv_frame by using LIST_CONTAINOR.  Just use a direct cast
> > to union recv_frame instead.
[]
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c 
> > b/drivers/staging/rtl8723bs/core/rtw_recv.c
[]
> > @@ -129,7 +129,7 @@ union recv_frame *_rtw_alloc_recvframe(struct __queue 
> > *pfree_recv_queue)
> >  
> > plist = get_next(phead);
> >  
> > -   precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
> > +   precvframe = (union recv_frame *)plist;
> 
> No, you are "assuming" that the list_head is going to stay the first
> object of this structure, and what if it isn't?
> 
> Just use container_of, that way at least you get the type safeness of
> the call, and if something changes in the future, you don't instantly
> break the code everywhere without knowing it.

It's a named union u and it's exactly at the beginning.
It's unlikely to change.

The container_of macro doesn't work here as there it has
a BUILD_BUG_ON_MSG and there are pointer type mismatches
on those uses.

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


Re: [PATCH 3/4] staging: ks7010: add initial cfg80211 implementation

2017-06-14 Thread Greg Kroah-Hartman
On Wed, Jun 14, 2017 at 04:30:37PM +1000, Tobin C. Harding wrote:
> Currently we are in the process of replacing the WEXT interface with
> the cfg80211 API. WEXT code is currently within a sub directory and
> not included in the module build.
> 
> The driver is designed with various layers of abstraction;
> 
>   - The main layer contains the net_device_ops callbacks. Also included
> in this layer is the rx/tx code.
>   - The SDIO layer contains code specific to the SDIO hardware.
>   - The cfg80211 layer contains the implementation of the cfg80211
> configuration API.
>   - The HIF (Host InterFace) layer provides driver policy and interfaces
> between the cfg80211 layer and the FIL.
>   - The FIL (Firmware Interface Layer) provides mechanism for
> interfacing with the firmware.
> 
> The firmware interface is derived from the WEXT driver, if we
> write code to interface with the firmware as a separate abstraction
> layer then the cfg80211 code and the rest of the driver functionality
> can be written cleanly from scratch.
> 
> The separate layers are restricted to calls as indicated by the
> following diagram, A --> B indicates layer A calls functions in layer B.
> 
> >  main (tx/rx)  <--->  SDIO
> |
> | |
> | |
> v v
> 
> cfg80211  <--->  HIF
> 
>   |
>   |
>   v
> 
>  FIL
> 
> Implementation status is outlined in README.rst. A todo list is
> included in TODO.rst.
> 
> Add initial cfg80211 implementation.
> 
> Signed-off-by: Tobin C. Harding 
> ---
>  drivers/staging/ks7010/Kconfig |2 +
>  drivers/staging/ks7010/Makefile|   28 +-
>  drivers/staging/ks7010/README.rst  |   91 +++
>  drivers/staging/ks7010/TODO.rst|   30 +
>  drivers/staging/ks7010/cfg80211.c  |  981 +++
>  drivers/staging/ks7010/cfg80211.h  |   40 ++
>  drivers/staging/ks7010/common.h|   33 +
>  drivers/staging/ks7010/eap.h   |   73 ++
>  drivers/staging/ks7010/fil.c   | 1294 
> 
>  drivers/staging/ks7010/fil.h   |  559 
>  drivers/staging/ks7010/fil_types.h |  851 
>  drivers/staging/ks7010/hif.c   |  505 ++
>  drivers/staging/ks7010/hif.h   |  202 ++
>  drivers/staging/ks7010/ks7010.h|  309 +
>  drivers/staging/ks7010/main.c  |  337 ++
>  drivers/staging/ks7010/rx.c|  130 
>  drivers/staging/ks7010/sdio.c  |  691 +++
>  drivers/staging/ks7010/sdio.h  |   37 ++
>  drivers/staging/ks7010/tx.c|  170 +
>  19 files changed, 6362 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/staging/ks7010/README.rst
>  create mode 100644 drivers/staging/ks7010/TODO.rst
>  create mode 100644 drivers/staging/ks7010/cfg80211.c
>  create mode 100644 drivers/staging/ks7010/cfg80211.h
>  create mode 100644 drivers/staging/ks7010/common.h
>  create mode 100644 drivers/staging/ks7010/eap.h
>  create mode 100644 drivers/staging/ks7010/fil.c
>  create mode 100644 drivers/staging/ks7010/fil.h
>  create mode 100644 drivers/staging/ks7010/fil_types.h
>  create mode 100644 drivers/staging/ks7010/hif.c
>  create mode 100644 drivers/staging/ks7010/hif.h
>  create mode 100644 drivers/staging/ks7010/ks7010.h
>  create mode 100644 drivers/staging/ks7010/main.c
>  create mode 100644 drivers/staging/ks7010/rx.c
>  create mode 100644 drivers/staging/ks7010/sdio.c
>  create mode 100644 drivers/staging/ks7010/sdio.h
>  create mode 100644 drivers/staging/ks7010/tx.c
> 
> diff --git a/drivers/staging/ks7010/Kconfig b/drivers/staging/ks7010/Kconfig
> index 437b928..71f2026 100644
> --- a/drivers/staging/ks7010/Kconfig
> +++ b/drivers/staging/ks7010/Kconfig
> @@ -1,5 +1,7 @@
>  config KS7010
>   tristate "KeyStream KS7010 SDIO support"
> + depends on CFG80211
> +depends on MMC

tabs vs. spaces???



>   ---help---
> This is a driver for KeyStream KS7010 based SDIO WIFI cards. It is
> found on at least later Spectec SDW-821 (FCC-ID "S2Y-WLAN-11G-K" only,
> diff --git a/drivers/staging/ks7010/Makefile b/drivers/staging/ks7010/Makefile
> index 9444885..1cd570e 100644
> --- a/drivers/staging/ks7010/Makefile
> +++ b/drivers/staging/ks7010/Makefile
> @@ -1 +1,27 @@
> -# Makefile intentionally left blank
> +#-
> +# Driver for KeyStream wireless LAN cards.
> +#
> +# Copyright (C) 2005-2008 KeyStream Corp.
> +# Copyright (C) 2009 Renesas Technology Corp.
> +# Copyright (C) 2017 Tobin C. Harding.
> +#
> +# 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.
> +#
> +# This program is distributed in the hope that it will be useful, but
> +# WITHOUT ANY WARRANTY; without 

Re: [PATCH 1/4] staging: ks7010: move WEXT files to sub directory

2017-06-14 Thread Greg Kroah-Hartman
On Wed, Jun 14, 2017 at 04:30:35PM +1000, Tobin C. Harding wrote:
> Current driver implements the WEXT interface. WEXT is in maintenance
> mode, we need to re-write the driver using the cfg80211 API. The current
> driver is handy as a reference for the new implementation, we can keep
> it in tree for now.
> 
> Move WEXT driver to sub directory, add dummy Makefile and Kconfig so
> build completes successfully but does not process any files from the
> WEXT directory.
> 
> Signed-off-by: Tobin C. Harding 
> ---
>  drivers/staging/ks7010/Kconfig| 6 +-
>  drivers/staging/ks7010/Makefile   | 5 +
>  drivers/staging/ks7010/{ => wext}/TODO| 0
>  drivers/staging/ks7010/{ => wext}/eap_packet.h| 0
>  drivers/staging/ks7010/{ => wext}/ks7010_sdio.c   | 0
>  drivers/staging/ks7010/{ => wext}/ks7010_sdio.h   | 0
>  drivers/staging/ks7010/{ => wext}/ks_hostif.c | 0
>  drivers/staging/ks7010/{ => wext}/ks_hostif.h | 0
>  drivers/staging/ks7010/{ => wext}/ks_wlan.h   | 0
>  drivers/staging/ks7010/{ => wext}/ks_wlan_ioctl.h | 0
>  drivers/staging/ks7010/{ => wext}/ks_wlan_net.c   | 0
>  drivers/staging/ks7010/{ => wext}/michael_mic.c   | 0
>  drivers/staging/ks7010/{ => wext}/michael_mic.h   | 0
>  13 files changed, 2 insertions(+), 9 deletions(-)
>  rename drivers/staging/ks7010/{ => wext}/TODO (100%)
>  rename drivers/staging/ks7010/{ => wext}/eap_packet.h (100%)
>  rename drivers/staging/ks7010/{ => wext}/ks7010_sdio.c (100%)
>  rename drivers/staging/ks7010/{ => wext}/ks7010_sdio.h (100%)
>  rename drivers/staging/ks7010/{ => wext}/ks_hostif.c (100%)
>  rename drivers/staging/ks7010/{ => wext}/ks_hostif.h (100%)
>  rename drivers/staging/ks7010/{ => wext}/ks_wlan.h (100%)
>  rename drivers/staging/ks7010/{ => wext}/ks_wlan_ioctl.h (100%)
>  rename drivers/staging/ks7010/{ => wext}/ks_wlan_net.c (100%)
>  rename drivers/staging/ks7010/{ => wext}/michael_mic.c (100%)
>  rename drivers/staging/ks7010/{ => wext}/michael_mic.h (100%)
> 
> diff --git a/drivers/staging/ks7010/Kconfig b/drivers/staging/ks7010/Kconfig
> index 0b92176..437b928 100644
> --- a/drivers/staging/ks7010/Kconfig
> +++ b/drivers/staging/ks7010/Kconfig
> @@ -1,10 +1,6 @@
>  config KS7010
>   tristate "KeyStream KS7010 SDIO support"
> - depends on MMC && WIRELESS
> - select WIRELESS_EXT
> - select WEXT_PRIV
> - select FW_LOADER
> - help

With this patch, doesn't the code now break as it does depend on
WIRELESS and MMC still?

Why not keep those depends?

thanks,

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


Re: [PATCH 1/2] staging: rtl8723bs: Convert LIST_CONTAINOR to use kernel container_of

2017-06-14 Thread Greg Kroah-Hartman
On Tue, Jun 13, 2017 at 02:12:56PM -0700, Joe Perches wrote:
> These are similar macros so use the normal kernel one.
> 
> As well, there are odd games being played with casting a plist to
> a union recv_frame by using LIST_CONTAINOR.  Just use a direct cast
> to union recv_frame instead.
> 
> Signed-off-by: Joe Perches 
> ---
>  drivers/staging/rtl8723bs/core/rtw_recv.c   | 14 +++---
>  drivers/staging/rtl8723bs/core/rtw_sta_mgt.c|  2 +-
>  drivers/staging/rtl8723bs/include/osdep_service_linux.h |  2 +-
>  3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c 
> b/drivers/staging/rtl8723bs/core/rtw_recv.c
> index 695a5c958c80..e1d6d0a4b115 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
> @@ -129,7 +129,7 @@ union recv_frame *_rtw_alloc_recvframe(struct __queue 
> *pfree_recv_queue)
>  
>   plist = get_next(phead);
>  
> - precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
> + precvframe = (union recv_frame *)plist;

No, you are "assuming" that the list_head is going to stay the first
object of this structure, and what if it isn't?

Just use container_of, that way at least you get the type safeness of
the call, and if something changes in the future, you don't instantly
break the code everywhere without knowing it.

thanks,

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


Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-14 Thread Greg Kroah-Hartman
On Wed, Jun 14, 2017 at 12:13:26PM +0200, Greg Kroah-Hartman wrote:
> On Tue, Jun 13, 2017 at 11:37:03PM +0100, okash.khaw...@gmail.com wrote:
> > The function converts strings like ttyS0 and ttyUSB0 to dev_t like
> > (4, 64) and (188, 0). Subsequent patch in this set will call it to
> > convert user-supplied device into device number. The function does
> > some basic sanity checks on the string passed in. It currently supports
> > ttyS*, ttyUSB* and, for selected synths, lp*.
> > 
> > In order to do this, the patch also introduces a string member variable
> > named 'dev' to struct spk_synth. 'dev' represents the device name -
> > ttyUSB0 etc - which needs conversion to dev_t.
> > 
> > Signed-off-by: Okash Khawaja 
> > Reviewed-by: Samuel Thibault 
> > 
> > ---
> >  drivers/staging/speakup/spk_priv.h  |2 
> >  drivers/staging/speakup/spk_ttyio.c |  105 
> > 
> >  drivers/staging/speakup/spk_types.h |1 
> >  3 files changed, 108 insertions(+)
> > 
> > --- a/drivers/staging/speakup/spk_priv.h
> > +++ b/drivers/staging/speakup/spk_priv.h
> > @@ -40,6 +40,8 @@
> >  
> >  #define KT_SPKUP 15
> >  #define SPK_SYNTH_TIMEOUT 10 /* in micro-seconds */
> > +#define SYNTH_DEFAULT_DEV "ttyS0"
> > +#define SYNTH_DEFAULT_SER 0
> >  
> >  const struct old_serial_port *spk_serial_init(int index);
> >  void spk_stop_serial_interrupt(void);
> > --- a/drivers/staging/speakup/spk_ttyio.c
> > +++ b/drivers/staging/speakup/spk_ttyio.c
> > @@ -7,6 +7,13 @@
> >  #include "spk_types.h"
> >  #include "spk_priv.h"
> >  
> > +/* Supported device types */
> > +#define DEV_PREFIX_TTYS "ttyS"
> > +#define DEV_PREFIX_TTYUSB "ttyUSB"
> > +#define DEV_PREFIX_LP "lp"
> > +
> > +const char *lp_supported[] = { "acntsa", "bns", "dummy", "txprt" };
> > +
> >  struct spk_ldisc_data {
> > char buf;
> > struct semaphore sem;
> > @@ -16,6 +23,104 @@ struct spk_ldisc_data {
> >  static struct spk_synth *spk_ttyio_synth;
> >  static struct tty_struct *speakup_tty;
> >  
> > +static int name_to_dev(const char *name, dev_t *dev_no)
> > +{
> > +int maj = -1, min = -1;
> > +
> > +if (strncmp(name, DEV_PREFIX_TTYS, strlen(DEV_PREFIX_TTYS)) == 0) {
> > +if (kstrtoint(name + strlen(DEV_PREFIX_TTYS), 10, )) {
> > +   pr_err("speakup: Invalid ser param. Must be \
> > +   between 0 and 191 inclusive.\n");
> > +return -EINVAL;
> > +}
> > +maj = 4;
> > +
> > +if (min < 0 || min > 191) {
> > +   pr_err("speakup: Invalid ser param. Must be \
> > +   between 0 and 191 inclusive.\n");
> > +return -EINVAL;
> > +}
> > +min = min + 64;
> > +} else if (strncmp(name, DEV_PREFIX_TTYUSB, 
> > strlen(DEV_PREFIX_TTYUSB))
> > +   == 0) {
> > +if (kstrtoint(name + strlen(DEV_PREFIX_TTYUSB), 10, )) 
> > {
> > +pr_err("speakup: Invalid ttyUSB number. \
> > +   Must be a number from 0 onwards\n");
> > +return -EINVAL;
> > +}
> > +maj = 188;
> > +
> > +if (min < 0) {
> > +pr_err("speakup: Invalid ttyUSB number. \
> > +   Must be a number from 0 onwards\n");
> > +return -EINVAL;
> > +}
> > +} else if (strncmp(name, DEV_PREFIX_LP, strlen(DEV_PREFIX_LP)) == 
> > 0) {
> > +if (kstrtoint(name + strlen(DEV_PREFIX_LP), 10, )) {
> > +pr_warn("speakup: Invalid lp number. \
> > +   Must be a number from 0 onwards\n");
> > +return -EINVAL;
> > +}
> > +maj = 6;
> > +
> > +if (min < 0) {
> > +pr_warn("speakup: Invalid lp number. \
> > +   Must be a number from 0 onwards\n");
> > +return -EINVAL;
> > +}
> > +}
> > +
> > +if (maj == -1 || min == -1)
> > +return -EINVAL;
> > +
> > +/* if here, maj and min must be valid */
> > +*dev_no = MKDEV(maj, min);
> > +
> > +return 0;
> > +}
> 
> Eeek, no, let's never try to parse strings like this and "figure out"
> what major/minor number it is.  That's madness and will break if we ever
> make all char majors dynamic (there's a thread on lkml about that.)
> 
> Why would the kernel need to know major/minor?  Is it going to open a
> device node?  If so, again, crazy stuff, that's not good...

Ah, no, nevermind, you just need the major/minor.  So why not just take
that as the input here, and not a string?

thanks,

greg k-h

Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-14 Thread Greg Kroah-Hartman
On Tue, Jun 13, 2017 at 11:37:03PM +0100, okash.khaw...@gmail.com wrote:
> The function converts strings like ttyS0 and ttyUSB0 to dev_t like
> (4, 64) and (188, 0). Subsequent patch in this set will call it to
> convert user-supplied device into device number. The function does
> some basic sanity checks on the string passed in. It currently supports
> ttyS*, ttyUSB* and, for selected synths, lp*.
> 
> In order to do this, the patch also introduces a string member variable
> named 'dev' to struct spk_synth. 'dev' represents the device name -
> ttyUSB0 etc - which needs conversion to dev_t.
> 
> Signed-off-by: Okash Khawaja 
> Reviewed-by: Samuel Thibault 
> 
> ---
>  drivers/staging/speakup/spk_priv.h  |2 
>  drivers/staging/speakup/spk_ttyio.c |  105 
> 
>  drivers/staging/speakup/spk_types.h |1 
>  3 files changed, 108 insertions(+)
> 
> --- a/drivers/staging/speakup/spk_priv.h
> +++ b/drivers/staging/speakup/spk_priv.h
> @@ -40,6 +40,8 @@
>  
>  #define KT_SPKUP 15
>  #define SPK_SYNTH_TIMEOUT 10 /* in micro-seconds */
> +#define SYNTH_DEFAULT_DEV "ttyS0"
> +#define SYNTH_DEFAULT_SER 0
>  
>  const struct old_serial_port *spk_serial_init(int index);
>  void spk_stop_serial_interrupt(void);
> --- a/drivers/staging/speakup/spk_ttyio.c
> +++ b/drivers/staging/speakup/spk_ttyio.c
> @@ -7,6 +7,13 @@
>  #include "spk_types.h"
>  #include "spk_priv.h"
>  
> +/* Supported device types */
> +#define DEV_PREFIX_TTYS "ttyS"
> +#define DEV_PREFIX_TTYUSB "ttyUSB"
> +#define DEV_PREFIX_LP "lp"
> +
> +const char *lp_supported[] = { "acntsa", "bns", "dummy", "txprt" };
> +
>  struct spk_ldisc_data {
>   char buf;
>   struct semaphore sem;
> @@ -16,6 +23,104 @@ struct spk_ldisc_data {
>  static struct spk_synth *spk_ttyio_synth;
>  static struct tty_struct *speakup_tty;
>  
> +static int name_to_dev(const char *name, dev_t *dev_no)
> +{
> +int maj = -1, min = -1;
> +
> +if (strncmp(name, DEV_PREFIX_TTYS, strlen(DEV_PREFIX_TTYS)) == 0) {
> +if (kstrtoint(name + strlen(DEV_PREFIX_TTYS), 10, )) {
> + pr_err("speakup: Invalid ser param. Must be \
> + between 0 and 191 inclusive.\n");
> +return -EINVAL;
> +}
> +maj = 4;
> +
> +if (min < 0 || min > 191) {
> + pr_err("speakup: Invalid ser param. Must be \
> + between 0 and 191 inclusive.\n");
> +return -EINVAL;
> +}
> +min = min + 64;
> +} else if (strncmp(name, DEV_PREFIX_TTYUSB, 
> strlen(DEV_PREFIX_TTYUSB))
> + == 0) {
> +if (kstrtoint(name + strlen(DEV_PREFIX_TTYUSB), 10, )) {
> +pr_err("speakup: Invalid ttyUSB number. \
> + Must be a number from 0 onwards\n");
> +return -EINVAL;
> +}
> +maj = 188;
> +
> +if (min < 0) {
> +pr_err("speakup: Invalid ttyUSB number. \
> + Must be a number from 0 onwards\n");
> +return -EINVAL;
> +}
> +} else if (strncmp(name, DEV_PREFIX_LP, strlen(DEV_PREFIX_LP)) == 0) 
> {
> +if (kstrtoint(name + strlen(DEV_PREFIX_LP), 10, )) {
> +pr_warn("speakup: Invalid lp number. \
> + Must be a number from 0 onwards\n");
> +return -EINVAL;
> +}
> +maj = 6;
> +
> +if (min < 0) {
> +pr_warn("speakup: Invalid lp number. \
> + Must be a number from 0 onwards\n");
> +return -EINVAL;
> +}
> +}
> +
> +if (maj == -1 || min == -1)
> +return -EINVAL;
> +
> +/* if here, maj and min must be valid */
> +*dev_no = MKDEV(maj, min);
> +
> +return 0;
> +}

Eeek, no, let's never try to parse strings like this and "figure out"
what major/minor number it is.  That's madness and will break if we ever
make all char majors dynamic (there's a thread on lkml about that.)

Why would the kernel need to know major/minor?  Is it going to open a
device node?  If so, again, crazy stuff, that's not good...

thanks,

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


Re: [PATCH v2] staging: vboxvideo: Add vboxvideo to drivers/staging

2017-06-14 Thread Michael Thayer
Hello Sean,

13.06.2017 20:03, Sean Paul wrote:
[Discussion of vboxvideo driver clean-up.]

> First, thank you for your submission.

Thank you for your feedback.

[Discussion of the OS-independent code in the driver submission.]

> I took a quick skim through your driver, and there doesn't seem to be much
> secret sauce there that will be tough to keep up-to-date across platforms.

I have two particular concerns there: first if we add new functionality
(which we would do out of tree first) it will need porting over.
Acceleration support is the most likely candidate.  And if someone does
make fixes to that part of the code in the kernel tree they will also
need porting over.  I agree, that concern is probably overblown, and
best addressed by keeping that part of the code as close to our tree as
possible while still meeting kernel standards (hence my question as to
what that would be).

The second concern is not relevant to DRI, but it concerns our other
guest drivers (not the host one with the C++ in it Greg!) which Hans
also expressed interest in putting upstream after seeing how vboxvideo
fares.  The OS-independent part is quite a bit larger and more volatile,
though it has thankfully stablised a lot.  That concern is probably also
overblown, though I do wonder whether upstreaming those driver is the
best solution (that would be Hans's call though).

> One other concern I have is that I noticed there are a few functions
> declared/defined in the osindependent code that are never used outside of it, 
> so
> we have dead code off the hop.

If the OS-independent part gets converted then they would be removed in
the process.  Thank you for the reminder.

[...]

> IMO, in order to accept the driver in drm, the osindependent code needs to be
> stripped out and it needs to be converted to atomic. Whether you want to do
> this out of tree, or in staging is up to you. As Dave mentioned, people often
> overlook staging when making drm core changes, so you'll likely face the same
> moving target issues either way.

Conversion to Atomic would probably have to happen at some time or
another anyway.  I have put that off (out-of-tree) so far because I was
tracking the AST driver as closely as possible as the simplest way of
picking up fixes, and because Dave, who wrote that, knows much more
about drm drivers than me.

[...]

Regards
Michael
-- 
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8723bs: fix an error code in isFileReadable()

2017-06-14 Thread Dan Carpenter
The caller only cares about zero vs non-zero so this code actually works
fine but we should be returning a negative error code instead of a valid
pointer casted to int.

Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/rtl8723bs/os_dep/osdep_service.c 
b/drivers/staging/rtl8723bs/os_dep/osdep_service.c
index 02db59e8b593..aa16d1ab955b 100644
--- a/drivers/staging/rtl8723bs/os_dep/osdep_service.c
+++ b/drivers/staging/rtl8723bs/os_dep/osdep_service.c
@@ -160,7 +160,7 @@ static int isFileReadable(char *path)
oldfs = get_fs(); set_fs(get_ds());
 
if (1!=readFile(fp, , 1))
-   ret = PTR_ERR(fp);
+   ret = -EINVAL;
 
set_fs(oldfs);
filp_close(fp, NULL);
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: vboxvideo: Add vboxvideo to drivers/staging

2017-06-14 Thread Michael Thayer
13.06.2017 17:41, Greg Kroah-Hartman wrote:
[...]
> And why is the closed vbox-devel list still on the cc: here, the bounces
> from it are getting annoying.
[...]

Not sure why you are still getting them, but we added you to the
white-list as well.  I would prefer the list to stay on as the subject
is relevant to it.

Regards, and sorry for the annoyance
Michael
-- 
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [patch 1/2] staging: speakup: add function to convert dev name to number

2017-06-14 Thread Dan Carpenter
On Tue, Jun 13, 2017 at 11:37:03PM +0100, okash.khaw...@gmail.com wrote:
> The function converts strings like ttyS0 and ttyUSB0 to dev_t like
> (4, 64) and (188, 0). Subsequent patch in this set will call it to
> convert user-supplied device into device number. The function does
> some basic sanity checks on the string passed in. It currently supports
> ttyS*, ttyUSB* and, for selected synths, lp*.
> 
> In order to do this, the patch also introduces a string member variable
> named 'dev' to struct spk_synth. 'dev' represents the device name -
> ttyUSB0 etc - which needs conversion to dev_t.
> 
> Signed-off-by: Okash Khawaja 
> Reviewed-by: Samuel Thibault 
> 
> ---
>  drivers/staging/speakup/spk_priv.h  |2 
>  drivers/staging/speakup/spk_ttyio.c |  105 
> 
>  drivers/staging/speakup/spk_types.h |1 
>  3 files changed, 108 insertions(+)
> 
> --- a/drivers/staging/speakup/spk_priv.h
> +++ b/drivers/staging/speakup/spk_priv.h
> @@ -40,6 +40,8 @@
>  
>  #define KT_SPKUP 15
>  #define SPK_SYNTH_TIMEOUT 10 /* in micro-seconds */
> +#define SYNTH_DEFAULT_DEV "ttyS0"
> +#define SYNTH_DEFAULT_SER 0
>  
>  const struct old_serial_port *spk_serial_init(int index);
>  void spk_stop_serial_interrupt(void);
> --- a/drivers/staging/speakup/spk_ttyio.c
> +++ b/drivers/staging/speakup/spk_ttyio.c
> @@ -7,6 +7,13 @@
>  #include "spk_types.h"
>  #include "spk_priv.h"
>  
> +/* Supported device types */
> +#define DEV_PREFIX_TTYS "ttyS"
> +#define DEV_PREFIX_TTYUSB "ttyUSB"
> +#define DEV_PREFIX_LP "lp"
> +
> +const char *lp_supported[] = { "acntsa", "bns", "dummy", "txprt" };
> +
>  struct spk_ldisc_data {
>   char buf;
>   struct semaphore sem;
> @@ -16,6 +23,104 @@ struct spk_ldisc_data {
>  static struct spk_synth *spk_ttyio_synth;
>  static struct tty_struct *speakup_tty;
>  
> +static int name_to_dev(const char *name, dev_t *dev_no)
> +{
> +int maj = -1, min = -1;
> +
> +if (strncmp(name, DEV_PREFIX_TTYS, strlen(DEV_PREFIX_TTYS)) == 0) {
> +if (kstrtoint(name + strlen(DEV_PREFIX_TTYS), 10, )) {
> + pr_err("speakup: Invalid ser param. Must be \
> + between 0 and 191 inclusive.\n");

String needs fixed.

> +return -EINVAL;

Preserve the error code from kstrtoint().

> +}
> +maj = 4;
> +
> +if (min < 0 || min > 191) {
> + pr_err("speakup: Invalid ser param. Must be \
> + between 0 and 191 inclusive.\n");


This too.

> +return -EINVAL;
> +}
> +min = min + 64;
> +} else if (strncmp(name, DEV_PREFIX_TTYUSB, 
> strlen(DEV_PREFIX_TTYUSB))
> + == 0) {
> +if (kstrtoint(name + strlen(DEV_PREFIX_TTYUSB), 10, )) {
> +pr_err("speakup: Invalid ttyUSB number. \
> + Must be a number from 0 onwards\n");
> +return -EINVAL;

Same.

> +}
> +maj = 188;
> +
> +if (min < 0) {
> +pr_err("speakup: Invalid ttyUSB number. \
> + Must be a number from 0 onwards\n");

Same.

> +return -EINVAL;
> +}
> +} else if (strncmp(name, DEV_PREFIX_LP, strlen(DEV_PREFIX_LP)) == 0) 
> {
> +if (kstrtoint(name + strlen(DEV_PREFIX_LP), 10, )) {
> +pr_warn("speakup: Invalid lp number. \
> + Must be a number from 0 onwards\n");
> +return -EINVAL;

Same.  Preserve.

> +}
> +maj = 6;
> +
> +if (min < 0) {
> +pr_warn("speakup: Invalid lp number. \
> + Must be a number from 0 onwards\n");

Again.

> +return -EINVAL;
> +}
> +}
> +
> +if (maj == -1 || min == -1)
> +return -EINVAL;
> +
> +/* if here, maj and min must be valid */
> +*dev_no = MKDEV(maj, min);
> +
> +return 0;
> +}
> +
> +int ser_to_dev(int ser, dev_t *dev_no)
> +{
> + if (ser < 0 || ser > (255 - 64)) {
> +pr_err("speakup: Invalid ser param. \
> + Must be between 0 and 191 inclusive.\n");

String.  I feel like 191 and 255 - 64 are the same.  Let's just use 191
everywhere.

> +
> + return -EINVAL;
> +}
> +
> + *dev_no = MKDEV(4, (64 + ser));
> + return 0;
> +}
> +
> +static int get_dev_to_use(struct spk_synth *synth, dev_t *dev_no)
> +{
> + /* use ser only when dev is not specified */
> + if (strcmp(synth->dev, SYNTH_DEFAULT_DEV) || synth->ser == 
> SYNTH_DEFAULT_SER) {
> +  

[PATCH 2/4] staging: ks7010: add note regarding patching WEXT

2017-06-14 Thread Tobin C. Harding
WEXT code has been moved to a sub directory and is no longer included
in the module build. We should make a note of this for future
developers.

Add note to WEXT code TODO file informing developers that code is not
included in module build.

Signed-off-by: Tobin C. Harding 
---
 drivers/staging/ks7010/wext/TODO | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ks7010/wext/TODO b/drivers/staging/ks7010/wext/TODO
index d393ca5..8c0e309 100644
--- a/drivers/staging/ks7010/wext/TODO
+++ b/drivers/staging/ks7010/wext/TODO
@@ -1,6 +1,17 @@
 KS7010 Linux driver
 ===
 
+--
+** NOTE **
+--
+
+Code in this directory is not included in the kernel build. Please do
+not submit patches to this code unless you first make [local]
+modifications to the build process in order to verify that your
+patches build.
+
+--
+
 This driver is based on source code from the Ben Nanonote extra repository [1]
 which is based on the original v007 release from Renesas [2]. Some more
 background info about the chipset can be found here [3] and here [4]. Thank
@@ -21,9 +32,6 @@ First a few words what not to do (at least not blindly):
 
 Now the TODOs:
 
-- fix codechecker warnings (checkpatch, sparse, smatch). But PLEASE make sure
-  that you are not only silencing the warning but really fixing code. You
-  should understand the change you submit.
 - fix the 'card removal' event when card is inserted when booting
 - check what other upstream wireless mechanisms can be used instead of the
   custom ones here
-- 
2.7.4

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


[PATCH 0/4] staging: ks7010: cfg80211 conversion

2017-06-14 Thread Tobin C. Harding
Current ks7010 driver uses the WEXT interface. This series is the
initial stage of re-writing the driver to use cfg80211.

This patch set includes the code that was submitted as an RFC

 Subject: [RFC 0/3] staging: ks7010: cfg80211 conversion, add FIL

The RFC has been in flight for two weeks. All feed back has been seen
to.

In addition, this set includes the initial cfg80211 configuration API
implementation. Also includes rx and tx paths.

Patch 01 moves WEXT driver code into sub directory, includes empty
Makefile so build still passes.

Patch 02 adds a note to the WEXT todo file.

Patch 03 adds the new cfg80211 driver code.

Patch 04 adds an entry to the MAINTAINERS database.

Code is untested. Builds on x86_64 and PowerPC. Code is clear of any
warnings from checkpatch.pl, Sparse, and Spatch (kchecker).

Tobin C. Harding (4):
  staging: ks7010: move WEXT files to sub directory
  staging: ks7010: add note regarding patching WEXT
  staging: ks7010: add initial cfg80211 implementation
  MAINTAINERS: add maintainer entry for ks7010

 MAINTAINERS   |7 +
 drivers/staging/ks7010/Kconfig|8 +-
 drivers/staging/ks7010/Makefile   |   29 +-
 drivers/staging/ks7010/README.rst |   91 ++
 drivers/staging/ks7010/TODO.rst   |   30 +
 drivers/staging/ks7010/cfg80211.c |  981 
 drivers/staging/ks7010/cfg80211.h |   40 +
 drivers/staging/ks7010/common.h   |   33 +
 drivers/staging/ks7010/eap.h  |   73 ++
 drivers/staging/ks7010/fil.c  | 1294 +
 drivers/staging/ks7010/fil.h  |  559 +
 drivers/staging/ks7010/fil_types.h|  851 ++
 drivers/staging/ks7010/hif.c  |  505 
 drivers/staging/ks7010/hif.h  |  202 
 drivers/staging/ks7010/ks7010.h   |  309 +
 drivers/staging/ks7010/main.c |  337 ++
 drivers/staging/ks7010/rx.c   |  130 +++
 drivers/staging/ks7010/sdio.c |  691 +++
 drivers/staging/ks7010/sdio.h |   37 +
 drivers/staging/ks7010/tx.c   |  170 +++
 drivers/staging/ks7010/{ => wext}/TODO|   14 +-
 drivers/staging/ks7010/{ => wext}/eap_packet.h|0
 drivers/staging/ks7010/{ => wext}/ks7010_sdio.c   |0
 drivers/staging/ks7010/{ => wext}/ks7010_sdio.h   |0
 drivers/staging/ks7010/{ => wext}/ks_hostif.c |0
 drivers/staging/ks7010/{ => wext}/ks_hostif.h |0
 drivers/staging/ks7010/{ => wext}/ks_wlan.h   |0
 drivers/staging/ks7010/{ => wext}/ks_wlan_ioctl.h |0
 drivers/staging/ks7010/{ => wext}/ks_wlan_net.c   |0
 drivers/staging/ks7010/{ => wext}/michael_mic.c   |0
 drivers/staging/ks7010/{ => wext}/michael_mic.h   |0
 31 files changed, 6380 insertions(+), 11 deletions(-)
 create mode 100644 drivers/staging/ks7010/README.rst
 create mode 100644 drivers/staging/ks7010/TODO.rst
 create mode 100644 drivers/staging/ks7010/cfg80211.c
 create mode 100644 drivers/staging/ks7010/cfg80211.h
 create mode 100644 drivers/staging/ks7010/common.h
 create mode 100644 drivers/staging/ks7010/eap.h
 create mode 100644 drivers/staging/ks7010/fil.c
 create mode 100644 drivers/staging/ks7010/fil.h
 create mode 100644 drivers/staging/ks7010/fil_types.h
 create mode 100644 drivers/staging/ks7010/hif.c
 create mode 100644 drivers/staging/ks7010/hif.h
 create mode 100644 drivers/staging/ks7010/ks7010.h
 create mode 100644 drivers/staging/ks7010/main.c
 create mode 100644 drivers/staging/ks7010/rx.c
 create mode 100644 drivers/staging/ks7010/sdio.c
 create mode 100644 drivers/staging/ks7010/sdio.h
 create mode 100644 drivers/staging/ks7010/tx.c
 rename drivers/staging/ks7010/{ => wext}/TODO (83%)
 rename drivers/staging/ks7010/{ => wext}/eap_packet.h (100%)
 rename drivers/staging/ks7010/{ => wext}/ks7010_sdio.c (100%)
 rename drivers/staging/ks7010/{ => wext}/ks7010_sdio.h (100%)
 rename drivers/staging/ks7010/{ => wext}/ks_hostif.c (100%)
 rename drivers/staging/ks7010/{ => wext}/ks_hostif.h (100%)
 rename drivers/staging/ks7010/{ => wext}/ks_wlan.h (100%)
 rename drivers/staging/ks7010/{ => wext}/ks_wlan_ioctl.h (100%)
 rename drivers/staging/ks7010/{ => wext}/ks_wlan_net.c (100%)
 rename drivers/staging/ks7010/{ => wext}/michael_mic.c (100%)
 rename drivers/staging/ks7010/{ => wext}/michael_mic.h (100%)

-- 
2.7.4

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


[PATCH 1/4] staging: ks7010: move WEXT files to sub directory

2017-06-14 Thread Tobin C. Harding
Current driver implements the WEXT interface. WEXT is in maintenance
mode, we need to re-write the driver using the cfg80211 API. The current
driver is handy as a reference for the new implementation, we can keep
it in tree for now.

Move WEXT driver to sub directory, add dummy Makefile and Kconfig so
build completes successfully but does not process any files from the
WEXT directory.

Signed-off-by: Tobin C. Harding 
---
 drivers/staging/ks7010/Kconfig| 6 +-
 drivers/staging/ks7010/Makefile   | 5 +
 drivers/staging/ks7010/{ => wext}/TODO| 0
 drivers/staging/ks7010/{ => wext}/eap_packet.h| 0
 drivers/staging/ks7010/{ => wext}/ks7010_sdio.c   | 0
 drivers/staging/ks7010/{ => wext}/ks7010_sdio.h   | 0
 drivers/staging/ks7010/{ => wext}/ks_hostif.c | 0
 drivers/staging/ks7010/{ => wext}/ks_hostif.h | 0
 drivers/staging/ks7010/{ => wext}/ks_wlan.h   | 0
 drivers/staging/ks7010/{ => wext}/ks_wlan_ioctl.h | 0
 drivers/staging/ks7010/{ => wext}/ks_wlan_net.c   | 0
 drivers/staging/ks7010/{ => wext}/michael_mic.c   | 0
 drivers/staging/ks7010/{ => wext}/michael_mic.h   | 0
 13 files changed, 2 insertions(+), 9 deletions(-)
 rename drivers/staging/ks7010/{ => wext}/TODO (100%)
 rename drivers/staging/ks7010/{ => wext}/eap_packet.h (100%)
 rename drivers/staging/ks7010/{ => wext}/ks7010_sdio.c (100%)
 rename drivers/staging/ks7010/{ => wext}/ks7010_sdio.h (100%)
 rename drivers/staging/ks7010/{ => wext}/ks_hostif.c (100%)
 rename drivers/staging/ks7010/{ => wext}/ks_hostif.h (100%)
 rename drivers/staging/ks7010/{ => wext}/ks_wlan.h (100%)
 rename drivers/staging/ks7010/{ => wext}/ks_wlan_ioctl.h (100%)
 rename drivers/staging/ks7010/{ => wext}/ks_wlan_net.c (100%)
 rename drivers/staging/ks7010/{ => wext}/michael_mic.c (100%)
 rename drivers/staging/ks7010/{ => wext}/michael_mic.h (100%)

diff --git a/drivers/staging/ks7010/Kconfig b/drivers/staging/ks7010/Kconfig
index 0b92176..437b928 100644
--- a/drivers/staging/ks7010/Kconfig
+++ b/drivers/staging/ks7010/Kconfig
@@ -1,10 +1,6 @@
 config KS7010
tristate "KeyStream KS7010 SDIO support"
-   depends on MMC && WIRELESS
-   select WIRELESS_EXT
-   select WEXT_PRIV
-   select FW_LOADER
-   help
+   ---help---
  This is a driver for KeyStream KS7010 based SDIO WIFI cards. It is
  found on at least later Spectec SDW-821 (FCC-ID "S2Y-WLAN-11G-K" only,
  sadly not FCC-ID "S2Y-WLAN-11B-G") and Spectec SDW-823 microSD cards.
diff --git a/drivers/staging/ks7010/Makefile b/drivers/staging/ks7010/Makefile
index 69fcf8d..9444885 100644
--- a/drivers/staging/ks7010/Makefile
+++ b/drivers/staging/ks7010/Makefile
@@ -1,4 +1 @@
-obj-$(CONFIG_KS7010) += ks7010.o
-
-ccflags-y   += -DKS_WLAN_DEBUG=0
-ks7010-y:= michael_mic.o ks_hostif.o ks_wlan_net.o ks7010_sdio.o
+# Makefile intentionally left blank
diff --git a/drivers/staging/ks7010/TODO b/drivers/staging/ks7010/wext/TODO
similarity index 100%
rename from drivers/staging/ks7010/TODO
rename to drivers/staging/ks7010/wext/TODO
diff --git a/drivers/staging/ks7010/eap_packet.h 
b/drivers/staging/ks7010/wext/eap_packet.h
similarity index 100%
rename from drivers/staging/ks7010/eap_packet.h
rename to drivers/staging/ks7010/wext/eap_packet.h
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/wext/ks7010_sdio.c
similarity index 100%
rename from drivers/staging/ks7010/ks7010_sdio.c
rename to drivers/staging/ks7010/wext/ks7010_sdio.c
diff --git a/drivers/staging/ks7010/ks7010_sdio.h 
b/drivers/staging/ks7010/wext/ks7010_sdio.h
similarity index 100%
rename from drivers/staging/ks7010/ks7010_sdio.h
rename to drivers/staging/ks7010/wext/ks7010_sdio.h
diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/wext/ks_hostif.c
similarity index 100%
rename from drivers/staging/ks7010/ks_hostif.c
rename to drivers/staging/ks7010/wext/ks_hostif.c
diff --git a/drivers/staging/ks7010/ks_hostif.h 
b/drivers/staging/ks7010/wext/ks_hostif.h
similarity index 100%
rename from drivers/staging/ks7010/ks_hostif.h
rename to drivers/staging/ks7010/wext/ks_hostif.h
diff --git a/drivers/staging/ks7010/ks_wlan.h 
b/drivers/staging/ks7010/wext/ks_wlan.h
similarity index 100%
rename from drivers/staging/ks7010/ks_wlan.h
rename to drivers/staging/ks7010/wext/ks_wlan.h
diff --git a/drivers/staging/ks7010/ks_wlan_ioctl.h 
b/drivers/staging/ks7010/wext/ks_wlan_ioctl.h
similarity index 100%
rename from drivers/staging/ks7010/ks_wlan_ioctl.h
rename to drivers/staging/ks7010/wext/ks_wlan_ioctl.h
diff --git a/drivers/staging/ks7010/ks_wlan_net.c 
b/drivers/staging/ks7010/wext/ks_wlan_net.c
similarity index 100%
rename from drivers/staging/ks7010/ks_wlan_net.c
rename to drivers/staging/ks7010/wext/ks_wlan_net.c
diff --git a/drivers/staging/ks7010/michael_mic.c 
b/drivers/staging/ks7010/wext/michael_mic.c
similarity index 100%
rename from drivers/staging/ks7010/michael_mic.c

[PATCH 4/4] MAINTAINERS: add maintainer entry for ks7010

2017-06-14 Thread Tobin C. Harding
Driver ks7010 does not currently have a maintainer.

Take ownership of the driver and add an entry for the ks7010 driver to
the maintainers database.

Signed-off-by: Tobin C. Harding 
---
 MAINTAINERS | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index f6ef3f3..d5f856c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7428,6 +7428,13 @@ F:   Documentation/auxdisplay/ks0108
 F: drivers/auxdisplay/ks0108.c
 F: include/linux/ks0108.h
 
+KS7010 KEYSTREAM DRIVER
+M: Tobin C. Harding 
+L: driverdev-devel@linuxdriverproject.org
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
+S: Maintained
+F: drivers/staging/ks7010/
+
 L3MDEV
 M: David Ahern 
 L: net...@vger.kernel.org
-- 
2.7.4

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