Re: [PATCH 2/3] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-11 Thread Dan Carpenter
On Tue, Jul 10, 2018 at 09:33:47PM +0200, Sergio Paracuellos wrote:
> +static int mt7621_pcie_parse_dt(struct mt7621_pcie_port *port)
> +{
> + struct device *dev = port->dev;
> + struct device_node *node = dev->of_node;
> + struct resource regs;
> + const char *type;
> + int err;
> +
> + type = of_get_property(node, "device_type", NULL);
> + if (!type || strcmp(type, "pci")) {

Instead of testing for pci, can you test for pcie?

I always like to use the == 0 and != 0 with strcmp() because it's easier
to think about type == pci or type != pcie.

regards,
dan carpenter

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


Re: [PATCH 1/3] staging: mt7621-pci: add data struct for mt7621 pci controller

2018-07-11 Thread Greg KH
On Tue, Jul 10, 2018 at 09:33:46PM +0200, Sergio Paracuellos wrote:
> Add new 'mt7621_pcie_port' struct as data for the pci controller.
> 
> Signed-off-by: Sergio Paracuellos 
> ---
>  drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c 
> b/drivers/staging/mt7621-pci/pci-mt7621.c
> index 4f56840..58c77bd 100644
> --- a/drivers/staging/mt7621-pci/pci-mt7621.c
> +++ b/drivers/staging/mt7621-pci/pci-mt7621.c
> @@ -177,6 +177,16 @@ static int pcie_link_status = 0;
>  #define PCI_ACCESS_WRITE_2 4
>  #define PCI_ACCESS_WRITE_4 5
>  
> +/**
> + * struct mt7621_pcie_port - PCIe port information
> + * @reg_base: IO Mapped Register Base
> + * @dev: Device pointer
> + */
> +struct mt7621_pcie_port {
> + void __iomem *reg_base;
> + struct device *dev;
> +};

Ok, something is really odd here.

A PCI driver should not have to mess with structures like this and have
to create "fake" struct pci_dev, right?

Or is this code really the PCI bridge code to create PCI devices?  I
can't figure it out.  It has a pcibios override function, which the pci
core calls to set things up, and should never be in a driver, but should
be in pci core code for the platform.  Is that what this is?

What exactly is this code supposed to be doing?

thanks,

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


Re: [PATCH 2/3] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-11 Thread Greg KH
On Wed, Jul 11, 2018 at 10:29:43AM +0300, Dan Carpenter wrote:
> On Tue, Jul 10, 2018 at 09:33:47PM +0200, Sergio Paracuellos wrote:
> > +static int mt7621_pcie_parse_dt(struct mt7621_pcie_port *port)
> > +{
> > +   struct device *dev = port->dev;
> > +   struct device_node *node = dev->of_node;
> > +   struct resource regs;
> > +   const char *type;
> > +   int err;
> > +
> > +   type = of_get_property(node, "device_type", NULL);
> > +   if (!type || strcmp(type, "pci")) {
> 
> Instead of testing for pci, can you test for pcie?

Does this platform support pcie?

thanks,

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


Re: [PATCH 2/3] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-11 Thread Greg KH
On Tue, Jul 10, 2018 at 09:33:47PM +0200, Sergio Paracuellos wrote:
> map_bus callback is called before every .read/.write operation.
> Implement it and change custom read write operations for the
> pci subsystem generics. Make the probe function to assign data
> for controller data and get pci register base from device tree.

Ok, now this makes a bit more sense, I should have read this before
reviewing the first patch, sorry.

You have tested this out, right?  If it works, great, I'll gladly take
this series then, it starts to make the platform a bit more sane, nice
work.

thanks,

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


Re: [PATCH] staging: speakup: fix wraparound in uaccess length check

2018-07-11 Thread Greg Kroah-Hartman
On Tue, Jul 10, 2018 at 01:34:59PM -0700, Jann Horn wrote:
> On Sat, Jul 7, 2018 at 7:03 AM Greg Kroah-Hartman
>  wrote:
> >
> > On Sat, Jul 07, 2018 at 10:29:26AM +0200, Samuel Thibault wrote:
> > > Re,
> > >
> > > Could you review, test, and resubmit the patch below instead?
> > >
> > > Samuel
> > >
> > >
> > > If softsynthx_read() is called with `count < 3`, `count - 3` wraps, 
> > > causing
> > > the loop to copy as much data as available to the provided buffer. If
> > > softsynthx_read() is invoked through sys_splice(), this causes an
> > > unbounded kernel write; but even when userspace just reads from it
> > > normally, a small size could cause userspace crashes.
> > >
> > > Fixes: 425e586cf95b ("speakup: add unicode variant of /dev/softsynth")
> > > Cc: sta...@vger.kernel.org
> > > Signed-off-by: Samuel Thibault 
> >
> > You forgot a "reported-by:" line :(
> >
> > also, I already applied Jann's patch, so could you either just send the
> > fixup, or a revert/add of this patch once you all agree on the proper
> > solution here?
> 
> I think my patch was garbage (as both Samuel and Dan Carpenter's
> smatch warning pointed out) and should be reverted. Should I be
> sending the revert?

I'll just go drop it, thanks for letting me know.

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


Re: [PATCH] staging: speakup: fix wraparound in uaccess length check

2018-07-11 Thread Samuel Thibault
Hello,

Jann Horn, le mar. 10 juil. 2018 13:34:33 -0700, a ecrit:
> On Sat, Jul 7, 2018 at 1:29 AM Samuel Thibault
>  wrote:
> > Could you review, test, and resubmit the patch below instead?
> 
> Er... you mean, you want me to take your patch, add my Signed-off-by
> below yours, and then send that?

Yes, please.

> Some random thing I noticed, but I don't think it has anything to do
> with this issue: In some runs, when the console is repeatedly printing
> "Debian GNU/Linux 9 debian tty1\n\ndebian login: " in response to me
> pressing enter repeatedly, /dev/softsynthu (read in 1-byte steps)
> seems to return things like "Debian GNU slash Linux 9 debian tty1 \n
> debi login: ". I don't understand why it sometimes says "debi login"
> instead of "debian login".

It's odd indeed, but I agree it's unrelated.

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


[PATCH v2 3/3] staging: pi433: Make only one statement per line

2018-07-11 Thread Sophie Matter
Lines containing multiple statements were broken into multiple
lines, increasing readability and complying with the coding standard.
This also fixes several checkpatch.pl errors complaining about
the lines being too long.

Signed-off-by: Sophie Matter 
Signed-off-by: Rico Schrage 
---
 drivers/staging/pi433/rf69.c | 24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 2dcda814fce0..085272fb393f 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -525,22 +525,34 @@ int rf69_set_dio_mapping(struct spi_device *spi, u8 
dio_number, u8 value)
 
switch (dio_number) {
case 0:
-   mask = MASK_DIO0; shift = SHIFT_DIO0; dio_addr = 
REG_DIOMAPPING1;
+   mask = MASK_DIO0;
+   shift = SHIFT_DIO0;
+   dio_addr = REG_DIOMAPPING1;
break;
case 1:
-   mask = MASK_DIO1; shift = SHIFT_DIO1; dio_addr = 
REG_DIOMAPPING1;
+   mask = MASK_DIO1;
+   shift = SHIFT_DIO1;
+   dio_addr = REG_DIOMAPPING1;
break;
case 2:
-   mask = MASK_DIO2; shift = SHIFT_DIO2; dio_addr = 
REG_DIOMAPPING1;
+   mask = MASK_DIO2;
+   shift = SHIFT_DIO2;
+   dio_addr = REG_DIOMAPPING1;
break;
case 3:
-   mask = MASK_DIO3; shift = SHIFT_DIO3; dio_addr = 
REG_DIOMAPPING1;
+   mask = MASK_DIO3;
+   shift = SHIFT_DIO3;
+   dio_addr = REG_DIOMAPPING1;
break;
case 4:
-   mask = MASK_DIO4; shift = SHIFT_DIO4; dio_addr = 
REG_DIOMAPPING2;
+   mask = MASK_DIO4;
+   shift = SHIFT_DIO4;
+   dio_addr = REG_DIOMAPPING2;
break;
case 5:
-   mask = MASK_DIO5; shift = SHIFT_DIO5; dio_addr = 
REG_DIOMAPPING2;
+   mask = MASK_DIO5;
+   shift = SHIFT_DIO5;
+   dio_addr = REG_DIOMAPPING2;
break;
default:
dev_dbg(&spi->dev, "set: illegal input param");
-- 
2.18.0

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


[PATCH v2 2/3] staging: pi433: Use preferred commenting style

2018-07-11 Thread Sophie Matter
For multi-line comments, the preferred commenting style from the
coding style Documentation was applied to the comments, meaning
almost blank lines at the beginning and end of the comment.
One changed comment includes a line over 80 characters, causing
checkpatch.pl to complain, however breaking this line would not
make much sense, so it is kept like it is.

Signed-off-by: Sophie Matter 
Signed-off-by: Rico Schrage 
---
 drivers/staging/pi433/pi433_if.c | 30 --
 drivers/staging/pi433/rf69.c | 15 ++-
 2 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index cced28afe454..511b2b531732 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -66,10 +66,12 @@ static DEFINE_MUTEX(minor_lock); /* Protect idr accesses */
 
 static struct class *pi433_class; /* mainly for udev to create /dev/pi433 */
 
-/* tx config is instance specific
+/*
+ * tx config is instance specific
  * so with each open a new tx config struct is needed
  */
-/* rx config is device specific
+/*
+ * rx config is device specific
  * so we have just one rx config, ebedded in device struct
  */
 struct pi433_device {
@@ -584,7 +586,8 @@ pi433_tx_thread(void *data)
if (kthread_should_stop())
return 0;
 
-   /* get data from fifo in the following order:
+   /*
+* get data from fifo in the following order:
 * - tx_cfg
 * - size of message
 * - message
@@ -639,7 +642,8 @@ pi433_tx_thread(void *data)
dev_dbg(device->dev,
"read %d message byte(s) from fifo queue.", retval);
 
-   /* if rx is active, we need to interrupt the waiting for
+   /*
+* if rx is active, we need to interrupt the waiting for
 * incoming telegrams, to be able to send something.
 * We are only allowed, if currently no reception takes
 * place otherwise we need to  wait for the incoming telegram
@@ -649,14 +653,16 @@ pi433_tx_thread(void *data)
 !device->rx_active ||
  device->interrupt_rx_allowed);
 
-   /* prevent race conditions
+   /*
+* prevent race conditions
 * irq will be reenabled after tx config is set
 */
disable_irq(device->irq_num[DIO0]);
device->tx_active = true;
 
if (device->rx_active && !rx_interrupted) {
-   /* rx is currently waiting for a telegram;
+   /*
+* rx is currently waiting for a telegram;
 * we need to set the radio module to standby
 */
retval = rf69_set_mode(device->spi, standby);
@@ -1097,7 +1103,8 @@ static void pi433_free_minor(struct pi433_device *dev)
 
 static const struct file_operations pi433_fops = {
.owner =THIS_MODULE,
-   /* REVISIT switch to aio primitives, so that userspace
+   /*
+* REVISIT switch to aio primitives, so that userspace
 * gets more complete API coverage.  It'll simplify things
 * too, except for the locking.
 */
@@ -1316,7 +1323,8 @@ static struct spi_driver pi433_spi_driver = {
.probe =pi433_probe,
.remove =   pi433_remove,
 
-   /* NOTE:  suspend/resume methods are not necessary here.
+   /*
+* NOTE:  suspend/resume methods are not necessary here.
 * We don't do anything except pass the requests to/from
 * the underlying controller.  The refrigerator handles
 * most issues; the controller driver handles the rest.
@@ -1329,13 +1337,15 @@ static int __init pi433_init(void)
 {
int status;
 
-   /* If MAX_MSG_SIZE is smaller then FIFO_SIZE, the driver won't
+   /*
+* If MAX_MSG_SIZE is smaller then FIFO_SIZE, the driver won't
 * work stable - risk of buffer overflow
 */
if (MAX_MSG_SIZE < FIFO_SIZE)
return -EINVAL;
 
-   /* Claim device numbers.  Then register a class
+   /*
+* Claim device numbers.  Then register a class
 * that will key udev/mdev to add/remove /dev nodes.  Last, register
 * Last, register the driver which manages those device numbers.
 */
diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 77e0a677ea96..2dcda814fce0 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -42,7 +42,8 @@ static u8 rf69_read_reg(struct spi_device *spi, u8 addr)
 
 #ifdef DEBUG_VALUES
if (retval < 0)
-   /* should never happen, since we already checked,
+   /*
+* sho

Re: [PATCH 2/3] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-11 Thread NeilBrown
On Wed, Jul 11 2018, Greg KH wrote:

> On Wed, Jul 11, 2018 at 10:29:43AM +0300, Dan Carpenter wrote:
>> On Tue, Jul 10, 2018 at 09:33:47PM +0200, Sergio Paracuellos wrote:
>> > +static int mt7621_pcie_parse_dt(struct mt7621_pcie_port *port)
>> > +{
>> > +  struct device *dev = port->dev;
>> > +  struct device_node *node = dev->of_node;
>> > +  struct resource regs;
>> > +  const char *type;
>> > +  int err;
>> > +
>> > +  type = of_get_property(node, "device_type", NULL);
>> > +  if (!type || strcmp(type, "pci")) {
>> 
>> Instead of testing for pci, can you test for pcie?
>
> Does this platform support pcie?

Yes, the platform has 3 pcie ports.

I hope to test these patches by Saturday morning (GMT+10).  I'll report
any problems, or success.

Thanks,
NeilBrown


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


[PATCH v2 1/3] staging: pi433: Comply with 80 character column limit

2018-07-11 Thread Sophie Matter
Lines have been split where it makes sense to shorten them in order
to comply with the coding standards and fix checkpatch.pl warnings.
There are still lines left that are too long, however breaking
those would impair readability.

Changes in v2:
 - now working on staging-next branch of the staging tree
 - the changes to the defines previously made are deleted
   due to readability

Signed-off-by: Sophie Matter 
Signed-off-by: Rico Schrage 
---
 drivers/staging/pi433/pi433_if.c | 13 ++---
 drivers/staging/pi433/pi433_if.h |  6 --
 drivers/staging/pi433/rf69.c | 10 +++---
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 293602d87c0f..cced28afe454 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -826,11 +826,15 @@ pi433_write(struct file *filp, const char __user *buf,
instance = filp->private_data;
device = instance->device;
 
-   /* check, whether internal buffer (tx thread) is big enough for 
requested size */
+   /*
+* check, whether internal buffer (tx thread) is big enough
+* for requested size
+*/
if (count > MAX_MSG_SIZE)
return -EMSGSIZE;
 
-   /* write the following sequence into fifo:
+   /*
+* write the following sequence into fifo:
 * - tx_cfg
 * - size of message
 * - message
@@ -1116,7 +1120,10 @@ static int pi433_probe(struct spi_device *spi)
/* setup spi parameters */
spi->mode = 0x00;
spi->bits_per_word = 8;
-   /* spi->max_speed_hz = 1000;  1MHz already set by device tree 
overlay */
+   /*
+* spi->max_speed_hz = 1000;
+* 1MHz already set by device tree overlay
+*/
 
retval = spi_setup(spi);
if (retval) {
diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h
index 0e0c1b0ab1a6..2d4fa77c793e 100644
--- a/drivers/staging/pi433/pi433_if.h
+++ b/drivers/staging/pi433/pi433_if.h
@@ -43,7 +43,8 @@ enum option_on_off {
 /* IOCTL structs and commands */
 
 /**
- * struct pi433_tx_config - describes the configuration of the radio module 
for sending
+ * struct pi433_tx_config
+ * describes the configuration of the radio module for sending
  * @frequency:
  * @bit_rate:
  * @modulation:
@@ -90,7 +91,8 @@ struct pi433_tx_cfg {
 };
 
 /**
- * struct pi433_rx_config - describes the configuration of the radio module 
for sending
+ * struct pi433_rx_config
+ * describes the configuration of the radio module for sending
  * @frequency:
  * @bit_rate:
  * @modulation:
diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 724c24ce1428..77e0a677ea96 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -128,9 +128,13 @@ int rf69_set_mode(struct spi_device *spi, enum mode mode)
return rf69_read_mod_write(spi, REG_OPMODE, MASK_OPMODE_MODE,
   mode_map[mode]);
 
-   // we are using packet mode, so this check is not really needed
-   // but waiting for mode ready is necessary when going from sleep 
because the FIFO may not be immediately available from previous mode
-   //while (_mode == RF69_MODE_SLEEP && (READ_REG(REG_IRQFLAGS1) & 
RF_IRQFLAGS1_MODEREADY) == 0x00); // Wait for ModeReady
+   /*
+* we are using packet mode, so this check is not really needed
+* but waiting for mode ready is necessary when going from sleep
+* because the FIFO may not be immediately available from previous mode
+* while (_mode == RF69_MODE_SLEEP && (READ_REG(REG_IRQFLAGS1) &
+ RF_IRQFLAGS1_MODEREADY) == 0x00); // Wait for ModeReady
+*/
 }
 
 int rf69_set_data_mode(struct spi_device *spi, u8 data_mode)
-- 
2.18.0

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


[PATCH] staging: comedi: remove redundant variable segpos

2018-07-11 Thread Colin King
From: Colin Ian King 

Variable segpos is being assigned but is never used hence it is redundant
and can be removed.

Cleans up clang warning:
warning: variable 'segpos' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King 
---
 drivers/staging/comedi/drivers/pcl816.c | 4 ++--
 drivers/staging/comedi/drivers/pcl818.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c 
b/drivers/staging/comedi/drivers/pcl816.c
index d722079f3327..d87cf6d4a161 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -282,7 +282,7 @@ static int check_channel_list(struct comedi_device *dev,
  unsigned int chanlen)
 {
unsigned int chansegment[16];
-   unsigned int i, nowmustbechan, seglen, segpos;
+   unsigned int i, nowmustbechan, seglen;
 
/*  correct channel and range number check itself comedi/range.c */
if (chanlen < 1) {
@@ -312,7 +312,7 @@ static int check_channel_list(struct comedi_device *dev,
}
 
/*  check whole chanlist */
-   for (i = 0, segpos = 0; i < chanlen; i++) {
+   for (i = 0; i < chanlen; i++) {
if (chanlist[i] != chansegment[i % seglen]) {
dev_dbg(dev->class_dev,
"bad channel or range number! 
chanlist[%i]=%d,%d,%d and not %d,%d,%d!\n",
diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index eebb49751713..0af5315d4357 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -573,7 +573,7 @@ static int check_channel_list(struct comedi_device *dev,
  unsigned int *chanlist, unsigned int n_chan)
 {
unsigned int chansegment[16];
-   unsigned int i, nowmustbechan, seglen, segpos;
+   unsigned int i, nowmustbechan, seglen;
 
/* correct channel and range number check itself comedi/range.c */
if (n_chan < 1) {
@@ -605,7 +605,7 @@ static int check_channel_list(struct comedi_device *dev,
}
 
/*  check whole chanlist */
-   for (i = 0, segpos = 0; i < n_chan; i++) {
+   for (i = 0; i < n_chan; i++) {
if (chanlist[i] != chansegment[i % seglen]) {
dev_dbg(dev->class_dev,
"bad channel or range number! 
chanlist[%i]=%d,%d,%d and not %d,%d,%d!\n",
-- 
2.17.1

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


[PATCH] staging: gasket: remove redundant pointer bar_data

2018-07-11 Thread Colin King
From: Colin Ian King 

Pointer bar_data is being assigned but is never used hence it is redundant
and can be removed.

Cleans up clang warning:
warning: variable 'bar_data' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King 
---
 drivers/staging/gasket/gasket_core.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/gasket/gasket_core.c 
b/drivers/staging/gasket/gasket_core.c
index ad9442a5bb9d..45914ebc8f44 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -1610,7 +1610,6 @@ static int gasket_mmap(struct file *filp, struct 
vm_area_struct *vma)
bool is_coherent_region;
const struct gasket_driver_desc *driver_desc;
struct gasket_dev *gasket_dev = (struct gasket_dev *)filp->private_data;
-   struct gasket_bar_data *bar_data;
const struct gasket_bar_desc *bar_desc;
struct gasket_mappable_region *map_regions = NULL;
int num_map_regions = 0;
@@ -1673,8 +1672,6 @@ static int gasket_mmap(struct file *filp, struct 
vm_area_struct *vma)
 * Subtract the base of the bar from the raw offset to get the
 * memory location within the bar to map.
 */
-   bar_data = &gasket_dev->bar_data[bar_index];
-
bar_desc = &driver_desc->bar_descriptions[bar_index];
permissions = bar_desc->permissions;
if (!gasket_mmap_has_permissions(gasket_dev, vma, permissions)) {
-- 
2.17.1

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


[PATCH] staging: gdm724x: redundant variables idProduct and idVendor

2018-07-11 Thread Colin King
From: Colin Ian King 

Variable idProduct and idVendor are being assigned but are never used
hence they are redundant and can be removed.

Cleans up clang warnings:
warning: variable 'idProduct' set but not used [-Wunused-but-set-variable]
warning: variable 'idVendor' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King 
---
 drivers/staging/gdm724x/gdm_usb.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_usb.c 
b/drivers/staging/gdm724x/gdm_usb.c
index 0218782d1a08..dc4da66c3695 100644
--- a/drivers/staging/gdm724x/gdm_usb.c
+++ b/drivers/staging/gdm724x/gdm_usb.c
@@ -879,14 +879,9 @@ static void gdm_usb_disconnect(struct usb_interface *intf)
 {
struct phy_dev *phy_dev;
struct lte_udev *udev;
-   u16 idVendor, idProduct;
struct usb_device *usbdev;
 
usbdev = interface_to_usbdev(intf);
-
-   idVendor = __le16_to_cpu(usbdev->descriptor.idVendor);
-   idProduct = __le16_to_cpu(usbdev->descriptor.idProduct);
-
phy_dev = usb_get_intfdata(intf);
 
udev = phy_dev->priv_dev;
-- 
2.17.1

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


[GIT PULL] Staging driver fixes for 4.18-rc5

2018-07-11 Thread Greg KH
The following changes since commit 021c91791a5e7e85c567452f1be3e4c2c6cb6063:

  Linux 4.18-rc3 (2018-07-01 16:04:53 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/ 
tags/staging-4.18-rc5

for you to fetch changes up to d59d2f9995d28974877750f429e821324bd603c7:

  staging: r8822be: Fix RTL8822be can't find any wireless AP (2018-07-06 
17:44:35 +0200)


Staging fixes for 4.18-rc5

Here are two tiny staging driver fixes for reported issues for 4.18-rc5.

One fixes the r8822be driver to properly work on lots of new laptops,
the other is for the rtl8723bs driver to fix an underflow error.

Both have been in linux-next for a while with no reported issues.

Signed-off-by: Greg Kroah-Hartman 


Murray McAllister (1):
  staging: rtl8723bs: Prevent an underflow in rtw_check_beacon_data().

Ping-Ke Shih (1):
  staging: r8822be: Fix RTL8822be can't find any wireless AP

 drivers/staging/rtl8723bs/core/rtw_ap.c | 2 +-
 drivers/staging/rtlwifi/rtl8822be/hw.c  | 2 +-
 drivers/staging/rtlwifi/wifi.h  | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: remove redundant variable eth_proto

2018-07-11 Thread Colin King
From: Colin Ian King 

Variable eth_proto is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'eth_proto' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King 
---
 drivers/staging/ks7010/ks_hostif.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 0ecffab52ec2..a85975f63d26 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -354,7 +354,6 @@ void hostif_data_indication(struct ks_wlan_private *priv)
u16 auth_type;
unsigned char temp[256];
struct ether_hdr *eth_hdr;
-   unsigned short eth_proto;
struct ieee802_1x_hdr *aa1x_hdr;
size_t size;
int ret;
@@ -369,7 +368,6 @@ void hostif_data_indication(struct ks_wlan_private *priv)
get_word(priv); /* Reserve Area */
 
eth_hdr = (struct ether_hdr *)(priv->rxp);
-   eth_proto = ntohs(eth_hdr->h_proto);
 
/* source address check */
if (ether_addr_equal(&priv->eth_addr[0], eth_hdr->h_source)) {
-- 
2.17.1

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


[PATCH] staging: gasket: fix plain integer as NULL pointer warning

2018-07-11 Thread Ivan Bornyakov
Trivial fix to remove sparse warnings:

  drivers/staging/gasket/gasket_page_table.c:884:40: warning: Using plain 
integer as NULL pointer
  drivers/staging/gasket/gasket_page_table.c:1743:57: warning: Using plain 
integer as NULL pointer
  drivers/staging/gasket/gasket_page_table.c:1768:57: warning: Using plain 
integer as NULL pointer

Signed-off-by: Ivan Bornyakov 
---
 drivers/staging/gasket/gasket_page_table.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/gasket/gasket_page_table.c 
b/drivers/staging/gasket/gasket_page_table.c
index c5390a860f86..5d3d33cac12f 100644
--- a/drivers/staging/gasket/gasket_page_table.c
+++ b/drivers/staging/gasket/gasket_page_table.c
@@ -881,7 +881,7 @@ static int gasket_perform_mapping(
u64 off =
(u64)host_addr -
(u64)pg_tbl->coherent_pages[0].user_virt;
-   ptes[i].page = 0;
+   ptes[i].page = NULL;
ptes[i].offset = offset;
ptes[i].dma_addr = pg_tbl->coherent_pages[0].paddr +
   off + i * PAGE_SIZE;
@@ -1740,7 +1740,7 @@ int gasket_free_coherent_memory(struct gasket_dev 
*gasket_dev, u64 size,
  gasket_dev->coherent_buffer.virt_base,
  gasket_dev->coherent_buffer.phys_base);
gasket_dev->coherent_buffer.length_bytes = 0;
-   gasket_dev->coherent_buffer.virt_base = 0;
+   gasket_dev->coherent_buffer.virt_base = NULL;
gasket_dev->coherent_buffer.phys_base = 0;
}
return 0;
@@ -1765,7 +1765,7 @@ void gasket_free_coherent_memory_all(
  gasket_dev->coherent_buffer.virt_base,
  gasket_dev->coherent_buffer.phys_base);
gasket_dev->coherent_buffer.length_bytes = 0;
-   gasket_dev->coherent_buffer.virt_base = 0;
+   gasket_dev->coherent_buffer.virt_base = NULL;
gasket_dev->coherent_buffer.phys_base = 0;
}
 }
-- 
2.16.4

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


Re: [PATCH v2 3/8] staging:rtl8192u: Correct spacing before and after parenthesis - Style

2018-07-11 Thread Greg KH
On Tue, Jul 10, 2018 at 04:05:18PM +0100, John Whitmore wrote:
> Corrected coding style issues aroung opening and closed parenthesis. Spaces, 
> or blank line, removed from after '(' or before ')'

Wrap your changelog text at 72 columns like your editor asked you to :(

I'll fix it up this time...

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


[PATCH 5/5] staging: rtl8723bs: simplify ratetbl_val_2wifirate()

2018-07-11 Thread Michael Straube
Simplify ratetbl_val_2wifirate() by not using extra variable
for the return value.

Signed-off-by: Michael Straube 
---
 .../staging/rtl8723bs/core/rtw_wlan_util.c| 53 +--
 1 file changed, 14 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index fef04310ccd8..2c65af319a60 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -140,59 +140,34 @@ u8 networktype_to_raid_ex(struct adapter *adapter, struct 
sta_info *psta)
 unsigned char ratetbl_val_2wifirate(unsigned char rate);
 unsigned char ratetbl_val_2wifirate(unsigned char rate)
 {
-   unsigned char val = 0;
-
switch (rate & 0x7f) {
case 0:
-   val = IEEE80211_CCK_RATE_1MB;
-   break;
-
+   return IEEE80211_CCK_RATE_1MB;
case 1:
-   val = IEEE80211_CCK_RATE_2MB;
-   break;
-
+   return IEEE80211_CCK_RATE_2MB;
case 2:
-   val = IEEE80211_CCK_RATE_5MB;
-   break;
-
+   return IEEE80211_CCK_RATE_5MB;
case 3:
-   val = IEEE80211_CCK_RATE_11MB;
-   break;
-
+   return IEEE80211_CCK_RATE_11MB;
case 4:
-   val = IEEE80211_OFDM_RATE_6MB;
-   break;
-
+   return IEEE80211_OFDM_RATE_6MB;
case 5:
-   val = IEEE80211_OFDM_RATE_9MB;
-   break;
-
+   return IEEE80211_OFDM_RATE_9MB;
case 6:
-   val = IEEE80211_OFDM_RATE_12MB;
-   break;
-
+   return IEEE80211_OFDM_RATE_12MB;
case 7:
-   val = IEEE80211_OFDM_RATE_18MB;
-   break;
-
+   return IEEE80211_OFDM_RATE_18MB;
case 8:
-   val = IEEE80211_OFDM_RATE_24MB;
-   break;
-
+   return IEEE80211_OFDM_RATE_24MB;
case 9:
-   val = IEEE80211_OFDM_RATE_36MB;
-   break;
-
+   return IEEE80211_OFDM_RATE_36MB;
case 10:
-   val = IEEE80211_OFDM_RATE_48MB;
-   break;
-
+   return IEEE80211_OFDM_RATE_48MB;
case 11:
-   val = IEEE80211_OFDM_RATE_54MB;
-   break;
+   return IEEE80211_OFDM_RATE_54MB;
+   default:
+   return 0;
}
-
-   return val;
 }
 
 int is_basicrate(struct adapter *padapter, unsigned char rate);
-- 
2.18.0

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


[PATCH 1/5] staging: rtl8723bs: add spaces around '|'

2018-07-11 Thread Michael Straube
Add spaces around '|' to follow kernel coding style.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 2b3eb6f8ddc5..7216466f89e2 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -42,13 +42,13 @@ extern unsigned char WPA_TKIP_CIPHER[4];
 #define DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD 3
 
 static u8 rtw_basic_rate_cck[4] = {
-   IEEE80211_CCK_RATE_1MB|IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_2MB|IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_CCK_RATE_5MB|IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_11MB|IEEE80211_BASIC_RATE_MASK
+   IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK
 };
 
 static u8 rtw_basic_rate_ofdm[3] = {
-   IEEE80211_OFDM_RATE_6MB|IEEE80211_BASIC_RATE_MASK, 
IEEE80211_OFDM_RATE_12MB|IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_OFDM_RATE_24MB|IEEE80211_BASIC_RATE_MASK
+   IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_OFDM_RATE_24MB | IEEE80211_BASIC_RATE_MASK
 };
 
 int cckrates_included(unsigned char *rate, int ratelen)
-- 
2.18.0

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


[PATCH] staging: speakup: remove redundant variable l

2018-07-11 Thread Colin King
From: Colin Ian King 

Variable l is being assigned but is never used hence it is redundant
and can be removed.

Cleans up clang warning:
warning: variable 'l' set but not used [-Wunused-but-set-variable

Signed-off-by: Colin Ian King 
---
 drivers/staging/speakup/varhandlers.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/speakup/varhandlers.c 
b/drivers/staging/speakup/varhandlers.c
index 54a76b6752ad..1b545152cc49 100644
--- a/drivers/staging/speakup/varhandlers.c
+++ b/drivers/staging/speakup/varhandlers.c
@@ -179,7 +179,6 @@ int spk_set_num_var(int input, struct st_var_header *var, 
int how)
 {
int val;
int *p_val = var->p_val;
-   int l;
char buf[32];
char *cp;
struct var_t *var_data = var->data;
@@ -237,9 +236,9 @@ int spk_set_num_var(int input, struct st_var_header *var, 
int how)
else
cp = buf;
if (!var_data->u.n.out_str)
-   l = sprintf(cp, var_data->u.n.synth_fmt, (int)val);
+   sprintf(cp, var_data->u.n.synth_fmt, (int)val);
else
-   l = sprintf(cp, var_data->u.n.synth_fmt, 
var_data->u.n.out_str[val]);
+   sprintf(cp, var_data->u.n.synth_fmt, 
var_data->u.n.out_str[val]);
synth_printf("%s", cp);
return 0;
 }
-- 
2.17.1

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


[PATCH 2/5] staging: rtl8723bs: fix lines over 80 characters

2018-07-11 Thread Michael Straube
Fix lines over 80 characters by adding appropriate line breaks.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 7216466f89e2..234e741c87e8 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -42,12 +42,15 @@ extern unsigned char WPA_TKIP_CIPHER[4];
 #define DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD 3
 
 static u8 rtw_basic_rate_cck[4] = {
-   IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK
+   IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK
 };
 
 static u8 rtw_basic_rate_ofdm[3] = {
-   IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
IEEE80211_OFDM_RATE_24MB | IEEE80211_BASIC_RATE_MASK
 };
 
-- 
2.18.0

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


[PATCH 3/5] staging: rtl8723bs: remove blank lines

2018-07-11 Thread Michael Straube
Remove unrequired blank lines as reported by checkpatch.

Signed-off-by: Michael Straube 
---
 .../staging/rtl8723bs/core/rtw_wlan_util.c| 30 ---
 1 file changed, 30 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 234e741c87e8..106b4f13efc7 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -65,7 +65,6 @@ int cckrates_included(unsigned char *rate, int ratelen)
}
 
return false;
-
 }
 
 int cckratesonly_included(unsigned char *rate, int ratelen)
@@ -134,10 +133,8 @@ u8 networktype_to_raid_ex(struct adapter *adapter, struct 
sta_info *psta)
default:
raid = RATEID_IDX_BGN_40M_2SS;
break;
-
}
return raid;
-
 }
 
 unsigned char ratetbl_val_2wifirate(unsigned char rate);
@@ -193,11 +190,9 @@ unsigned char ratetbl_val_2wifirate(unsigned char rate)
case 11:
val = IEEE80211_OFDM_RATE_54MB;
break;
-
}
 
return val;
-
 }
 
 int is_basicrate(struct adapter *padapter, unsigned char rate);
@@ -292,7 +287,6 @@ void UpdateBrateTbl(struct adapter *Adapter, u8 *mBratesOS)
break;
}
}
-
 }
 
 void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen)
@@ -311,7 +305,6 @@ void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen)
break;
}
}
-
 }
 
 void Save_DM_Func_Flag(struct adapter *padapter)
@@ -499,7 +492,6 @@ u16 get_beacon_interval(struct wlan_bssid_ex *bss)
memcpy((unsigned char *)&val, 
rtw_get_beacon_interval_from_ie(bss->IEs), 2);
 
return le16_to_cpu(val);
-
 }
 
 int is_client_associated_to_ap(struct adapter *padapter)
@@ -542,7 +534,6 @@ int is_IBSS_empty(struct adapter *padapter)
}
 
return true;
-
 }
 
 unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval)
@@ -854,7 +845,6 @@ void flush_all_cam_entry(struct adapter *padapter)
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_DK_CFG, (u8 *)false);
 
memset((u8 *)(pmlmeinfo->FW_sta_info), 0, 
sizeof(pmlmeinfo->FW_sta_info));
-
 }
 
 int WMM_param_handler(struct adapter *padapter, struct ndis_80211_var_ie *pIE)
@@ -1068,7 +1058,6 @@ static void bwmode_update_check(struct adapter *padapter, 
struct ndis_80211_var_
new_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
}
 
-
if ((new_bwmode != pmlmeext->cur_bwmode) || (new_ch_offset != 
pmlmeext->cur_ch_offset)) {
pmlmeinfo->bwmode_updated = true;
 
@@ -1080,7 +1069,6 @@ static void bwmode_update_check(struct adapter *padapter, 
struct ndis_80211_var_
} else
pmlmeinfo->bwmode_updated = false;
 
-
if (true == pmlmeinfo->bwmode_updated) {
struct sta_info *psta;
struct wlan_bssid_ex*cur_network = &(pmlmeinfo->network);
@@ -1088,7 +1076,6 @@ static void bwmode_update_check(struct adapter *padapter, 
struct ndis_80211_var_
 
/* set_channel_bwmode(padapter, pmlmeext->cur_channel, 
pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); */
 
-
/* update ap's stainfo */
psta = rtw_get_stainfo(pstapriv, cur_network->MacAddress);
if (psta) {
@@ -1208,7 +1195,6 @@ void HT_info_handler(struct adapter *padapter, struct 
ndis_80211_var_ie *pIE)
if (phtpriv->ht_option == false)
return;
 
-
if (pIE->Length > sizeof(struct HT_info_element))
return;
 
@@ -1620,7 +1606,6 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)
return false;
} else
return false;
-
 }
 
 int support_short_GI(struct adapter *padapter, struct HT_caps_element 
*pHT_caps, u8 bwmode)
@@ -1772,7 +1757,6 @@ void update_IOT_info(struct adapter *padapter)
pmlmeinfo->turboMode_rtsen = 1;
break;
}
-
 }
 
 void update_capinfo(struct adapter *Adapter, u16 updateCap)
@@ -1785,7 +1769,6 @@ void update_capinfo(struct adapter *Adapter, u16 
updateCap)
/*  Mark to update preamble value forever, 2008.03.18 by lanhsin */
/* if (pMgntInfo->RegPreambleMode == PREAMBLE_AUTO) */
{
-
if (updateCap & cShortPreamble) {
/*  Short Preamble */
if (pmlmeinfo->preamble_mode != PREAMBLE_SHORT) { /*  
PREAMBLE_LONG or PREAMBLE_AUTO */
@@ -1823,7 +1806,6 @@ void update_capinfo(struct adapter *Adapter, u16 
updateCap)
}
 
rtw_hal_set_hwreg(Adapter, HW_VAR_SLOT_TIME, &pmlmeinfo->slotTime);
-
 }
 
 void update_wireless_mode(struct adapter *padapter)
@@ -1908,7 +1890,6 @@ int update_sta_support_rate(struct adapter *padapter, u8 
*pvar_ie, uint var_ie_l
memcpy((pmlmeinfo->FW_sta_info[cam_idx].SupportedRates + 
supportRateNum), pIE->data, ie_len);

[PATCH 4/5] staging: rtl8723bs: fix comparsions to NULL

2018-07-11 Thread Michael Straube
Fix comparsions to NULL to follow kernel coding style.
x == NULL -> !x
x != NULL -> x

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 106b4f13efc7..fef04310ccd8 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -1106,7 +1106,7 @@ void HT_caps_handler(struct adapter *padapter, struct 
ndis_80211_var_ie *pIE)
struct mlme_priv*pmlmepriv = &padapter->mlmepriv;
struct ht_priv  *phtpriv = &pmlmepriv->htpriv;
 
-   if (pIE == NULL)
+   if (!pIE)
return;
 
if (phtpriv->ht_option == false)
@@ -1189,7 +1189,7 @@ void HT_info_handler(struct adapter *padapter, struct 
ndis_80211_var_ie *pIE)
struct mlme_priv*pmlmepriv = &padapter->mlmepriv;
struct ht_priv  *phtpriv = &pmlmepriv->htpriv;
 
-   if (pIE == NULL)
+   if (!pIE)
return;
 
if (phtpriv->ht_option == false)
@@ -1341,7 +1341,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 
*pframe, u32 packet_len)
}
 
bssid = rtw_zmalloc(sizeof(struct wlan_bssid_ex));
-   if (bssid == NULL) {
+   if (!bssid) {
DBG_871X("%s rtw_zmalloc fail !!!\n", __func__);
return true;
}
@@ -1416,7 +1416,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 
*pframe, u32 packet_len)
 
/* checking SSID */
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _SSID_IE_, &len, 
bssid->IELength - _FIXED_IE_LENGTH_);
-   if (p == NULL) {
+   if (!p) {
DBG_871X("%s marc: cannot find SSID for survey event\n", 
__func__);
hidden_ssid = true;
} else {
@@ -1879,7 +1879,7 @@ int update_sta_support_rate(struct adapter *padapter, u8 
*pvar_ie, uint var_ie_l
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
 
pIE = (struct ndis_80211_var_ie *)rtw_get_ie(pvar_ie, 
_SUPPORTEDRATES_IE_, &ie_len, var_ie_len);
-   if (pIE == NULL)
+   if (!pIE)
return _FAIL;
 
memcpy(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates, pIE->data, 
ie_len);
@@ -2219,9 +2219,9 @@ void rtw_get_current_ip_address(struct adapter *padapter, 
u8 *pcurrentip)
 
if ((pmlmeinfo->state & WIFI_FW_LINKING_STATE) ||
pmlmeinfo->state & WIFI_FW_AP_STATE) {
-   if (my_ip_ptr != NULL) {
+   if (my_ip_ptr) {
struct in_ifaddr *my_ifa_list = my_ip_ptr->ifa_list;
-   if (my_ifa_list != NULL) {
+   if (my_ifa_list) {
ipaddress[0] = my_ifa_list->ifa_address & 0xFF;
ipaddress[1] = (my_ifa_list->ifa_address >> 8) 
& 0xFF;
ipaddress[2] = (my_ifa_list->ifa_address >> 16) 
& 0xFF;
-- 
2.18.0

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


[PATCH] staging: sm750fb: remove redundant pointer 'output'

2018-07-11 Thread Colin King
From: Colin Ian King 

Pointer 'output' is being assigned but is never used hence it is redundant
and can be removed.

Cleans up clang warning:
warning: variable 'output' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King 
---
 drivers/staging/sm750fb/sm750.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 67207b0554cd..846d7d243994 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -512,12 +512,10 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo 
*var,
 {
struct lynxfb_par *par;
struct lynxfb_crtc *crtc;
-   struct lynxfb_output *output;
resource_size_t request;
 
par = info->par;
crtc = &par->crtc;
-   output = &par->output;
 
pr_debug("check var:%dx%d-%d\n",
 var->xres,
-- 
2.17.1

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


[PATCH 2/3] staging: gasket: remove redundant license information

2018-07-11 Thread Greg Kroah-Hartman
Now that the SPDX tag is in all gasket files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

Cc: Rob Springer 
Cc: John Joseph 
Cc: Ben Chan 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/gasket/apex.h  |  9 -
 drivers/staging/gasket/apex_driver.c   | 12 ++--
 drivers/staging/gasket/gasket.h| 12 ++--
 drivers/staging/gasket/gasket_constants.h  | 12 +---
 drivers/staging/gasket/gasket_core.c   | 12 ++--
 drivers/staging/gasket/gasket_core.h   | 12 ++--
 drivers/staging/gasket/gasket_interrupt.c  | 12 +---
 drivers/staging/gasket/gasket_interrupt.h  |  9 -
 drivers/staging/gasket/gasket_ioctl.c  | 12 +---
 drivers/staging/gasket/gasket_ioctl.h  | 12 +---
 drivers/staging/gasket/gasket_logging.h| 12 ++--
 drivers/staging/gasket/gasket_page_table.c | 12 ++--
 drivers/staging/gasket/gasket_page_table.h | 12 ++--
 drivers/staging/gasket/gasket_sysfs.c  | 12 +---
 drivers/staging/gasket/gasket_sysfs.h  | 12 ++--
 15 files changed, 21 insertions(+), 153 deletions(-)

diff --git a/drivers/staging/gasket/apex.h b/drivers/staging/gasket/apex.h
index 1d1f34d53c77..4ef264106f50 100644
--- a/drivers/staging/gasket/apex.h
+++ b/drivers/staging/gasket/apex.h
@@ -3,15 +3,6 @@
  * Apex kernel-userspace interface definition(s).
  *
  * Copyright (C) 2018 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 #ifndef __APEX_H__
 #define __APEX_H__
diff --git a/drivers/staging/gasket/apex_driver.c 
b/drivers/staging/gasket/apex_driver.c
index 670ada307c3c..e2258e47d9fe 100644
--- a/drivers/staging/gasket/apex_driver.c
+++ b/drivers/staging/gasket/apex_driver.c
@@ -1,16 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
-/* Driver for the Apex chip.
+/*
+ * Driver for the Apex chip.
  *
  * Copyright (C) 2018 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/staging/gasket/gasket.h b/drivers/staging/gasket/gasket.h
index c0ea9ad7c187..9f709f0c5a2b 100644
--- a/drivers/staging/gasket/gasket.h
+++ b/drivers/staging/gasket/gasket.h
@@ -1,16 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-/* Common Gasket device kernel and user space declarations.
+/*
+ * Common Gasket device kernel and user space declarations.
  *
  * Copyright (C) 2018 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 #ifndef __GASKET_H__
 #define __GASKET_H__
diff --git a/drivers/staging/gasket/gasket_constants.h 
b/drivers/staging/gasket/gasket_constants.h
index e70c2220f3d8..82ed3f21e8ae 100644
--- a/drivers/staging/gasket/gasket_constants.h
+++ b/drivers/staging/gasket/gasket_constants.h
@@ -1,15 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2018 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
+/* Copyright (C) 2018 Google, Inc. */
 #ifndef __GASKET_CONSTANTS_H__
 #define __GASKET_CONSTANTS_H__
 
diff --git a

[PATCH 1/3] staging: gasket: add SPDX identifiers to all files.

2018-07-11 Thread Greg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the all of the staging gasket files to have a proper SPDX
identifier, based on the license text in the file itself.  The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

Cc: Rob Springer 
Cc: John Joseph 
Cc: Ben Chan 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/gasket/apex.h  | 1 +
 drivers/staging/gasket/apex_driver.c   | 1 +
 drivers/staging/gasket/gasket.h| 1 +
 drivers/staging/gasket/gasket_constants.h  | 1 +
 drivers/staging/gasket/gasket_core.c   | 1 +
 drivers/staging/gasket/gasket_core.h   | 1 +
 drivers/staging/gasket/gasket_interrupt.c  | 1 +
 drivers/staging/gasket/gasket_interrupt.h  | 1 +
 drivers/staging/gasket/gasket_ioctl.c  | 1 +
 drivers/staging/gasket/gasket_ioctl.h  | 1 +
 drivers/staging/gasket/gasket_logging.h| 1 +
 drivers/staging/gasket/gasket_page_table.c | 1 +
 drivers/staging/gasket/gasket_page_table.h | 1 +
 drivers/staging/gasket/gasket_sysfs.c  | 1 +
 drivers/staging/gasket/gasket_sysfs.h  | 1 +
 15 files changed, 15 insertions(+)

diff --git a/drivers/staging/gasket/apex.h b/drivers/staging/gasket/apex.h
index f2600aa05191..1d1f34d53c77 100644
--- a/drivers/staging/gasket/apex.h
+++ b/drivers/staging/gasket/apex.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Apex kernel-userspace interface definition(s).
  *
diff --git a/drivers/staging/gasket/apex_driver.c 
b/drivers/staging/gasket/apex_driver.c
index 395256704428..670ada307c3c 100644
--- a/drivers/staging/gasket/apex_driver.c
+++ b/drivers/staging/gasket/apex_driver.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /* Driver for the Apex chip.
  *
  * Copyright (C) 2018 Google, Inc.
diff --git a/drivers/staging/gasket/gasket.h b/drivers/staging/gasket/gasket.h
index 593d50820c65..c0ea9ad7c187 100644
--- a/drivers/staging/gasket/gasket.h
+++ b/drivers/staging/gasket/gasket.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /* Common Gasket device kernel and user space declarations.
  *
  * Copyright (C) 2018 Google, Inc.
diff --git a/drivers/staging/gasket/gasket_constants.h 
b/drivers/staging/gasket/gasket_constants.h
index b39e3e3f7d2c..e70c2220f3d8 100644
--- a/drivers/staging/gasket/gasket_constants.h
+++ b/drivers/staging/gasket/gasket_constants.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /* Copyright (C) 2018 Google, Inc.
  *
  * This software is licensed under the terms of the GNU General Public
diff --git a/drivers/staging/gasket/gasket_core.c 
b/drivers/staging/gasket/gasket_core.c
index 45914ebc8f44..a09f491296fb 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /* Gasket generic driver framework. This file contains the implementation
  * for the Gasket generic driver framework - the functionality that is common
  * across Gasket devices.
diff --git a/drivers/staging/gasket/gasket_core.h 
b/drivers/staging/gasket/gasket_core.h
index 5d6535a0f254..be25d9389237 100644
--- a/drivers/staging/gasket/gasket_core.h
+++ b/drivers/staging/gasket/gasket_core.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /* Gasket generic driver. Defines the set of data types and functions necessary
  * to define a driver using the Gasket generic driver framework.
  *
diff --git a/drivers/staging/gasket/gasket_interrupt.c 
b/drivers/staging/gasket/gasket_interrupt.c
index d1461b36f091..28bb80de22bf 100644
--- a/drivers/staging/gasket/gasket_interrupt.c
+++ b/drivers/staging/gasket/gasket_interrupt.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /* Copyright (C) 2018 Google, Inc.
  *
  * This software is licensed under the terms of the GNU General Public
diff --git a/drivers/staging/gasket/gasket_interrupt.h 
b/drivers/staging/gasket/gasket_interrupt.h
index 3a8afae6487a..2220ca4d89e4 100644
--- a/drivers/staging/gasket/gasket_interrupt.h
+++ b/drivers/staging/gasket/gasket_interrupt.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Gasket common interrupt module. Defines functions for enabling
  * eventfd-triggered interrupts between a Gasket device and a host process.
diff --git a/drivers/staging/gasket/gasket_ioctl.c 
b/drivers/staging/gasket/gasket_ioctl.c
index 4758083fb19b..c5d7beefc3ff 100644
--- a/drivers/staging/gasket/gasket_ioctl.c
+++ b/drivers/staging/gasket/gasket_ioctl.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /* Copyright (C) 2018 Google, Inc.
  *
  * This software is licensed under the terms of the GNU General Public
diff --git a/drivers/staging/gasket/gasket_ioctl.h 
b/drivers/staging/gasket/gasket_ioctl.h
index df868000c803..457b3165defd 100644
--- a/drivers/staging/gasket/gasket_ioctl.h
+++ b/drivers/staging/gasket/gasket_ioctl.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /* 

[PATCH 3/3] staging: gasket: remove TODO item about SPDX usage

2018-07-11 Thread Greg Kroah-Hartman
Now that the files are all properly tagged with SPDX lines, and the
boilerplate license text is gone, remove the TODO item.

Cc: Rob Springer 
Cc: John Joseph 
Cc: Ben Chan 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/gasket/TODO | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/gasket/TODO b/drivers/staging/gasket/TODO
index 0d8ee9602c80..d3c44ca4fda2 100644
--- a/drivers/staging/gasket/TODO
+++ b/drivers/staging/gasket/TODO
@@ -1,7 +1,5 @@
 This is a list of things that need to be done to get this driver out of the
 staging directory.
-- Use SPDX tags to show the license of the file, and no more "boiler-plate"
-  license text is needed.
 - Remove static function declarations.
 - Document sysfs files with Documentation/ABI/ entries.
 - Use misc interface instead of major number for driver version description.
-- 
2.18.0

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


[PATCH] staging: vt6655: remove some redundant variables

2018-07-11 Thread Colin King
From: Colin Ian King 

Variables rx_sts, sq, frame and is_pspoll are being assigned but are
never used hence they are redundant and can be removed.

Cleans up clang warnings:
warning: variable 'sq' set but not used [-Wunused-but-set-variable]
warning: variable 'rx_sts' set but not used [-Wunused-but-set-variable]
warning: variable 'frame' set but not used [-Wunused-but-set-variable]
warning: variable 'is_pspoll' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King 
---
 drivers/staging/vt6655/dpc.c  | 4 +---
 drivers/staging/vt6656/dpc.c  | 4 +---
 drivers/staging/vt6656/rxtx.c | 5 +
 3 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index 088d2d9dbc21..52214a30e9b6 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -34,7 +34,7 @@ static bool vnt_rx_data(struct vnt_private *priv, struct 
sk_buff *skb,
__le64 *tsf_time;
u16 frame_size;
int ii, r;
-   u8 *rx_sts, *rx_rate, *sq;
+   u8 *rx_rate;
u8 *skb_data;
u8 rate_idx = 0;
u8 rate[MAX_RATE] = {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108};
@@ -49,7 +49,6 @@ static bool vnt_rx_data(struct vnt_private *priv, struct 
sk_buff *skb,
 
skb_data = (u8 *)skb->data;
 
-   rx_sts = skb_data;
rx_rate = skb_data + 1;
 
sband = hw->wiphy->bands[hw->conf.chandef.chan->band];
@@ -74,7 +73,6 @@ static bool vnt_rx_data(struct vnt_private *priv, struct 
sk_buff *skb,
}
 
tsf_time = (__le64 *)(skb_data + bytes_received - 12);
-   sq = skb_data + bytes_received - 4;
new_rsr = skb_data + bytes_received - 3;
rssi = skb_data + bytes_received - 2;
rsr = skb_data + bytes_received - 1;
diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index c3b5b1431048..3b94e80f1d5e 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -32,7 +32,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
struct ieee80211_rx_status rx_status = { 0 };
struct ieee80211_hdr *hdr;
__le16 fc;
-   u8 *rsr, *new_rsr, *rssi, *frame;
+   u8 *rsr, *new_rsr, *rssi;
__le64 *tsf_time;
u32 frame_size;
int ii, r;
@@ -133,8 +133,6 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
priv->bb_pre_ed_rssi = (u8)rx_dbm + 1;
priv->current_rssi = priv->bb_pre_ed_rssi;
 
-   frame = skb_data + 8;
-
skb_pull(skb, 8);
skb_trim(skb, frame_size);
 
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 26ca3fa29301..9def0748ffee 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -797,7 +797,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff 
*skb)
unsigned long flags;
u16 tx_bytes, tx_header_size, tx_body_size, current_rate, duration_id;
u8 pkt_type, fb_option = AUTO_FB_NONE;
-   bool need_rts = false, is_pspoll = false;
+   bool need_rts = false;
bool need_mic = false;
 
hdr = (struct ieee80211_hdr *)(skb->data);
@@ -888,9 +888,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff 
*skb)
if (ieee80211_has_a4(hdr->frame_control))
tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_LHEAD);
 
-   if (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER)
-   is_pspoll = true;
-
tx_buffer_head->frag_ctl =
cpu_to_le16(ieee80211_get_hdrlen_from_skb(skb) << 10);
 
-- 
2.17.1

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


Re: [PATCH 2/3] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-11 Thread Sergio Paracuellos
On Wed, Jul 11, 2018 at 07:51:05PM +1000, NeilBrown wrote:
> On Wed, Jul 11 2018, Greg KH wrote:
> 
> > On Wed, Jul 11, 2018 at 10:29:43AM +0300, Dan Carpenter wrote:
> >> On Tue, Jul 10, 2018 at 09:33:47PM +0200, Sergio Paracuellos wrote:
> >> > +static int mt7621_pcie_parse_dt(struct mt7621_pcie_port *port)
> >> > +{
> >> > +struct device *dev = port->dev;
> >> > +struct device_node *node = dev->of_node;
> >> > +struct resource regs;
> >> > +const char *type;
> >> > +int err;
> >> > +
> >> > +type = of_get_property(node, "device_type", NULL);
> >> > +if (!type || strcmp(type, "pci")) {
> >> 
> >> Instead of testing for pci, can you test for pcie?
> >
> > Does this platform support pcie?
> 
> Yes, the platform has 3 pcie ports.
> 
> I hope to test these patches by Saturday morning (GMT+10).  I'll report
> any problems, or success.

Thanks, Neil. That would be awesome.
> 
> Thanks,
> NeilBrown

Best regards,
Sergio Paracuellos


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


Re: [PATCH 2/3] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-11 Thread Sergio Paracuellos
On Wed, Jul 11, 2018 at 11:16:14AM +0200, Greg KH wrote:
> On Tue, Jul 10, 2018 at 09:33:47PM +0200, Sergio Paracuellos wrote:
> > map_bus callback is called before every .read/.write operation.
> > Implement it and change custom read write operations for the
> > pci subsystem generics. Make the probe function to assign data
> > for controller data and get pci register base from device tree.
> 
> Ok, now this makes a bit more sense, I should have read this before
> reviewing the first patch, sorry.

I though in send only two patches one introducing all (including the 
data struct) and the second removing dead code to avoid confusion but 
I ended up in this three. Sorry.
> 
> You have tested this out, right?  If it works, great, I'll gladly take
> this series then, it starts to make the platform a bit more sane, nice
> work.

No, I don't have the hardware to test this :-(. Let's wait for the Neil's
feedback then.

Good to hear that this is the correct way to start the cleaning properly,
thanks. 

> 
> thanks,
> 
> greg k-h

Best regards,
Sergio Paracuellos
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/3] staging: mt7621-pci: use generic kernel pci subsystem read and write

2018-07-11 Thread Sergio Paracuellos
On Wed, Jul 11, 2018 at 10:29:43AM +0300, Dan Carpenter wrote:
> On Tue, Jul 10, 2018 at 09:33:47PM +0200, Sergio Paracuellos wrote:
> > +static int mt7621_pcie_parse_dt(struct mt7621_pcie_port *port)
> > +{
> > +   struct device *dev = port->dev;
> > +   struct device_node *node = dev->of_node;
> > +   struct resource regs;
> > +   const char *type;
> > +   int err;
> > +
> > +   type = of_get_property(node, "device_type", NULL);
> > +   if (!type || strcmp(type, "pci")) {
> 
> Instead of testing for pci, can you test for pcie?

All device tree's I've checked looking for what this should be done
has "pci" as device_type defined and checked accordly in code (current
mt7621 DTS also). That's why "pci" is checked.

> 
> I always like to use the == 0 and != 0 with strcmp() because it's easier
> to think about type == pci or type != pcie.

Thanks for the advice, maybe you are right and is more clear in the way
you are describing here.

> 
> regards,
> dan carpenter
> 

Best regards,
Sergio Paracuellos
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] staging: rtl8188eu: fix lines over 80 characters

2018-07-11 Thread Michael Straube
Fix lines over 80 characters by adding appropriate line breaks.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c 
b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 54a48ccfcb0d..1aed507dd7cb 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -34,19 +34,25 @@ unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 
0x01, 0x20};
 #define WAIT_FOR_BCN_TO_MAX(2)
 
 static u8 rtw_basic_rate_cck[4] = {
-   IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK
+   IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK
 };
 
 static u8 rtw_basic_rate_ofdm[3] = {
-   IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
IEEE80211_OFDM_RATE_24MB | IEEE80211_BASIC_RATE_MASK
 };
 
 static u8 rtw_basic_rate_mix[7] = {
-   IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
IEEE80211_OFDM_RATE_24MB | IEEE80211_BASIC_RATE_MASK
 };
 
-- 
2.18.0

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


[PATCH 1/3] staging: rtl8188eu: add spaces around '|'

2018-07-11 Thread Michael Straube
Add spaces around '|' to follow kernel coding style.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c 
b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 93d8fa66be7a..54a48ccfcb0d 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -34,20 +34,20 @@ unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 
0x01, 0x20};
 #define WAIT_FOR_BCN_TO_MAX(2)
 
 static u8 rtw_basic_rate_cck[4] = {
-   IEEE80211_CCK_RATE_1MB|IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_2MB|IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_CCK_RATE_5MB|IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_11MB|IEEE80211_BASIC_RATE_MASK
+   IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK
 };
 
 static u8 rtw_basic_rate_ofdm[3] = {
-   IEEE80211_OFDM_RATE_6MB|IEEE80211_BASIC_RATE_MASK, 
IEEE80211_OFDM_RATE_12MB|IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_OFDM_RATE_24MB|IEEE80211_BASIC_RATE_MASK
+   IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_OFDM_RATE_24MB | IEEE80211_BASIC_RATE_MASK
 };
 
 static u8 rtw_basic_rate_mix[7] = {
-   IEEE80211_CCK_RATE_1MB|IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_2MB|IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_CCK_RATE_5MB|IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_11MB|IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_OFDM_RATE_6MB|IEEE80211_BASIC_RATE_MASK, 
IEEE80211_OFDM_RATE_12MB|IEEE80211_BASIC_RATE_MASK,
-   IEEE80211_OFDM_RATE_24MB|IEEE80211_BASIC_RATE_MASK
+   IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK, 
IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
+   IEEE80211_OFDM_RATE_24MB | IEEE80211_BASIC_RATE_MASK
 };
 
 int cckrates_included(unsigned char *rate, int ratelen)
-- 
2.18.0

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


[PATCH 3/3] staging: rtl8188eu: remove blank lines

2018-07-11 Thread Michael Straube
Remove unrequired blank lines as reported by checkpatch.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_ap.c| 6 --
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 1 -
 2 files changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
b/drivers/staging/rtl8188eu/core/rtw_ap.c
index be1e8bf41e00..454a975a14f2 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -626,7 +626,6 @@ void update_sta_info_apmode(struct adapter *padapter, 
struct sta_info *psta)
else
psta->ieee8021x_blocked = false;
 
-
/* update sta's cap */
 
/* ERP */
@@ -725,7 +724,6 @@ static void start_bss_network(struct adapter *padapter, u8 
*pbuf)
cur_bwmode = HT_CHANNEL_WIDTH_20;
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
 
-
/* check if there is wps ie,
 * if there is wpsie in beacon, the hostapd will update
 * beacon twice when stating hostapd, and at first time the
@@ -875,7 +873,6 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true)
return _FAIL;
 
-
if (len < 0 || len > MAX_IE_SZ)
return _FAIL;
 
@@ -885,7 +882,6 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 
*pbuf,  int len)
 
memcpy(ie, pbuf, pbss_network->ie_length);
 
-
if (pbss_network->InfrastructureMode != Ndis802_11APMode)
return _FAIL;
 
@@ -1681,7 +1677,6 @@ u8 ap_free_sta(struct adapter *padapter, struct sta_info 
*psta,
/* clear cam entry / key */
rtw_clearstakey_cmd(padapter, (u8 *)psta, (u8)(psta->mac_id + 3), true);
 
-
spin_lock_bh(&psta->lock);
psta->state &= ~_FW_LINKED;
spin_unlock_bh(&psta->lock);
@@ -1730,7 +1725,6 @@ int rtw_sta_flush(struct adapter *padapter)
}
spin_unlock_bh(&pstapriv->asoc_list_lock);
 
-
issue_deauth(padapter, bc_addr, WLAN_REASON_DEAUTH_LEAVING);
 
associated_clients_update(padapter, true);
diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c 
b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 1aed507dd7cb..5c4f3f8d013f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -1308,7 +1308,6 @@ void update_tx_basic_rate(struct adapter *padapter, u8 
wirelessmode)
else
memcpy(supported_rates, rtw_basic_rate_ofdm, 3);
 
-
if (wirelessmode & WIRELESS_11B)
update_mgnt_tx_rate(padapter, IEEE80211_CCK_RATE_1MB);
else
-- 
2.18.0

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


Re: [PATCH] staging: speakup: remove redundant variable l

2018-07-11 Thread Samuel Thibault
Colin King, le mer. 11 juil. 2018 12:26:07 +0100, a ecrit:
> From: Colin Ian King 
> 
> Variable l is being assigned but is never used hence it is redundant
> and can be removed.
> 
> Cleans up clang warning:
> warning: variable 'l' set but not used [-Wunused-but-set-variable
> 
> Signed-off-by: Colin Ian King 

Reviewed-by: Samuel Thibault 

> ---
>  drivers/staging/speakup/varhandlers.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/speakup/varhandlers.c 
> b/drivers/staging/speakup/varhandlers.c
> index 54a76b6752ad..1b545152cc49 100644
> --- a/drivers/staging/speakup/varhandlers.c
> +++ b/drivers/staging/speakup/varhandlers.c
> @@ -179,7 +179,6 @@ int spk_set_num_var(int input, struct st_var_header *var, 
> int how)
>  {
>   int val;
>   int *p_val = var->p_val;
> - int l;
>   char buf[32];
>   char *cp;
>   struct var_t *var_data = var->data;
> @@ -237,9 +236,9 @@ int spk_set_num_var(int input, struct st_var_header *var, 
> int how)
>   else
>   cp = buf;
>   if (!var_data->u.n.out_str)
> - l = sprintf(cp, var_data->u.n.synth_fmt, (int)val);
> + sprintf(cp, var_data->u.n.synth_fmt, (int)val);
>   else
> - l = sprintf(cp, var_data->u.n.synth_fmt, 
> var_data->u.n.out_str[val]);
> + sprintf(cp, var_data->u.n.synth_fmt, 
> var_data->u.n.out_str[val]);
>   synth_printf("%s", cp);
>   return 0;
>  }
> -- 
> 2.17.1
> 

-- 
Samuel
> Allez, soyez sympa ... traduisez-lui "linux"
Linux, c'est comme le miel : c'est vachement bon mais ça attire les
mouches. En plus, ça colle aux doigts et on a du mal à s'en défaire.
-+- TP in: Guide du linuxien pervers - "Barrez vous les mouches !"
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH -next] staging: pi433: fix error return code in pi433_probe()

2018-07-11 Thread Wei Yongjun
Fix to return a negative error code from the kthread_run() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun 
---
 drivers/staging/pi433/pi433_if.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 293602d..d4bfac1 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -1235,6 +1235,7 @@ static int pi433_probe(struct spi_device *spi)
 device->minor);
if (IS_ERR(device->tx_task_struct)) {
dev_dbg(device->dev, "start of send thread failed");
+   retval = PTR_ERR(device->tx_task_struct);
goto send_thread_failed;
}
 



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


Re: [PATCH 3/6] staging: rtl8723bs: fix indentation

2018-07-11 Thread Michael Straube

On 07/08/18 19:36, Michael Straube wrote:

On 07/08/18 18:46, Joe Perches wrote:

On Sun, 2018-07-08 at 12:38 +0200, Michael Straube wrote:

uint rtw_is_cckratesonly_included(u8 *rate)
{
while (*rate) {
    u8 r = *rate & 0x7f;

    if (r != 2 && r != 4 && r != 11 && r != 22)
    return false;
    rate++;
}

return true;
}



The patch has been added to staging-testing already.
I will send patches with your suggestions the next days.


Would it be preferred to declare the variable at the functions beginning,
or doesn't it matter regarding coding style?

uint rtw_is_cckratesonly_included(u8 *rate)
{
u8 r;

while (*rate) {
r = *rate & 0x7f;
...

Best,
Michael

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


Re: [PATCH v2 3/8] staging:rtl8192u: Correct spacing before and after parenthesis - Style

2018-07-11 Thread John Whitmore
On Wed, Jul 11, 2018 at 01:13:49PM +0200, Greg KH wrote:
> On Tue, Jul 10, 2018 at 04:05:18PM +0100, John Whitmore wrote:
> > Corrected coding style issues aroung opening and closed parenthesis. 
> > Spaces, or blank line, removed from after '(' or before ')'
> 
> Wrap your changelog text at 72 columns like your editor asked you to :(
> 
> I'll fix it up this time...

Oops sorry and thanks. I thought the magic number was 75 which I got from:

https://www.kernel.org/doc/html/v4.16/process/submitting-patches.html

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


[bug report] staging: ks7010: add new helpers to achieve mib set request and simplify code

2018-07-11 Thread Dan Carpenter
Hello Sergio Paracuellos,

The patch 8ce76bff0e6a: "staging: ks7010: add new helpers to achieve
mib set request and simplify code" from May 4, 2018, leads to the
following static checker warning:

drivers/staging/ks7010/ks_hostif.c:1845 hostif_sme_multicast_set()
warn: '2' cannot fit into 'bool'

drivers/staging/ks7010/ks_hostif.c
  1831  static
  1832  void hostif_sme_multicast_set(struct ks_wlan_private *priv)
  1833  {
  1834  struct net_device *dev = priv->net_dev;
  1835  int mc_count;
  1836  struct netdev_hw_addr *ha;
  1837  char set_address[NIC_MAX_MCAST_LIST * ETH_ALEN];
  1838  int i = 0;
  1839  
  1840  spin_lock(&priv->multicast_spin);
  1841  
  1842  memset(set_address, 0, NIC_MAX_MCAST_LIST * ETH_ALEN);
  1843  
  1844  if (dev->flags & IFF_PROMISC) {
  1845  hostif_mib_set_request_bool(priv, 
LOCAL_MULTICAST_FILTER,
  1846  MCAST_FILTER_PROMISC);
^
This is 2 but casted to MCAST_FILTER_MCASTALL because 
hostif_mib_set_request_bool() takes a
bool.

In the original code, we used to pass 2 but as MIB_VALUE_TYPE_BOOL type.
That's almost certainly buggy, but I don't know if it used to work on
not.

  1847  goto spin_unlock;
  1848  }
  1849  
  1850  if ((netdev_mc_count(dev) > NIC_MAX_MCAST_LIST) ||
  1851  (dev->flags & IFF_ALLMULTI)) {
  1852  hostif_mib_set_request_bool(priv, 
LOCAL_MULTICAST_FILTER,
  1853  MCAST_FILTER_MCASTALL);
  1854  goto spin_unlock;
  1855  }

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


Re: [PATCH v2 3/8] staging:rtl8192u: Correct spacing before and after parenthesis - Style

2018-07-11 Thread Greg KH
On Wed, Jul 11, 2018 at 03:09:37PM +0100, John Whitmore wrote:
> On Wed, Jul 11, 2018 at 01:13:49PM +0200, Greg KH wrote:
> > On Tue, Jul 10, 2018 at 04:05:18PM +0100, John Whitmore wrote:
> > > Corrected coding style issues aroung opening and closed parenthesis. 
> > > Spaces, or blank line, removed from after '(' or before ')'
> > 
> > Wrap your changelog text at 72 columns like your editor asked you to :(
> > 
> > I'll fix it up this time...
> 
> Oops sorry and thanks. I thought the magic number was 75 which I got from:
> 
> https://www.kernel.org/doc/html/v4.16/process/submitting-patches.html

75 works as well :)

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


Re: [PATCH v2 3/8] staging:rtl8192u: Correct spacing before and after parenthesis - Style

2018-07-11 Thread John Whitmore
On Wed, Jul 11, 2018 at 04:22:50PM +0200, Greg KH wrote:
> On Wed, Jul 11, 2018 at 03:09:37PM +0100, John Whitmore wrote:
> > On Wed, Jul 11, 2018 at 01:13:49PM +0200, Greg KH wrote:
> > > On Tue, Jul 10, 2018 at 04:05:18PM +0100, John Whitmore wrote:
> > > > Corrected coding style issues aroung opening and closed parenthesis. 
> > > > Spaces, or blank line, removed from after '(' or before ')'
> > > 
> > > Wrap your changelog text at 72 columns like your editor asked you to :(
> > > 
> > > I'll fix it up this time...
> > 
> > Oops sorry and thanks. I thought the magic number was 75 which I got from:
> > 
> > https://www.kernel.org/doc/html/v4.16/process/submitting-patches.html
> 
> 75 works as well :)
> 

Well if I went over 75, which I knew about I'm very sorry I messed up. I'll
keep an eye out in future. Might be using the wrong editor but let's not go
there.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 3/8] staging:rtl8192u: Correct spacing before and after parenthesis - Style

2018-07-11 Thread Dan Carpenter
On Wed, Jul 11, 2018 at 03:27:11PM +0100, John Whitmore wrote:
> On Wed, Jul 11, 2018 at 04:22:50PM +0200, Greg KH wrote:
> > On Wed, Jul 11, 2018 at 03:09:37PM +0100, John Whitmore wrote:
> > > On Wed, Jul 11, 2018 at 01:13:49PM +0200, Greg KH wrote:
> > > > On Tue, Jul 10, 2018 at 04:05:18PM +0100, John Whitmore wrote:
> > > > > Corrected coding style issues aroung opening and closed parenthesis. 
> > > > > Spaces, or blank line, removed from after '(' or before ')'
> > > > 
> > > > Wrap your changelog text at 72 columns like your editor asked you to :(
> > > > 
> > > > I'll fix it up this time...
> > > 
> > > Oops sorry and thanks. I thought the magic number was 75 which I got from:
> > > 
> > > https://www.kernel.org/doc/html/v4.16/process/submitting-patches.html
> > 
> > 75 works as well :)
> > 
> 
> Well if I went over 75, which I knew about I'm very sorry I messed up. I'll
> keep an eye out in future. Might be using the wrong editor but let's not go
> there.

Here is the line:

Corrected coding style issues aroung opening and closed parenthesis. Spaces, or 
blank line, removed from after '(' or before ')'

It's 128 characters.

regards,
dan carpenter

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


Re: [PATCH v2 3/8] staging:rtl8192u: Correct spacing before and after parenthesis - Style

2018-07-11 Thread John Whitmore
On Wed, Jul 11, 2018 at 05:29:43PM +0300, Dan Carpenter wrote:
> On Wed, Jul 11, 2018 at 03:27:11PM +0100, John Whitmore wrote:
> > On Wed, Jul 11, 2018 at 04:22:50PM +0200, Greg KH wrote:
> > > On Wed, Jul 11, 2018 at 03:09:37PM +0100, John Whitmore wrote:
> > > > On Wed, Jul 11, 2018 at 01:13:49PM +0200, Greg KH wrote:
> > > > > On Tue, Jul 10, 2018 at 04:05:18PM +0100, John Whitmore wrote:
> > > > > > Corrected coding style issues aroung opening and closed 
> > > > > > parenthesis. Spaces, or blank line, removed from after '(' or 
> > > > > > before ')'
> > > > > 
> > > > > Wrap your changelog text at 72 columns like your editor asked you to 
> > > > > :(
> > > > > 
> > > > > I'll fix it up this time...
> > > > 
> > > > Oops sorry and thanks. I thought the magic number was 75 which I got 
> > > > from:
> > > > 
> > > > https://www.kernel.org/doc/html/v4.16/process/submitting-patches.html
> > > 
> > > 75 works as well :)
> > > 
> > 
> > Well if I went over 75, which I knew about I'm very sorry I messed up. I'll
> > keep an eye out in future. Might be using the wrong editor but let's not go
> > there.
> 
> Here is the line:
> 
> Corrected coding style issues aroung opening and closed parenthesis. Spaces, 
> or blank line, removed from after '(' or before ')'
> 
> It's 128 characters.
> 
> regards,
> dan carpenter
> 

Scissors I really messed that up. Sorry again, editor must have dropped out of
auto-fill-mode for some reason. :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC PATCH v1] Xilinx AXI-Stream FIFO v4.1 IP core driver

2018-07-11 Thread Jacob Feder
On Mon, Jul 09, 2018 at 05:25:21PM +0300, Dan Carpenter wrote:
> On Sat, Jul 07, 2018 at 10:19:40PM -0400, Jacob Feder wrote:
> > +static ssize_t sysfs_write(struct device *dev, const char *buf,
> > +  size_t count, unsigned int addr_offset)
> > +{
> > +   struct axis_fifo_local *device_wrapper = dev_get_drvdata(dev);
> 
> What does the "local" mean in axis_fifo_local?  "device_wrapper" is a
> weird name.  It's sort of long but also meaningless and or confusing.
> What kind of device?  What is it wrapping?  How is it not a fifo?  And
> because it's a bit long then we run into the 80 character limit.  Maybe
> just say "struct axis_fifo_local *fifo;"?

fixed

> 
> > +
> > +   if (!mutex_trylock(&device_wrapper->write_mutex)) {
> > +   dev_err(device_wrapper->os_device,
> > +   "couldn't acquire write lock\n");
> > +   return -EBUSY;
> > +   }
> 
> Greg has said to remove this.
> 

fixed

> > +
> > +   if (!mutex_trylock(&device_wrapper->read_mutex)) {
> > +   dev_err(device_wrapper->os_device,
> > +   "couldn't acquire read lock\n");
> > +   mutex_unlock(&device_wrapper->write_mutex);
> > +   dev_dbg(device_wrapper->os_device, "released write lock\n");
> > +   return -EBUSY;
> > +   }
> > +
> > +   dev_dbg(device_wrapper->os_device, "acquired locks\n");
> 
> Remove this, because it's related to locks.  Also you can get this info
> from ftrace.  The extra debug code just obscures the interest parts of
> the code because there is too much debugging.
> 
> ->os_device is a bad name, because there isn't an operating system
> device.  What does that even mean?
> 

fixed

> > +
> > +   if (count != 4) {
> 
> Remove the magic number.  Just say sizeof(u32).
> 

fixed

> > +   dev_err(device_wrapper->os_device,
> > +   "error, sysfs write to address 0x%x expected 4 bytes\n",
> > +   addr_offset);
> > +   mutex_unlock(&device_wrapper->write_mutex);
> > +   mutex_unlock(&device_wrapper->read_mutex);
> 
> Don't let user space spam /var/log messages.  Just return -EINVAL;
> 

fixed

> > +   return -EINVAL;
> > +   }
> > +
> > +   dev_dbg(device_wrapper->os_device,
> > +   "writing 0x%x to sysfs address 0x%x\n",
> > +   *(unsigned int *)buf, addr_offset);
> > +   iowrite32(*(unsigned int __force *)buf,
> 
> __force is for when you're casting to and from __user types.  It's not
> required here.
> 

fixed

> > + device_wrapper->base_addr + addr_offset);
> > +   mutex_unlock(&device_wrapper->write_mutex);
> > +   mutex_unlock(&device_wrapper->read_mutex);
> > +   dev_dbg(device_wrapper->os_device, "released locks\n");
> 
> ftrace.
> 
> > +
> > +   return 4;
> 
> This is a magic number.  Use "return count;" instead.
> 

fixed

> > +}
> 
> So now it's:
> 
> static ssize_t sysfs_write(struct device *dev, const char *buf,
>  size_t count, unsigned int addr_offset)
> {
>   struct axis_fifo_local *fifo = dev_get_drvdata(dev);
> 
>   if (count != sizeof(u32))
>   return -EINVAL;
> 
>   iowrite32(*(u32 *)buf, fifo->base_addr + addr_offset);
> 
>   return count;
> }
> 
> Sysfs files are supposed to be human readable text files so I don't
> feel like casting *(u32 *)buf is the right thing.  In other words you do
> echo "1234" > /sys/whatever.  What are we trying to write here?
> Normally we would use kstrotul() and write the value that
> way.
> 

fixed

> > +// reads a single packet from the fifo as dictated by the tlast signal
> 
> Please use /* */ style comments.
> 

fixed

> > +static ssize_t axis_fifo_read(struct file *device_file, char __user *buf,
> > + size_t len, loff_t *off)
> > +{
> > +   struct axis_fifo_local *device_wrapper =
> > +   (struct axis_fifo_local *)device_file->private_data;
> > +   unsigned int bytes_available;
> > +   unsigned int words_available;
> > +   unsigned int word;
> > +   unsigned int buff_word;
> 
> One f in buf.  Otherwise it means a person who works out a lot.  This
> is just an iterator.  "int i;"
> 

fixed

> > +   int wait_ret;
> 
> Just say "int ret;"
> 

fixed

> > +   u32 read_buff[READ_BUFF_SIZE];
> > +
> > +   if (device_wrapper->read_flags & O_NONBLOCK) {
> > +   // opened in non-blocking mode
> > +   // return if there are no packets available
> > +   if (!ioread32(device_wrapper->base_addr + XLLF_RDFO_OFFSET))
> > +   return -EAGAIN;
> > +   } else {
> > +   // opened in blocking mode
> > +
> > +   // wait for a packet available interrupt (or timeout)
> > +   // if nothing is currently available
> > +   spin_lock_irq(&device_wrapper->read_queue_lock);
> > +   if (read_timeout < 0) {
> 
> There are too many O_NONBLOCK and read_timeout modes...
> 

Not sure what to do about this - I think they are all necessary?

> > + 

RE: [PATCH 1/1] Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic

2018-07-11 Thread Sunil Muthuswamy
Thanks, Michael. In which branch should I fix these now that the changes have 
been
merged with the char-misc-next branch?

Comments inline.

> -Original Message-
> From: Michael Kelley (EOSG)
> Sent: Tuesday, July 10, 2018 6:05 PM
> To: KY Srinivasan ; gre...@linuxfoundation.org; linux-
> ker...@vger.kernel.org; de...@linuxdriverproject.org; o...@aepfle.de;
> a...@canonical.com; jasow...@redhat.com; Stephen Hemminger
> ; vkuzn...@redhat.com
> Cc: Sunil Muthuswamy 
> Subject: RE: [PATCH 1/1] Drivers: HV: Send one page worth of kmsg dump
> over Hyper-V during panic
> 
> From k...@linuxonhyperv.com   Sent: Saturday,
> July 7, 2018 7:57 PM
> >
> > From: Sunil Muthuswamy 
> >
> > In the VM mode on Hyper-V, currently, when the kernel panics, an error
> > code and few register values are populated in an MSR and the Hypervisor
> > notified. This information is collected on the host. The amount of
> > information currently collected is found to be limited and not very
> > actionable. To gather more actionable data, such as stack trace, the
> > proposal is to write one page worth of kmsg data on an allocated page
> > and the Hypervisor notified of the page address through the MSR.
> >
> > - Sysctl option to control the behavior, with ON by default.
> >
> > Cc: K. Y. Srinivasan 
> > Cc: Stephen Hemminger 
> > Signed-off-by: Sunil Muthuswamy 
> > Signed-off-by: K. Y. Srinivasan 
> > ---
> 
> > +   /*
> > +* Write dump contents to the page. No need to synchronize; panic
> should
> > +* be single-threaded.
> > +*/
> > +   if (!kmsg_dump_get_buffer(dumper, true, hv_panic_page,
> > + PAGE_SIZE, &bytes_written)) {
> > +   pr_err("Hyper-V: Unable to get kmsg data for panic\n");
> > +   return;
> 
> From what I can see, the return value from kmsg_dump_get_buffer()
> is not an indication of success or failure -- it's an indication of whether
> there is more data available.   There's no reason to output an error
> message.
> 
That seems correct. Will address this.
> > @@ -1065,6 +1136,32 @@ static int vmbus_bus_init(void)
> >  * Only register if the crash MSRs are available
> >  */
> > if (ms_hyperv.misc_features &
> HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) {
> > +   u64 hyperv_crash_ctl;
> > +   /*
> > +* Sysctl registration is not fatal, since by default
> > +* reporting is enabled.
> > +*/
> > +   hv_ctl_table_hdr = register_sysctl_table(hv_root_table);
> > +   if (!hv_ctl_table_hdr)
> > +   pr_err("Hyper-V: sysctl table register error");
> > +
> > +   /*
> > +* Register for panic kmsg callback only if the right
> > +* capability is supported by the hypervisor.
> > +*/
> > +   rdmsrl(HV_X64_MSR_CRASH_CTL, hyperv_crash_ctl);
> > +   if (hyperv_crash_ctl &
> HV_CRASH_CTL_CRASH_NOTIFY_MSG) {
> 
> vmbus_drv.c is architecture independent code, and should not be
> referencing
> x86/x64 MSRs.   Reading the MSR (and maybe the test as well?) should go
> in a separate function in an x86-specific source file.
> 
I will move the code.
> And just to confirm, is this the right way to test for the feature?  Usually,
> feature determination is based on one of the feature registers.  The
> NOTIFY_MSG flag seems to have a dual meaning -- on read it indicates
> the feature is present.  On write in hyperv_report_panic_msg(), it evidently
> means that the guest is sending a full page of data to Hyper-V.
> 
As per my conversation with John, this seems to be correct and something
also he suggested. The host sets these bits depending on whether it supports
these features or not.

> > @@ -1081,6 +1178,11 @@ static int vmbus_bus_init(void)
> > bus_unregister(&hv_bus);
> > +   free_page((unsigned long)hv_panic_page);
> > +   if (!hv_ctl_table_hdr) {
> 
> The above test is backwards.  Remove the bang.
Good call, will do.
> 
> > @@ -1785,10 +1887,18 @@ static void __exit vmbus_exit(void)
> > +   free_page((unsigned long)hv_panic_page);
> > +   if (!hv_ctl_table_hdr) {
> 
> Same here.  Test is backwards.
> 
Will fix.
> Michael

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


Re: [PATCH] staging: comedi: remove redundant variable segpos

2018-07-11 Thread Ian Abbott

On 11/07/18 11:32, Colin King wrote:

From: Colin Ian King 

Variable segpos is being assigned but is never used hence it is redundant
and can be removed.

Cleans up clang warning:
warning: variable 'segpos' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King 
---
  drivers/staging/comedi/drivers/pcl816.c | 4 ++--
  drivers/staging/comedi/drivers/pcl818.c | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)


Looks good, thanks!

Reviewed-by: Ian Abbott 

--
-=( Ian Abbott  || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268.  Registered address:)=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/6] staging: rtl8723bs: fix indentation

2018-07-11 Thread Joe Perches
On Wed, 2018-07-11 at 15:57 +0200, Michael Straube wrote:
> On 07/08/18 19:36, Michael Straube wrote:
> > On 07/08/18 18:46, Joe Perches wrote:
> > > On Sun, 2018-07-08 at 12:38 +0200, Michael Straube wrote:
> > > 
> > > uint rtw_is_cckratesonly_included(u8 *rate)
> > > {
> > > while (*rate) {
> > > u8 r = *rate & 0x7f;
> > > 
> > > if (r != 2 && r != 4 && r != 11 && r != 22)
> > > return false;
> > > rate++;
> > > }
> > > 
> > > return true;
> > > }
> > > 
> > 
> > The patch has been added to staging-testing already.
> > I will send patches with your suggestions the next days.
> 
> Would it be preferred to declare the variable at the functions beginning,
> or doesn't it matter regarding coding style?

Not really.

It's generally preferred to have declarations in the
nearest possible open brace to allow the compiler to
reduce the overall stack space consumed by the function.

For example prefer:

int some_function(int arg, void *pointer)
{
if (arg == 1} {
struct foo a = *(struct foo *)pointer;
...
} else if (arg == 2) {
struct bar b = *(struct bar *)pointer;
...
}
}

over

int some_function(int arg, void *pointer)
{
struct foo a;
s
truct bar b;

if (arg == 1} {
a = *(struct foo *)pointer;
...
} else if (arg == 2) {
b = *(struct bar *)pointer;
...
}
}

as a and b could use the same stack in the
first example but not the second.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/6] staging: rtl8723bs: fix indentation

2018-07-11 Thread Michael Straube

On 07/11/18 18:03, Joe Perches wrote:

On Wed, 2018-07-11 at 15:57 +0200, Michael Straube wrote:

On 07/08/18 19:36, Michael Straube wrote:

On 07/08/18 18:46, Joe Perches wrote:

On Sun, 2018-07-08 at 12:38 +0200, Michael Straube wrote:

uint rtw_is_cckratesonly_included(u8 *rate)
{
 while (*rate) {
 u8 r = *rate & 0x7f;

 if (r != 2 && r != 4 && r != 11 && r != 22)
 return false;
 rate++;
 }

 return true;
}



The patch has been added to staging-testing already.
I will send patches with your suggestions the next days.


Would it be preferred to declare the variable at the functions beginning,
or doesn't it matter regarding coding style?


Not really.

It's generally preferred to have declarations in the
nearest possible open brace to allow the compiler to
reduce the overall stack space consumed by the function.

For example prefer:

int some_function(int arg, void *pointer)
{
if (arg == 1} {
struct foo a = *(struct foo *)pointer;
...
} else if (arg == 2) {
struct bar b = *(struct bar *)pointer;
...
}
}

over

int some_function(int arg, void *pointer)
{
struct foo a;
s
truct bar b;

if (arg == 1} {
a = *(struct foo *)pointer;
...
} else if (arg == 2) {
b = *(struct bar *)pointer;
...
}
}

as a and b could use the same stack in the
first example but not the second.



Ok, thanks for explaining.
Michael
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/10] staging:rtl8192u: typedef struct tx_desc_819x_usb > struct tx_desc_819x_usb

2018-07-11 Thread John Whitmore
Change structure tx_desc_819x_usb from being typedef to being a simple
structure, without the typedef.

checkpatch warns about defining new types in code.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/r8192U.h  | 6 +++---
 drivers/staging/rtl8192u/r8192U_core.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index 37aa36126d19..fa451c6081ef 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -177,7 +177,7 @@ extern u32 rt_global_debug_component;
 #defineCCK_Table_length12
 
 /* For rtl819x */
-typedef struct _tx_desc_819x_usb {
+struct tx_desc_819x_usb {
/* DWORD 0 */
u16 PktSize;
u8  Offset;
@@ -213,7 +213,7 @@ typedef struct _tx_desc_819x_usb {
u32 Reserved5;
u32 Reserved6;
u32 Reserved7;
-} tx_desc_819x_usb, *ptx_desc_819x_usb;
+};
 
 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
 typedef struct _tx_desc_819x_usb_aggr_subframe {
@@ -371,7 +371,7 @@ typedef struct rx_drvinfo_819x_usb {
 #define MAX_FIRMWARE_INFORMATION_SIZE   32
 #define MAX_802_11_HEADER_LENGTH(40 + MAX_FIRMWARE_INFORMATION_SIZE)
 #define ENCRYPTION_MAX_OVERHEAD128
-#defineUSB_HWDESC_HEADER_LEN   sizeof(tx_desc_819x_usb)
+#defineUSB_HWDESC_HEADER_LEN   sizeof(struct tx_desc_819x_usb)
 #define TX_PACKET_SHIFT_BYTES  (USB_HWDESC_HEADER_LEN + 
sizeof(tx_fwinfo_819x_usb))
 #define MAX_FRAGMENT_COUNT 8
 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 848239e24859..a2a107521450 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1462,7 +1462,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 
MAX_DEV_ADDR_SIZE);
-   tx_desc_819x_usb *tx_desc = (tx_desc_819x_usb *)skb->data;
+   struct tx_desc_819x_usb *tx_desc = (struct tx_desc_819x_usb *)skb->data;
tx_fwinfo_819x_usb *tx_fwinfo =
(tx_fwinfo_819x_usb *)(skb->data + USB_HWDESC_HEADER_LEN);
struct usb_device *udev = priv->udev;
@@ -1535,7 +1535,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
}
 
/* Fill Tx descriptor */
-   memset(tx_desc, 0, sizeof(tx_desc_819x_usb));
+   memset(tx_desc, 0, sizeof(struct tx_desc_819x_usb));
/* DWORD 0 */
tx_desc->LINIP = 0;
tx_desc->CmdInit = 1;
-- 
2.18.0

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


[PATCH 04/10] staging:rtl8192u: Rename file macro to avoid camel case - Coding Style

2018-07-11 Thread John Whitmore
Simple rename of the preprosessor switch, protecting against multiple
inclusion of the header file. Change to clear the checkpatch coding style
issue.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/r8192U.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index a653a51f7b90..86cf3ef3a970 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -15,8 +15,8 @@
  * project Authors.
  */
 
-#ifndef R819xU_H
-#define R819xU_H
+#ifndef R819U_H
+#define R819U_H
 
 #include 
 #include 
-- 
2.18.0

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


[PATCH 06/10] staging:rtl8192u: typedef struct tx_fwinfo_819x_usb remove typedef

2018-07-11 Thread John Whitmore
Change structure tx_fwinfo_819x_usb from being typedef to being a simple
structure, without the typedef.

Clears the coding style issue flagged by checkpatch, (new type definitions)

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/r8192U.h  |  6 +++---
 drivers/staging/rtl8192u/r8192U_core.c | 10 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index 7dd99612620a..d9dbd3ca3dac 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -240,7 +240,7 @@ struct tx_desc_cmd_819x_usb {
u32 Reserved8;
 };
 
-typedef struct _tx_fwinfo_819x_usb {
+struct tx_fwinfo_819x_usb {
/* DOWRD 0 */
u8  TxRate:7;
u8  CtsEnable:1;
@@ -271,7 +271,7 @@ typedef struct _tx_fwinfo_819x_usb {
u32 TxAGCSign:1;
u32 Tx_INFO_RSVD:6;
u32 PacketID:13;
-} tx_fwinfo_819x_usb, *ptx_fwinfo_819x_usb;
+};
 
 struct rtl8192_rx_info {
struct urb *urb;
@@ -342,7 +342,7 @@ typedef struct rx_drvinfo_819x_usb {
 #define MAX_802_11_HEADER_LENGTH(40 + MAX_FIRMWARE_INFORMATION_SIZE)
 #define ENCRYPTION_MAX_OVERHEAD128
 #defineUSB_HWDESC_HEADER_LEN   sizeof(struct tx_desc_819x_usb)
-#define TX_PACKET_SHIFT_BYTES  (USB_HWDESC_HEADER_LEN + 
sizeof(tx_fwinfo_819x_usb))
+#define TX_PACKET_SHIFT_BYTES  (USB_HWDESC_HEADER_LEN + sizeof(struct 
tx_fwinfo_819x_usb))
 #define MAX_FRAGMENT_COUNT 8
 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
 #define MAX_TRANSMIT_BUFFER_SIZE   32000
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index d7fa7ece62fb..75bbcc115141 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1463,8 +1463,8 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
struct r8192_priv *priv = ieee80211_priv(dev);
struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 
MAX_DEV_ADDR_SIZE);
struct tx_desc_819x_usb *tx_desc = (struct tx_desc_819x_usb *)skb->data;
-   tx_fwinfo_819x_usb *tx_fwinfo =
-   (tx_fwinfo_819x_usb *)(skb->data + USB_HWDESC_HEADER_LEN);
+   struct tx_fwinfo_819x_usb *tx_fwinfo =
+   (struct tx_fwinfo_819x_usb *)(skb->data + 
USB_HWDESC_HEADER_LEN);
struct usb_device *udev = priv->udev;
int pend;
int status;
@@ -1489,7 +1489,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
}
 
/* Fill Tx firmware info */
-   memset(tx_fwinfo, 0, sizeof(tx_fwinfo_819x_usb));
+   memset(tx_fwinfo, 0, sizeof(struct tx_fwinfo_819x_usb));
/* DWORD 0 */
tx_fwinfo->TxHT = (tcb_desc->data_rate & 0x80) ? 1 : 0;
tx_fwinfo->TxRate = MRateToHwRate8190Pci(tcb_desc->data_rate);
@@ -1539,7 +1539,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
/* DWORD 0 */
tx_desc->LINIP = 0;
tx_desc->CmdInit = 1;
-   tx_desc->Offset =  sizeof(tx_fwinfo_819x_usb) + 8;
+   tx_desc->Offset =  sizeof(struct tx_fwinfo_819x_usb) + 8;
tx_desc->PktSize = (skb->len - TX_PACKET_SHIFT_BYTES) & 0x;
 
/*DWORD 1*/
@@ -1570,7 +1570,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
}
 
tx_desc->QueueSelect = MapHwQueueToFirmwareQueue(tcb_desc->queue_index);
-   tx_desc->TxFWInfoSize =  sizeof(tx_fwinfo_819x_usb);
+   tx_desc->TxFWInfoSize =  sizeof(struct tx_fwinfo_819x_usb);
 
tx_desc->DISFB = tcb_desc->bTxDisableRateFallBack;
tx_desc->USERATE = tcb_desc->bTxUseDriverAssingedRate;
-- 
2.18.0

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


[PATCH 09/10] staging:rtl8192u: remove typedef from struct rx_drvinfo_819x_usb

2018-07-11 Thread John Whitmore
Removed the typedef from the struct rx_drvinfo_819x_usb  to leave it as a
simple structure.

This clears the issue flagged by checkpatch, defining new types.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/r8192U.h  |  4 ++--
 drivers/staging/rtl8192u/r8192U_core.c | 10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index c8a23a831d51..83bc4cef5b17 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -294,7 +294,7 @@ struct rx_desc_819x_usb {
u32 Reserved2;
 };
 
-typedef struct rx_drvinfo_819x_usb {
+struct rx_drvinfo_819x_usb {
/* DWORD 0 */
u16 Reserved1:12;
u16 PartAggr:1;
@@ -315,7 +315,7 @@ typedef struct rx_drvinfo_819x_usb {
/* DWORD 1 */
u32  TSFL;
 
-} rx_drvinfo_819x_usb, *prx_drvinfo_819x_usb;
+};
 
 /* Support till 64 bit bus width OS */
 #define MAX_DEV_ADDR_SIZE  8
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 655aae06f8a4..c01e8d76a265 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -4194,7 +4194,7 @@ static inline bool rx_hal_is_cck_rate(struct 
rx_drvinfo_819x_usb *pdrvinfo)
 
 static void rtl8192_query_rxphystatus(struct r8192_priv *priv,
  struct ieee80211_rx_stats *pstats,
- rx_drvinfo_819x_usb  *pdrvinfo,
+ struct rx_drvinfo_819x_usb  *pdrvinfo,
  struct ieee80211_rx_stats *precord_stats,
  bool bpacket_match_bssid,
  bool bpacket_toself,
@@ -4231,7 +4231,7 @@ static void rtl8192_query_rxphystatus(struct r8192_priv 
*priv,
prxpkt = (u8 *)pdrvinfo;
 
/* Move pointer to the 16th bytes. Phy status start address. */
-   prxpkt += sizeof(rx_drvinfo_819x_usb);
+   prxpkt += sizeof(struct rx_drvinfo_819x_usb);
 
/* Initial the cck and ofdm buffer pointer */
pcck_buf = (phy_sts_cck_819xusb_t *)prxpkt;
@@ -4431,7 +4431,7 @@ static void rtl8192_record_rxdesc_forlateruse(
 
 static void TranslateRxSignalStuff819xUsb(struct sk_buff *skb,
  struct ieee80211_rx_stats *pstats,
- rx_drvinfo_819x_usb  *pdrvinfo)
+ struct rx_drvinfo_819x_usb  *pdrvinfo)
 {
/* TODO: We must only check packet for current MAC address.
 * Not finish
@@ -4630,7 +4630,7 @@ static void query_rxdesc_status(struct sk_buff *skb,
struct rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb;
struct net_device *dev = info->dev;
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
-   rx_drvinfo_819x_usb  *driver_info = NULL;
+   struct rx_drvinfo_819x_usb  *driver_info = NULL;
 
/* Get Rx Descriptor Information */
struct rx_desc_819x_usb *desc = (struct rx_desc_819x_usb *)skb->data;
@@ -4657,7 +4657,7 @@ static void query_rxdesc_status(struct sk_buff *skb,
 * Driver info are written to the RxBuffer following rx desc
 */
if (stats->RxDrvInfoSize != 0) {
-   driver_info = (rx_drvinfo_819x_usb *)(
+   driver_info = (struct rx_drvinfo_819x_usb *)(
skb->data
+ sizeof(struct rx_desc_819x_usb)
+ stats->RxBufShift
-- 
2.18.0

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


[PATCH 02/10] staging:rtl8192u: trim multiple blank lines - Coding Style

2018-07-11 Thread John Whitmore
Trim the extra blank lines from the code, to clear checkpatch messages.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/r8192U.h | 20 
 1 file changed, 20 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index fa451c6081ef..da23e7e9e3b9 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -59,7 +59,6 @@ extern u32 rt_global_debug_component;
 #define COMP_DBGBIT(1)
 #define COMP_INIT   BIT(2)  /* Driver initialization/halt/reset. */
 
-
 #define COMP_RECV   BIT(3)  /* Receive data path. */
 #define COMP_SEND   BIT(4)  /* Send data path. */
 #define COMP_IO BIT(5)
@@ -127,7 +126,6 @@ extern u32 rt_global_debug_component;
 #define RT_DEBUG_DATA(level, data, datalen) do {} while (0)
 #endif /* RTL8169_DEBUG */
 
-
 /* Queue Select Value in TxDesc */
 #define QSLT_BK 0x1
 #define QSLT_BE 0x0
@@ -240,8 +238,6 @@ typedef struct _tx_desc_819x_usb_aggr_subframe {
 } tx_desc_819x_usb_aggr_subframe, *ptx_desc_819x_usb_aggr_subframe;
 #endif
 
-
-
 typedef struct _tx_desc_cmd_819x_usb {
/* DWORD 0 */
u16 Reserved0;
@@ -269,7 +265,6 @@ typedef struct _tx_desc_cmd_819x_usb {
u32 Reserved8;
 } tx_desc_cmd_819x_usb, *ptx_desc_cmd_819x_usb;
 
-
 typedef struct _tx_fwinfo_819x_usb {
/* DOWRD 0 */
u8  TxRate:7;
@@ -492,7 +487,6 @@ typedef struct _rt_firmware_info_819xUsb {
 
 #definePHY_RSSI_SLID_WIN_MAX   100
 
-
 typedef enum _WIRELESS_MODE {
WIRELESS_MODE_UNKNOWN = 0x00,
WIRELESS_MODE_A = 0x01,
@@ -503,7 +497,6 @@ typedef enum _WIRELESS_MODE {
WIRELESS_MODE_N_5G = 0x20
 } WIRELESS_MODE;
 
-
 #define RTL_IOCTL_WPA_SUPPLICANT   (SIOCIWFIRSTPRIV + 30)
 
 typedef struct buffer {
@@ -523,11 +516,6 @@ typedef struct rtl_reg_debug {
unsigned char buf[0xff];
 } rtl_reg_debug;
 
-
-
-
-
-
 typedef struct _rt_9x_tx_rate_history {
u32 cck[4];
u32 ofdm[8];
@@ -642,13 +630,11 @@ typedef struct Stats {
u32 CurrentShowTxate;
 } Stats;
 
-
 /* Bandwidth Offset */
 #define HAL_PRIME_CHNL_OFFSET_DONT_CARE0
 #define HAL_PRIME_CHNL_OFFSET_LOWER1
 #define HAL_PRIME_CHNL_OFFSET_UPPER2
 
-
 typedef struct ChnlAccessSetting {
u16 SIFS_Timer;
u16 DIFS_Timer;
@@ -757,7 +743,6 @@ typedef struct _ccktxbbgain_struct {
u8  ccktxbb_valuearray[8];
 } ccktxbbgain_struct, *pccktxbbgain_struct;
 
-
 typedef struct _init_gain {
u8  xaagccore1;
u8  xbagccore1;
@@ -793,7 +778,6 @@ typedef struct _phy_cck_rx_status_report_819xusb {
u8  cck_agc_rpt;
 } phy_sts_cck_819xusb_t;
 
-
 struct phy_ofdm_rx_status_rxsc_sgien_exintfflag {
u8  reserved:4;
u8  rxsc:2;
@@ -885,7 +869,6 @@ typedef struct r8192_priv {
short sens;
short max_sens;
 
-
short up;
/* If 1, allow bad crc frame, reception in monitor mode */
short crcmon;
@@ -924,7 +907,6 @@ typedef struct r8192_priv {
short  tx_urb_index;
atomic_t tx_pending[0x10]; /* UART_PRIORITY + 1 */
 
-
struct tasklet_struct irq_rx_tasklet;
struct urb *rxurb_task;
 
@@ -937,7 +919,6 @@ typedef struct r8192_priv {
u32 LastRxDescTSFHigh;
u32 LastRxDescTSFLow;
 
-
/* Rx Related variables */
u16 EarlyRxThreshold;
u32 ReceiveConfig;
@@ -1172,5 +1153,4 @@ void rtl819xusb_beacon_tx(struct net_device *dev, u16 
tx_rate);
 void EnableHWSecurityConfig8192(struct net_device *dev);
 void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, u8 
*MacAddr, u8 DefaultKey, u32 *KeyContent);
 
-
 #endif
-- 
2.18.0

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


[PATCH 03/10] staging:rtl8192u: remove unused structure tx_desc_819x_usb_aggr_subframe

2018-07-11 Thread John Whitmore
Structure tx_desc_819x_usb_aggr_subframe is defined in a local header file but
is not used outside of the header file. Removed from the code as a result.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/r8192U.h | 28 
 1 file changed, 28 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index da23e7e9e3b9..a653a51f7b90 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -213,31 +213,6 @@ struct tx_desc_819x_usb {
u32 Reserved7;
 };
 
-#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
-typedef struct _tx_desc_819x_usb_aggr_subframe {
-   /* DWORD 0 */
-   u16 PktSize;
-   u8  Offset;
-   u8  TxFWInfoSize;
-
-   /* DWORD 1 */
-   u8  RATid:3;
-   u8  DISFB:1;
-   u8  USERATE:1;
-   u8  MOREFRAG:1;
-   u8  NoEnc:1;
-   u8  PIFS:1;
-   u8  QueueSelect:5;
-   u8  NoACM:1;
-   u8  Reserved1:2;
-   u8  SecCAMID:5;
-   u8  SecDescAssign:1;
-   u8  SecType:2;
-   u8  PacketID:7;
-   u8  OWN:1;
-} tx_desc_819x_usb_aggr_subframe, *ptx_desc_819x_usb_aggr_subframe;
-#endif
-
 typedef struct _tx_desc_cmd_819x_usb {
/* DWORD 0 */
u16 Reserved0;
@@ -374,9 +349,6 @@ typedef struct rx_drvinfo_819x_usb {
 #else
 #define MAX_TRANSMIT_BUFFER_SIZE   8000
 #endif
-#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
-#define TX_PACKET_DRVAGGR_SUBFRAME_SHIFT_BYTES 
(sizeof(tx_desc_819x_usb_aggr_subframe) + sizeof(tx_fwinfo_819x_usb))
-#endif
 /* Octets for crc32 (FCS, ICV) */
 #define scrclng4
 
-- 
2.18.0

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


[PATCH 07/10] staging:rtl8192u: typedef struct rx_desc_819x_usb remove typedef

2018-07-11 Thread John Whitmore
Change structure rx_desc_819x_usb from being typedef to being a simple
structure, without the typedef.

Clears a checkpatch issue, definging new types in the code.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/r8192U.h  |  4 ++--
 drivers/staging/rtl8192u/r8192U_core.c | 14 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index d9dbd3ca3dac..d7f090c1bb44 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -279,7 +279,7 @@ struct rtl8192_rx_info {
u8 out_pipe;
 };
 
-typedef struct rx_desc_819x_usb {
+struct rx_desc_819x_usb {
/* DOWRD 0 */
u16 Length:14;
u16 CRC32:1;
@@ -292,7 +292,7 @@ typedef struct rx_desc_819x_usb {
 
/* DWORD 1 */
u32 Reserved2;
-} rx_desc_819x_usb, *prx_desc_819x_usb;
+};
 
 #ifdef USB_RX_AGGREGATION_SUPPORT
 typedef struct _rx_desc_819x_usb_aggr_subframe {
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 75bbcc115141..655aae06f8a4 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -739,7 +739,7 @@ static void rtl8192_rx_isr(struct urb *urb);
 
 static u32 get_rxpacket_shiftbytes_819xusb(struct ieee80211_rx_stats *pstats)
 {
-   return (sizeof(rx_desc_819x_usb) + pstats->RxDrvInfoSize
+   return (sizeof(struct rx_desc_819x_usb) + pstats->RxDrvInfoSize
+ pstats->RxBufShift);
 }
 
@@ -4633,7 +4633,7 @@ static void query_rxdesc_status(struct sk_buff *skb,
rx_drvinfo_819x_usb  *driver_info = NULL;
 
/* Get Rx Descriptor Information */
-   rx_desc_819x_usb *desc = (rx_desc_819x_usb *)skb->data;
+   struct rx_desc_819x_usb *desc = (struct rx_desc_819x_usb *)skb->data;
 
stats->Length = desc->Length;
stats->RxDrvInfoSize = desc->RxDrvInfoSize;
@@ -4659,7 +4659,7 @@ static void query_rxdesc_status(struct sk_buff *skb,
if (stats->RxDrvInfoSize != 0) {
driver_info = (rx_drvinfo_819x_usb *)(
skb->data
-   + sizeof(rx_desc_819x_usb)
+   + sizeof(struct rx_desc_819x_usb)
+ stats->RxBufShift
  );
/* unit: 0.5M */
@@ -4704,7 +4704,7 @@ static void query_rxdesc_status(struct sk_buff *skb,
 driver_info->FirstAGGR, driver_info->PartAggr);
}
 
-   skb_pull(skb, sizeof(rx_desc_819x_usb));
+   skb_pull(skb, sizeof(struct rx_desc_819x_usb));
/* Get Total offset of MPDU Frame Body */
if ((stats->RxBufShift + stats->RxDrvInfoSize) > 0) {
stats->bShift = 1;
@@ -4733,7 +4733,7 @@ static void rtl8192_rx_nomal(struct sk_buff *skb)
bool unicast_packet = false;
 
/* 20 is for ps-poll */
-   if ((skb->len >= (20 + sizeof(rx_desc_819x_usb))) && (skb->len < 
RX_URB_SIZE)) {
+   if ((skb->len >= (20 + sizeof(struct rx_desc_819x_usb))) && (skb->len < 
RX_URB_SIZE)) {
/* first packet should not contain Rx aggregation header */
query_rxdesc_status(skb, &stats, false);
/* TODO */
@@ -4809,7 +4809,7 @@ static void rtl819xusb_process_received_packet(
 static void query_rx_cmdpkt_desc_status(struct sk_buff *skb,
struct ieee80211_rx_stats *stats)
 {
-   rx_desc_819x_usb *desc = (rx_desc_819x_usb *)skb->data;
+   struct rx_desc_819x_usb *desc = (struct rx_desc_819x_usb *)skb->data;
 
/* Get Rx Descriptor Information */
stats->virtual_address = (u8 *)skb->data;
@@ -4835,7 +4835,7 @@ static void rtl8192_rx_cmd(struct sk_buff *skb)
.freq = IEEE80211_24GHZ_BAND,
};
 
-   if ((skb->len >= (20 + sizeof(rx_desc_819x_usb))) && (skb->len < 
RX_URB_SIZE)) {
+   if ((skb->len >= (20 + sizeof(struct rx_desc_819x_usb))) && (skb->len < 
RX_URB_SIZE)) {
query_rx_cmdpkt_desc_status(skb, &stats);
/* prfd->queue_id = 1; */
 
-- 
2.18.0

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


[0/10] staging:rtl8192u: One significant change...

2018-07-11 Thread John Whitmore
The first 9 patches in this series are coding style changes, including a
number of patches to remove the "typedef" directive from a number of data
structure definitions. This clears the checkpatch warning about defining new
data types in the code.

The last patch in the series, however, changes the data type of a member
variable from a u8 to an enumerated type. Generally in C an enumerated type is
implemented by the compiler as an int, but can be changed by compiler
directives. Either way the member variable will most probably have its size
changed by this patch. I don't think that the structure is mapped to hardware
or physical memory location, but is allocated and populated in the
rtl8192_usb_probe() function in the file r8192U_core.c. Given that
allocation/population I don't think that the size of the member variable is of
run time significance, bar the slight increase in size of the overall
structure.

The reason for doing this is to enable the compiler's checking of assignments
to the variable defined as an enumerated type. The alternative is to leave the
variable as a u8 and remove the enumerated type, replacing it with #define
definitions of the possible values.

I raised this issue on the kernel newbies mailing list and of the two
alternatives enumerated type won out.


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


[PATCH 05/10] staging:rtl8192u: typedef struct tx_desc_cmd_819x_usb remove typedef

2018-07-11 Thread John Whitmore
Change structure tx_desc_cmd_819x_usb from being typedef to being a simple
structure, without the typedef.

checkpatch warns about defining new types in the code.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/r8192U.h  | 4 ++--
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index 86cf3ef3a970..7dd99612620a 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -213,7 +213,7 @@ struct tx_desc_819x_usb {
u32 Reserved7;
 };
 
-typedef struct _tx_desc_cmd_819x_usb {
+struct tx_desc_cmd_819x_usb {
/* DWORD 0 */
u16 Reserved0;
u8  Reserved1;
@@ -238,7 +238,7 @@ typedef struct _tx_desc_cmd_819x_usb {
u32 Reserved6;
u32 Reserved7;
u32 Reserved8;
-} tx_desc_cmd_819x_usb, *ptx_desc_cmd_819x_usb;
+};
 
 typedef struct _tx_fwinfo_819x_usb {
/* DOWRD 0 */
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index a2a107521450..d7fa7ece62fb 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1242,7 +1242,7 @@ short rtl819xU_tx_cmd(struct net_device *dev, struct 
sk_buff *skb)
int status;
struct urb  *tx_urb;
unsigned intidx_pipe;
-   tx_desc_cmd_819x_usb *pdesc = (tx_desc_cmd_819x_usb *)skb->data;
+   struct tx_desc_cmd_819x_usb *pdesc = (struct tx_desc_cmd_819x_usb 
*)skb->data;
struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 
MAX_DEV_ADDR_SIZE);
u8 queue_index = tcb_desc->queue_index;
 
-- 
2.18.0

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


[PATCH 08/10] staging:rtl8192u: Remove struct rx_desc_819x_usb_aggr_subframe

2018-07-11 Thread John Whitmore
Removal of structure rx_desc_819x_usb_aggr_subframe from local header file,
which is not used outside the header file.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/r8192U.h | 18 --
 1 file changed, 18 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index d7f090c1bb44..c8a23a831d51 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -294,24 +294,6 @@ struct rx_desc_819x_usb {
u32 Reserved2;
 };
 
-#ifdef USB_RX_AGGREGATION_SUPPORT
-typedef struct _rx_desc_819x_usb_aggr_subframe {
-   /* DOWRD 0 */
-   u16 Length:14;
-   u16 CRC32:1;
-   u16 ICV:1;
-   u8  Offset;
-   u8  RxDrvInfoSize;
-   /* DOWRD 1 */
-   u8  Shift:2;
-   u8  PHYStatus:1;
-   u8  SWDec:1;
-   u8  Reserved1:4;
-   u8  Reserved2;
-   u16 Reserved3;
-} rx_desc_819x_usb_aggr_subframe, *prx_desc_819x_usb_aggr_subframe;
-#endif
-
 typedef struct rx_drvinfo_819x_usb {
/* DWORD 0 */
u16 Reserved1:12;
-- 
2.18.0

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


[PATCH 10/10] staging:rtl8192u: Change struct r8192_priv member Rf_Mode from u8 > enum

2018-07-11 Thread John Whitmore
The file r8192U.h defines the structure for holding private data for the
driver (typedef struct r8192_priv). This structure includes a member Rf_Mode
which is defined to be of type "u8".

Whilst the variable Rf_Mode is defined to be of type "u8" it is being assigned
enumerated values defined by the enumerated type "enum rf_op_type". Because of
the mismatch in types being used any advantage of using an enumerated type, to
have the compiler check assignments, is nullified.

This patch changes the type of the Rf_Mode member from a u8 to the enumerated
type "enum rf_op_type", so that the compiler can now check assignments.

This change of type would cause a problem if the structure was mapped from a
hardware device and the size and location of members was significant. I
believe that the structure to hold private data for the driver is allocated
from memory and populated with data in the function rtl8192_usb_probe() in the
file r8192U_core.c. As such the physical size of the member variable Rf_Mode
is not significant, so the change should have no impact on code execution, bar
the move from a u8 type to an int, (or whatever size compiler uses for enum).

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/r8192U.h | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index 83bc4cef5b17..3963855ad743 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -334,11 +334,12 @@ struct rx_drvinfo_819x_usb {
 /* Octets for crc32 (FCS, ICV) */
 #define scrclng4
 
-typedef enum rf_optype {
+enum rf_op_type {
RF_OP_By_SW_3wire = 0,
RF_OP_By_FW,
RF_OP_MAX
-} rf_op_type;
+};
+
 /* 8190 Loopback Mode definition */
 typedef enum _rtl819xUsb_loopback {
RTL819xU_NO_LOOPBACK = 0,
@@ -894,7 +895,7 @@ typedef struct r8192_priv {
u8  slot_time;
boolbDcut;
bool bCurrentRxAggrEnable;
-   u8 Rf_Mode; /* For Firmware RF -R/W switch */
+   enum rf_op_type Rf_Mode;/* For Firmware RF -R/W switch */
prt_firmwarepFirmware;
rtl819xUsb_loopback_e   LoopbackMode;
u16 EEPROMTxPowerDiff;
-- 
2.18.0

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


[PATCH] staging: rtl8188eu: break line longer than 80 cols

2018-07-11 Thread Kacper Kołodziej
Signed-off-by: Kacper Kołodziej 
---
 drivers/staging/rtl8188eu/core/rtw_ap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 454a975a14f2..220b4bbe1f84 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -362,7 +362,8 @@ voidexpire_timeout_chk(struct adapter *padapter)
stainfo_offset =
rtw_stainfo_offset(pstapriv, psta);
if (stainfo_offset_valid(stainfo_offset))
-   chk_alive_list[chk_alive_num++] = 
stainfo_offset;
+   chk_alive_list[chk_alive_num++] =
+   stainfo_offset;
continue;
}
 
-- 
2.16.4

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


RE: [PATCH 1/1] Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic

2018-07-11 Thread Michael Kelley (EOSG)
From: Sunil Muthuswamy Sent: Wednesday, July 11, 2018 9:59 AM
> Thanks, Michael. In which branch should I fix these now that the changes have 
> been
> merged with the char-misc-next branch?

If the original code is already in char-misc-next, you should probably submit a
completely new patch for char-misc-next that just makes the fixes to the 
original code.

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


[PATCH 2/2] staging: goldfish: add a blank line into struct goldfish_audio

2018-07-11 Thread rkir
From: Roman Kiryanov 

To separate data members and the comment for better readability.

Signed-off-by: Roman Kiryanov 
---
 drivers/staging/goldfish/goldfish_audio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/goldfish/goldfish_audio.c 
b/drivers/staging/goldfish/goldfish_audio.c
index 1d80e3243297..3a75df1d2a0a 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -38,6 +38,7 @@ MODULE_VERSION("1.0");
 struct goldfish_audio {
char __iomem *reg_base;
int irq;
+
/* lock protects access to buffer_status and to device registers */
spinlock_t lock;
wait_queue_head_t wait;
-- 
2.18.0.203.gfac676dfb9-goog

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


Re: [bug report] staging: ks7010: add new helpers to achieve mib set request and simplify code

2018-07-11 Thread Sergio Paracuellos
On Wed, Jul 11, 2018 at 05:19:15PM +0300, Dan Carpenter wrote:
> Hello Sergio Paracuellos,
> 
> The patch 8ce76bff0e6a: "staging: ks7010: add new helpers to achieve
> mib set request and simplify code" from May 4, 2018, leads to the
> following static checker warning:
> 
>   drivers/staging/ks7010/ks_hostif.c:1845 hostif_sme_multicast_set()
>   warn: '2' cannot fit into 'bool'
> 
> drivers/staging/ks7010/ks_hostif.c
>   1831  static
>   1832  void hostif_sme_multicast_set(struct ks_wlan_private *priv)
>   1833  {
>   1834  struct net_device *dev = priv->net_dev;
>   1835  int mc_count;
>   1836  struct netdev_hw_addr *ha;
>   1837  char set_address[NIC_MAX_MCAST_LIST * ETH_ALEN];
>   1838  int i = 0;
>   1839  
>   1840  spin_lock(&priv->multicast_spin);
>   1841  
>   1842  memset(set_address, 0, NIC_MAX_MCAST_LIST * ETH_ALEN);
>   1843  
>   1844  if (dev->flags & IFF_PROMISC) {
>   1845  hostif_mib_set_request_bool(priv, 
> LOCAL_MULTICAST_FILTER,
>   1846  MCAST_FILTER_PROMISC);
> ^
> This is 2 but casted to MCAST_FILTER_MCASTALL because 
> hostif_mib_set_request_bool() takes a
> bool.

Yes, you are totally right. This seems to be wrong. We should pass an int 
instead
of a bool to avoid this problem.

> 
> In the original code, we used to pass 2 but as MIB_VALUE_TYPE_BOOL type.
> That's almost certainly buggy, but I don't know if it used to work on
> not.

Me neither but it is clear this is not what th original code was doing.

> 
>   1847  goto spin_unlock;
>   1848  }
>   1849  
>   1850  if ((netdev_mc_count(dev) > NIC_MAX_MCAST_LIST) ||
>   1851  (dev->flags & IFF_ALLMULTI)) {
>   1852  hostif_mib_set_request_bool(priv, 
> LOCAL_MULTICAST_FILTER,
>   1853  MCAST_FILTER_MCASTALL);
>   1854  goto spin_unlock;
>   1855  }
> 
> regards,
> dan carpenter

Best regards,
Sergio Paracuellos
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: pass 'int' instead of 'bool' to 'hostif_mib_set_request_bool'

2018-07-11 Thread Sergio Paracuellos
'hostif_mib_set_request_bool' function receives a bool as value and
send the received value with MIB_VALUE_TYPE_BOOL type. There is
one case where the value passed is not a boolean one but
'MCAST_FILTER_PROMISC' which is '2'. Pass 'int' instead to avoid
the problem.

Fixes: 8ce76bff0e6a ("staging: ks7010: add new helpers to achieve
mib set request and simplify code")

Reported-by: Dan Carpenter 
Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/ks7010/ks_hostif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 0ecffab..6582566 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1228,7 +1228,7 @@ static inline void hostif_mib_set_request_int(struct 
ks_wlan_private *priv,
 
 static inline void hostif_mib_set_request_bool(struct ks_wlan_private *priv,
   enum mib_attribute attr,
-  bool val)
+  int val)
 {
__le32 v = cpu_to_le32(val);
size_t size = sizeof(v);
-- 
2.7.4

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


Re: [PATCH 1/2] staging: goldfish: fix whitespace in goldfish_audio

2018-07-11 Thread Greg KH


A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Wed, Jul 11, 2018 at 04:39:37PM -0700, Roman Kiryanov wrote:
> Thank you for looking. I separated the new line change into a separate patch.

I have no idea what you are referring to here.  Please properly quote
emails so that people have a chance.

thanks,

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


Re: [PATCH] staging: rtl8188eu: break line longer than 80 cols

2018-07-11 Thread Greg Kroah-Hartman
On Wed, Jul 11, 2018 at 09:24:09PM +0200, Kacper Kołodziej wrote:
> Signed-off-by: Kacper Kołodziej 

Sorry, but I need a changelog text in order to be able to take a patch.

thanks,

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