Re: [PATCH RESEND 0/7] Introduce MEDIA_VERSION to end KENREL_VERSION abuse in media

2017-06-30 Thread Johannes Thumshirn
On Thu, Jun 29, 2017 at 10:01:05AM -0700, Stephen Hemminger wrote:
> If you read Linus's comments on version.
> Driver version is meaningless and there is a desire to rip it out of all
> drivers. The reason is that drivers must always behave the same, i.e you
> can't use version to change API/ABI behavior. 

Indeed this causes more harm than good. We had support calls regarding the
mlx4 driver because of not incremented MODLE_VERSION()s. If we follow your
and Linus' path we shouldn't just get rid of the KERNEL_VERSION() usage
in media and replace it with a new version, but kill all the versioning
stuff out of media (and others) except for maybe the HW version.

> Any upstream driver should never use KERNEL_VERSION().

Exactly my reasoning.

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


RE: [PATCH] staging: fsl-dpaa2/eth: Remove dead code

2017-06-30 Thread Bogdan Purcareata
> -Original Message-
> From: Ioana Radulescu [mailto:ruxandra.radule...@nxp.com]
> Sent: Thursday, June 29, 2017 7:26 PM
> To: gre...@linuxfoundation.org
> Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org;
> ag...@suse.de; a...@arndb.de; linux-arm-ker...@lists.infradead.org; Bogdan
> Purcareata ; stuyo...@gmail.com; Laurentiu Tudor
> 
> Subject: [PATCH] staging: fsl-dpaa2/eth: Remove dead code
> 
> All possible values of the switch statement are explicitly
> handled, so there's no need to have a default branch.
> 
> Signed-off-by: Ioana Radulescu 

Acked-by: Bogdan Purcareata 

> ---
>  drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
> b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
> index 5312edc26f01..031179ab3a22 100644
> --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
> +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
> @@ -217,8 +217,6 @@ static void dpaa2_eth_get_ethtool_stats(struct
> net_device *net_dev,
>   case 2:
>   num_cnt = sizeof(dpni_stats.page_2) / sizeof(u64);
>   break;
> - default:
> - break;
>   }
>   for (k = 0; k < num_cnt; k++)
>   *(data + i++) = dpni_stats.raw.counter[k];
> --
> 2.11.0

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


[PATCH] staging: wilc1000: fix a typo: "incative" -> "inactive"

2017-06-30 Thread Colin King
From: Colin Ian King 

Trivial fix to typos in netdev_err error messages. I should have spotted
this in a previous round of spelling mistake checks on this driver but
this one slipped through.

Signed-off-by: Colin Ian King 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index f7c22d7b28d1..a3cdade02c93 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1963,7 +1963,7 @@ static s32 Handle_Get_InActiveTime(struct wilc_vif *vif,
  wilc_get_vif_idx(vif));
 
if (result) {
-   netdev_err(vif->ndev, "Failed to SET incative time\n");
+   netdev_err(vif->ndev, "Failed to SET inactive time\n");
return -EFAULT;
}
 
@@ -1976,7 +1976,7 @@ static s32 Handle_Get_InActiveTime(struct wilc_vif *vif,
  wilc_get_vif_idx(vif));
 
if (result) {
-   netdev_err(vif->ndev, "Failed to get incative time\n");
+   netdev_err(vif->ndev, "Failed to get inactive time\n");
return -EFAULT;
}
 
-- 
2.11.0

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


[PATCH] staging: comedi: ni_mio_common: fix AO timer off-by-one regression

2017-06-30 Thread Ian Abbott
As reported by Éric Piel on the Comedi mailing list (see
),
the analog output asynchronous commands are running too fast with a
period 50 ns shorter than it should be.  This affects all boards with AO
command support that are supported by the "ni_pcimio", "ni_atmio", and
"ni_mio_cs" drivers.

This is a regression bug introduced by commit 080e6795cba3 ("staging:
comedi: ni_mio_common: Cleans up/clarifies ni_ao_cmd"), specifically,
this line in `ni_ao_cmd_set_update()`:

/* following line: N-1 per STC */
ni_stc_writel(dev, trigvar - 1, NISTC_AO_UI_LOADA_REG);

The `trigvar` variable value comes from a call to `ni_ns_to_timer()`
which converts a timer period in nanoseconds to a hardware divisor
value. The function already reduces the divisor by 1 as required by the
hardware, so the above line should not reduce it further by 1.  Fix it
by replacing `trigvar` by `trigvar - 1` in the above line, and remove
the misleading comment.

Reported-by: Éric Piel 
Fixes: 080e6795cba3 ("staging: comedi: ni_mio_common: Cleans up/clarifies 
ni_ao_cmd")
Cc: Éric Piel 
Cc: Spencer E. Olson 
Cc:  # 4.7+
Signed-off-by: Ian Abbott 
---
The bug is also in 4.6.x, but this patch does not apply to it cleanly.
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index b2e382888981..2f7bfc1c59e5 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -3116,8 +3116,7 @@ static void ni_ao_cmd_set_update(struct comedi_device 
*dev,
/* following line: 2-1 per STC */
ni_stc_writel(dev, 1, NISTC_AO_UI_LOADA_REG);
ni_stc_writew(dev, NISTC_AO_CMD1_UI_LOAD, NISTC_AO_CMD1_REG);
-   /* following line: N-1 per STC */
-   ni_stc_writel(dev, trigvar - 1, NISTC_AO_UI_LOADA_REG);
+   ni_stc_writel(dev, trigvar, NISTC_AO_UI_LOADA_REG);
} else { /* TRIG_EXT */
/* FIXME:  assert scan_begin_arg != 0, ret failure otherwise */
devpriv->ao_cmd2  |= NISTC_AO_CMD2_BC_GATE_ENA;
-- 
2.11.0

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


Re: [PATCH 0/6] staging: iio: tsl2x7x: staging cleanups

2017-06-30 Thread Brian Masney
On Thu, Jun 29, 2017 at 01:03:46PM -0400, Brian Masney wrote:
> This begins my work to clean this driver up and eventually move it out
> of staging. Driver changes were tested using a TSL2771 hooked up to a
> Raspberry Pi 2.
> 
> Thanks to Jon Brenner at AMS/TAOS for loaning me some hardware samples
> to test my driver changes.
> 
> Brian Masney (6):
>   staging: iio: tsl2x7x: add of_match table for device tree support
>   staging: iio: tsl2x7x: remove redundant power_state sysfs attribute
>   staging: iio: tsl2x7x: remove tsl2x7x_i2c_read()
>   staging: iio: tsl2x7x: cleaned up i2c calls in tsl2x7x_als_calibrate()
>   staging: iio: tsl2x7x: refactor {read,write}_event_value to allow
> handling multiple iio_event_infos
>   staging: iio: tsl2x7x: use usleep_range() instead of mdelay()
> 
>  .../devicetree/bindings/trivial-devices.txt|  10 +
>  drivers/staging/iio/light/tsl2x7x.c| 316 
> ++---
>  2 files changed, 153 insertions(+), 173 deletions(-)

Hi Jonathon,

Hold off on applying this series. There are several other formatting
warnings from checkpatch with this series that I need to fix. Sorry
about the noise. I'd appreciate it if you could at least look at the
functionality of my changes and I'll resubmit next week.

I held back several other changes related to the event subsystem until
I'm able to properly test my changes. I'm having trouble getting the
interrupts to work. I wired the interrupt pin on the sensor to GPIO
pin 17 on my Raspberry Pi 2 and added the following section to
arch/arm/boot/dts/bcm2836-rpi-2-b.dts for my sensor:

&i2c1 {
tsl2771@29 {
compatible = "amstaos,tsl2771";
reg = <0x39>;
interrupt-parent = <&gpio>;
interrupts = <17 2>;
};
};

I start up iio_event_monitor, and run these commands:

echo 1 > events/in_intensity0_thresh_rising_en
echo 256 > events/in_intensity0_thresh_rising_value

When I shine a light on the ALS sensor, and the reading goes above
256, I do not get any events back from iio_event_monitor.

I'm honestly not sure about the 2 in the 'interrupts = <17 2>;' line.
I looked at how interrupts were setup in device tree overlays in the
official Raspberry Pi kernel and tried several variations from there.
I have more reading to do. :)

Thanks,

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


RE: [PATCH 0/6] staging: iio: tsl2x7x: staging cleanups

2017-06-30 Thread Jon Brenner
Hi Brian,
Not sure about the DTS interrupt setting you mentioned but would like to know 
how you resolve - as I am planning on getting a Pi0w for some 'home personal 
projects'.

Anyway (and I am sure you probably already know this - but just in case) WRT 
the device registers (on the TSL2771 for example);
If you enable interrupts (ie. Reg#0x00= 0x37) and set the persistence register 
to 0x00 (is. Reg# 0x0C = 0x00), you should see interrupts occurring every 
integration period.
That way you can see if you're at least getting them.

You probably know this too - on earlier parts such as these, interrupts were 
cleared via use of the "command register" special function bits.  (see data 
sheets for details).
Now a day - interrupts are cleared in a more conventional manner 

Jon

-Original Message-
From: Brian Masney [mailto:masn...@onstation.org] 
Sent: Friday, June 30, 2017 10:21 AM
To: ji...@kernel.org; linux-...@vger.kernel.org
Cc: de...@driverdev.osuosl.org; l...@metafoo.de; gre...@linuxfoundation.org; 
linux-ker...@vger.kernel.org; Jon Brenner ; 
pme...@pmeerw.net; knaac...@gmx.de
Subject: Re: [PATCH 0/6] staging: iio: tsl2x7x: staging cleanups

On Thu, Jun 29, 2017 at 01:03:46PM -0400, Brian Masney wrote:
> This begins my work to clean this driver up and eventually move it out 
> of staging. Driver changes were tested using a TSL2771 hooked up to a 
> Raspberry Pi 2.
> 
> Thanks to Jon Brenner at AMS/TAOS for loaning me some hardware samples 
> to test my driver changes.
> 
> Brian Masney (6):
>   staging: iio: tsl2x7x: add of_match table for device tree support
>   staging: iio: tsl2x7x: remove redundant power_state sysfs attribute
>   staging: iio: tsl2x7x: remove tsl2x7x_i2c_read()
>   staging: iio: tsl2x7x: cleaned up i2c calls in tsl2x7x_als_calibrate()
>   staging: iio: tsl2x7x: refactor {read,write}_event_value to allow
> handling multiple iio_event_infos
>   staging: iio: tsl2x7x: use usleep_range() instead of mdelay()
> 
>  .../devicetree/bindings/trivial-devices.txt|  10 +
>  drivers/staging/iio/light/tsl2x7x.c| 316 
> ++---
>  2 files changed, 153 insertions(+), 173 deletions(-)

Hi Jonathon,

Hold off on applying this series. There are several other formatting warnings 
from checkpatch with this series that I need to fix. Sorry about the noise. I'd 
appreciate it if you could at least look at the functionality of my changes and 
I'll resubmit next week.

I held back several other changes related to the event subsystem until I'm able 
to properly test my changes. I'm having trouble getting the interrupts to work. 
I wired the interrupt pin on the sensor to GPIO pin 17 on my Raspberry Pi 2 and 
added the following section to arch/arm/boot/dts/bcm2836-rpi-2-b.dts for my 
sensor:

&i2c1 {
tsl2771@29 {
compatible = "amstaos,tsl2771";
reg = <0x39>;
interrupt-parent = <&gpio>;
interrupts = <17 2>;
};
};

I start up iio_event_monitor, and run these commands:

echo 1 > events/in_intensity0_thresh_rising_en
echo 256 > events/in_intensity0_thresh_rising_value

When I shine a light on the ALS sensor, and the reading goes above 256, I do 
not get any events back from iio_event_monitor.

I'm honestly not sure about the 2 in the 'interrupts = <17 2>;' line.
I looked at how interrupts were setup in device tree overlays in the official 
Raspberry Pi kernel and tried several variations from there.
I have more reading to do. :)

Thanks,

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


[PATCH] staging: android: ion: statify __ion_add_cma_heaps

2017-06-30 Thread Kamal Heib
Fix the following sparse warning:
symbol '__ion_add_cma_heaps' was not declared. Should it be static?

Cc: Greg Kroah-Hartman 
Signed-off-by: Kamal Heib 
---
 drivers/staging/android/ion/ion_cma_heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_cma_heap.c 
b/drivers/staging/android/ion/ion_cma_heap.c
index a0949bc0dcf4..c6db9b726002 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -106,7 +106,7 @@ static struct ion_heap *__ion_cma_heap_create(struct cma 
*cma)
return &cma_heap->heap;
 }
 
-int __ion_add_cma_heaps(struct cma *cma, void *data)
+static int __ion_add_cma_heaps(struct cma *cma, void *data)
 {
struct ion_heap *heap;
 
-- 
2.9.4

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


Re: [PATCH] staging: ks7010: fix styling WARNINGs

2017-06-30 Thread Mark Rogers
Thank you for your feedback. I guess when making this patch I had the
preferred coding style in mind, but didn't ask myself if making the code
conform to it would truly improve readability.

I agree with all of your comments. Do you think the best course of
action is to create a new patch with this change alone and forget the
rest?

-   DPRINTK(1, "ks7010_sdio_remove()\n");
+   DPRINTK(1, "%s()\n", __func__);

Sorry about the newbie questions and bad patch, I will do better with
the next one. Thanks again for your time and feedback, I really
appreciate it.

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


[PATCH 00/25] staging: unisys: Update comments and clean up whitespace

2017-06-30 Thread David Kershner
This patch series concentrates on cleaning-up comments and whitespace issues
so that the code can be better examined. This series also fixes a couple
checkpatch warnings.

David Binder (8):
  staging: unisys: include: Fix spelling mistake
  staging: unisys: visorbus: Remove unused #define
  staging: unisys: visorbus: Rename #define to fit surrounding namespace
  staging: unisys: visorhba: Fix up existing function comments
  staging: unisys: include: channel.h: Adjust whitespace usage
  staging: unisys: include: iochannel.h: Adjust whitespace usage
  staging: unisys: include: visorbus.h: Adjust whitespace usage
  staging: unisys: visorbus: controlvmchannel.h: Adjust whitespace usage

David Kershner (1):
  staging: unisys: include: remove unused macros in channel.h

Erik Arfvidson (1):
  staging: unisys: visorbus: fix improper bracket blocks

Sameer Wadgaonkar (12):
  staging: unisys: visorbus: controlvmchannel.h: fixed comment formatting issues
  staging: unisys: visorbus: vbuschannel.h: fixed comment formatting issues
  staging: unisys: visorbus: vmcallinterface.h: fixed comment formatting issues
  staging: unisys: visorbus: visorbus_main.c: fixed comment formatting issues
  staging: unisys: visorbus: visorchannel.c: fixed comment formatting issues
  staging: unisys: visorbus: visorchipset.c: fixed comment formatting issues
  staging: unisys: include: channel.h: fixed comment formatting issues
  staging: unisys: include: iochannel.h: fixed comment formatting issues
  staging: unisys: visornic: visornic_main.c: fixed comment formatting issues
  staging: unisys: visorhba: visorhba_main.c: fixed comment formatting issues
  staging: unisys: visorinput: visorinput.c: fixed comment formatting issues
  staging: unisys: visorinput: ultrainputreport.h: fixed comment formatting 
issues

Steve Wilson (1):
  staging: unisys: visorbus: adjust tabs in function

Zachary Dremann (2):
  staging: unisys: visorbus: Indent struct assignment correctly
  staging: unisys: visorbus: use __func__ over hardcoded name

 drivers/staging/unisys/include/channel.h | 291 ++---
 drivers/staging/unisys/include/iochannel.h   | 505 +
 drivers/staging/unisys/include/visorbus.h|   2 +-
 drivers/staging/unisys/visorbus/controlvmchannel.h   | 689 +++-
 drivers/staging/unisys/visorbus/vbuschannel.h|  91 +-
 drivers/staging/unisys/visorbus/visorbus_main.c  | 102 +-
 drivers/staging/unisys/visorbus/visorchannel.c   |  28 +-
 drivers/staging/unisys/visorbus/visorchipset.c   |  18 +-
 drivers/staging/unisys/visorbus/vmcallinterface.h|  56 +-
 drivers/staging/unisys/visorhba/visorhba_main.c  | 358 +++---
 drivers/staging/unisys/visorinput/ultrainputreport.h |  65 +-
 drivers/staging/unisys/visorinput/visorinput.c   |  20 +-
 drivers/staging/unisys/visornic/visornic_main.c  |  98 +-
 13 files changed, 1311 insertions(+), 1012 deletions(-)

base-commit: 9b326dfce12afb429915c63f5a3df4afa4bea957
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/25] staging: unisys: visorbus: vbuschannel.h: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Added kernel-doc like comments and cleaned up the inline comments in the
structures.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/vbuschannel.h | 91 
 1 file changed, 58 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h 
b/drivers/staging/unisys/visorbus/vbuschannel.h
index 01d7d51..56114f5 100644
--- a/drivers/staging/unisys/visorbus/vbuschannel.h
+++ b/drivers/staging/unisys/visorbus/vbuschannel.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2010 - 2015 UNISYS CORPORATION
+/*
+ * Copyright (C) 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -15,13 +16,15 @@
 #ifndef __VBUSCHANNEL_H__
 #define __VBUSCHANNEL_H__
 
-/*  The vbus channel is the channel area provided via the BUS_CREATE controlvm
- *  message for each virtual bus.  This channel area is provided to both server
- *  and client ends of the bus.  The channel header area is initialized by
- *  the server, and the remaining information is filled in by the client.
- *  We currently use this for the client to provide various information about
- *  the client devices and client drivers for the server end to see.
+/*
+ * The vbus channel is the channel area provided via the BUS_CREATE controlvm
+ * message for each virtual bus.  This channel area is provided to both server
+ * and client ends of the bus.  The channel header area is initialized by
+ * the server, and the remaining information is filled in by the client.
+ * We currently use this for the client to provide various information about
+ * the client devices and client drivers for the server end to see.
  */
+
 #include 
 #include 
 #include "channel.h"
@@ -30,11 +33,11 @@
 #define VISOR_VBUS_CHANNEL_UUID \
UUID_LE(0x193b331b, 0xc58f, 0x11da, \
0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)
-static const uuid_le visor_vbus_channel_uuid = VISOR_VBUS_CHANNEL_UUID;
 
 #define VISOR_VBUS_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
 
-/* Must increment this whenever you insert or delete fields within this channel
+/*
+ * Must increment this whenever you insert or delete fields within this channel
  * struct.  Also increment whenever you change the meaning of fields within 
this
  * channel struct so as to break pre-existing software.  Note that you can
  * usually add fields to the END of the channel struct withOUT needing to
@@ -42,43 +45,65 @@ static const uuid_le visor_vbus_channel_uuid = 
VISOR_VBUS_CHANNEL_UUID;
  */
 #define VISOR_VBUS_CHANNEL_VERSIONID 1
 
-/*
+static const uuid_le visor_vbus_channel_uuid = VISOR_VBUS_CHANNEL_UUID;
+
+/* struct visor_vbus_deviceinfo
+ * @devtype:  Short string identifying the device type.
+ * @drvname:  Driver .sys file name.
+ * @infostrs: Kernel vversion.
+ * @reserved: Pad size to 256 bytes.
+ *
  * An array of this struct is present in the channel area for each vbus.
- * (See vbuschannel.h.)
- * It is filled in by the client side to provide info about the device
- * and driver from the client's perspective.
+ * (See vbuschannel.h.). It is filled in by the client side to provide info
+ * about the device and driver from the client's perspective.
  */
 struct visor_vbus_deviceinfo {
-   u8 devtype[16]; /* short string identifying the device type */
-   u8 drvname[16]; /* driver .sys file name */
-   u8 infostrs[96];/* kernel version */
-   u8 reserved[128];   /* pad size to 256 bytes */
+   u8 devtype[16];
+   u8 drvname[16];
+   u8 infostrs[96];
+   u8 reserved[128];
 } __packed;
 
+/*
+ * struct visor_vbus_headerinfo
+ * @struct_bytes:Size of this struct in bytes.
+ * @device_info_struct_bytes: Size of VISOR_VBUS_DEVICEINFO.
+ * @dev_info_count:  Num of items in DevInfo member. This is the
+ *   allocated size.
+ * @chp_info_offset: Byte offset from beginning of this struct to the
+ *   ChpInfo struct.
+ * @bus_info_offset: Byte offset from beginning of this struct to the
+ *   BusInfo struct.
+ * @dev_info_offset: Byte offset from beginning of this struct to the
+ *   DevInfo array.
+ * @reserved:Natural Alignment
+ */
 struct visor_vbus_headerinfo {
-   u32 struct_bytes;   /* size of this struct in bytes */
-   u32 device_info_struct_bytes;   /* sizeof(VISOR_VBUS_DEVICEINFO) */
-   u32 dev_info_count; /* num of items in DevInfo member */
-   /* (this is the allocated size) */
-   u32 chp_info_offset;/* byte offset from beginning of this struct */
-   /* to the ChpInfo struct (below) */
-   u32 bus_info_offset;/* byte offset from beginning of this struct */
-   /* to the BusInfo struct (below) */
-   

[PATCH 04/25] staging: unisys: visorbus: visorbus_main.c: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 40 ++
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1c785dd..e271de6 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1,4 +1,5 @@
-/* visorbus_main.c
+/*
+ * visorbus_main.c
  *
  * Copyright � 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
@@ -22,13 +23,14 @@
 
 #define MYDRVNAME "visorbus"
 
-/* Display string that is guaranteed to be no longer the 99 characters*/
+/* Display string that is guaranteed to be no longer the 99 characters */
 #define LINESIZE 99
 
 #define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c
 #define POLLJIFFIES_NORMALCHANNEL 10
 
-static bool initialized; /* stores whether bus_registration was successful */
+/* stores whether bus_registration was successful */
+static bool initialized;
 static struct dentry *visorbus_debugfs_dir;
 
 /*
@@ -122,7 +124,7 @@ visorbus_match(struct device *xdev, struct device_driver 
*xdrv)
 
 /*
  * This describes the TYPE of bus.
- *  (Don't confuse this with an INSTANCE of the bus.)
+ * (Don't confuse this with an INSTANCE of the bus.)
  */
 struct bus_type visorbus_type = {
.name = "visorbus",
@@ -369,8 +371,9 @@ static void
 vbuschannel_print_devinfo(struct visor_vbus_deviceinfo *devinfo,
  struct seq_file *seq, int devix)
 {
+   /* uninitialized vbus device entry */
if (!isprint(devinfo->devtype[0]))
-   return; /* uninitialized vbus device entry */
+   return;
 
if (devix >= 0)
seq_printf(seq, "[%d]", devix);
@@ -503,7 +506,7 @@ visordriver_remove_device(struct device *xdev)
return 0;
 }
 
-/**
+/*
  * visorbus_unregister_visor_driver() - unregisters the provided driver
  * @drv: the driver to unregister
  *
@@ -517,7 +520,7 @@ visorbus_unregister_visor_driver(struct visor_driver *drv)
 }
 EXPORT_SYMBOL_GPL(visorbus_unregister_visor_driver);
 
-/**
+/*
  * visorbus_read_channel() - reads from the designated channel into
  *   the provided buffer
  * @dev:the device whose channel is read from
@@ -538,7 +541,7 @@ visorbus_read_channel(struct visor_device *dev, unsigned 
long offset,
 }
 EXPORT_SYMBOL_GPL(visorbus_read_channel);
 
-/**
+/*
  * visorbus_write_channel() - writes the provided buffer into the designated
  *channel
  * @dev:the device whose channel is written to
@@ -559,7 +562,7 @@ visorbus_write_channel(struct visor_device *dev, unsigned 
long offset,
 }
 EXPORT_SYMBOL_GPL(visorbus_write_channel);
 
-/**
+/*
  * visorbus_enable_channel_interrupts() - enables interrupts on the
  *designated device
  * @dev: the device on which to enable interrupts
@@ -581,7 +584,7 @@ visorbus_enable_channel_interrupts(struct visor_device *dev)
 }
 EXPORT_SYMBOL_GPL(visorbus_enable_channel_interrupts);
 
-/**
+/*
  * visorbus_disable_channel_interrupts() - disables interrupts on the
  * designated device
  * @dev: the device on which to disable interrupts
@@ -664,7 +667,8 @@ create_visor_device(struct visor_device *dev)
goto err_put;
 
list_add_tail(&dev->list_all, &list_all_device_instances);
-   return 0; /* success: reference kept via unmatched get_device() */
+   /* success: reference kept via unmatched get_device() */
+   return 0;
 
 err_put:
put_device(&dev->device);
@@ -901,7 +905,7 @@ visordriver_probe_device(struct device *xdev)
return res;
 }
 
-/**
+/*
  * visorbus_register_visor_driver() - registers the provided visor driver
  *for handling one or more visor device
  *types (channel_types)
@@ -952,8 +956,9 @@ visordriver_probe_device(struct device *xdev)
  */
 int visorbus_register_visor_driver(struct visor_driver *drv)
 {
+   /* can't register on a nonexistent bus */
if (!initialized)
-   return -ENODEV; /* can't register on a nonexistent bus */
+   return -ENODEV;
 
drv->driver.name = drv->name;
drv->driver.bus = &visorbus_type;
@@ -1195,8 +1200,9 @@ visorchipset_initiate_device_pause_resume(struct 
visor_device *dev,
dev->pausing = true;
err = drv->pause(dev, pause_state_change_complete);
} else {
-   /* The vbus_dev_info structure in the channel was been
-* cleared, make sure it is valid.
+   /*
+* The vbus_dev_info structure in the channel was been cleared,
+* make sure it is valid.
 */

[PATCH 03/25] staging: unisys: visorbus: vmcallinterface.h: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Added kernel-doc like comments and cleaned up the inline comments in the
structures.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/vmcallinterface.h | 56 +---
 1 file changed, 33 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/vmcallinterface.h 
b/drivers/staging/unisys/visorbus/vmcallinterface.h
index cc70e1b..de6693f 100644
--- a/drivers/staging/unisys/visorbus/vmcallinterface.h
+++ b/drivers/staging/unisys/visorbus/vmcallinterface.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2010 - 2015 UNISYS CORPORATION
+/*
+ * Copyright (C) 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -15,18 +16,20 @@
 #ifndef __VMCALLINTERFACE_H__
 #define __VMCALLINTERFACE_H__
 
-enum vmcall_monitor_interface_method_tuple { /* VMCALL identification tuples  
*/
-   /* Note: when a new VMCALL is added:
-* - the 1st 2 hex digits correspond to one of the
-*   VMCALL_MONITOR_INTERFACE types and
-* - the next 2 hex digits are the nth relative instance of within a
-*   type
-* E.G. for VMCALL_VIRTPART_RECYCLE_PART,
-* - the 0x02 identifies it as a VMCALL_VIRTPART type and
-* - the 0x01 identifies it as the 1st instance of a VMCALL_VIRTPART
-*   type of VMCALL
-*/
-   /* used by all Guests, not just IO */
+/*
+ * enum vmcall_monitor_interface_method_tuple - VMCALL identification tuples.
+ * @VMCALL_CONTROLVM_ADDR: Used by all guests, not just IO.
+ *
+ * Note: When a new VMCALL is added:
+ * - The 1st 2 hex digits correspond to one of the VMCALL_MONITOR_INTERFACE
+ *   types.
+ * - The next 2 hex digits are the nth relative instance of within a type.
+ * E.G. for VMCALL_VIRTPART_RECYCLE_PART,
+ * - The 0x02 identifies it as a VMCALL_VIRTPART type.
+ * - The 0x01 identifies it as the 1st instance of a VMCALL_VIRTPART type of
+ *   VMCALL.
+ */
+enum vmcall_monitor_interface_method_tuple {
VMCALL_CONTROLVM_ADDR = 0x0501,
 };
 
@@ -39,16 +42,23 @@ enum vmcall_result {
VMCALL_RESULT_DEVICE_NOT_READY = 5
 };
 
-/* Structures for IO VMCALLs */
-/* Parameters to VMCALL_CONTROLVM_ADDR interface */
+/*
+ * struct vmcall_io_controlvm_addr_params - Structure for IO VMCALLS. Has
+ * parameters to VMCALL_CONTROLVM_ADDR
+ * interface.
+ * @address:  The Guest-relative physical address of the ControlVm channel.
+ *This VMCall fills this in with the appropriate address.
+ *Contents provided by this VMCALL (OUT).
+ * @channel_bytes: The size of the ControlVm channel in bytes This VMCall fills
+ *this in with the appropriate address. Contents provided by
+ *this VMCALL (OUT).
+ * @unused:   Unused Bytes in the 64-Bit Aligned Struct.
+ */
 struct vmcall_io_controlvm_addr_params {
-   /* The Guest-relative physical address of the ControlVm channel. */
-   /* This VMCall fills this in with the appropriate address. */
-   u64 address;/* contents provided by this VMCALL (OUT) */
-   /* the size of the ControlVm channel in bytes This VMCall fills this */
-   /* in with the appropriate address. */
-   u32 channel_bytes;  /* contents provided by this VMCALL (OUT) */
-   u8 unused[4];   /* Unused Bytes in the 64-Bit Aligned Struct */
+   u64 address;
+   u32 channel_bytes;
+   u8 unused[4];
 } __packed;
 
-#endif /* __VMCALLINTERFACE_H__ */
+/* __VMCALLINTERFACE_H__ */
+#endif
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/25] staging: unisys: include: remove unused macros in channel.h

2017-06-30 Thread David Kershner
Several MACROS were not in use by the code, get rid of them.

Signed-off-by: David Kershner 
---
 drivers/staging/unisys/include/channel.h | 21 -
 1 file changed, 21 deletions(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index 692efcb..7f7542c 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -59,27 +59,6 @@ enum channel_clientstate {
/* access channel anytime */
 };
 
-#define VISOR_CHANNEL_SERVER_READY(ch) \
-   (readl(&(ch)->srv_state) == CHANNELSRV_READY)
-
-#define VISOR_VALID_CHANNELCLI_TRANSITION(o, n) \
-   (o) == CHANNELCLI_DETACHED) && ((n) == CHANNELCLI_DISABLED)) || \
- (((o) == CHANNELCLI_ATTACHING) && ((n) == CHANNELCLI_DISABLED)) || \
- (((o) == CHANNELCLI_ATTACHED) && ((n) == CHANNELCLI_DISABLED)) || \
- (((o) == CHANNELCLI_ATTACHING) && ((n) == CHANNELCLI_DETACHED)) || \
- (((o) == CHANNELCLI_ATTACHED) && ((n) == CHANNELCLI_DETACHED)) || \
- (((o) == CHANNELCLI_DETACHED) && ((n) == CHANNELCLI_ATTACHING)) || \
- (((o) == CHANNELCLI_ATTACHING) && ((n) == CHANNELCLI_ATTACHED)) || \
- (((o) == CHANNELCLI_DETACHED) && ((n) == CHANNELCLI_ATTACHED)) || \
- (((o) == CHANNELCLI_BUSY) && ((n) == CHANNELCLI_ATTACHED)) || \
- (((o) == CHANNELCLI_ATTACHED) && ((n) == CHANNELCLI_BUSY)) || \
- (((o) == CHANNELCLI_DETACHED) && ((n) == CHANNELCLI_OWNED)) || \
- (((o) == CHANNELCLI_DISABLED) && ((n) == CHANNELCLI_OWNED)) || \
- (((o) == CHANNELCLI_ATTACHING) && ((n) == CHANNELCLI_OWNED)) || \
- (((o) == CHANNELCLI_ATTACHED) && ((n) == CHANNELCLI_OWNED)) || \
- (((o) == CHANNELCLI_BUSY) && ((n) == CHANNELCLI_OWNED)) || (0)) \
-? (1) : (0))
-
 /* Values for VISORA_CHANNEL_PROTOCOL.CliErrorBoot: */
 /* throttling invalid boot channel statetransition error due to client
  * disabled
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/25] staging: unisys: visorbus: controlvmchannel.h: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of lines and fixed spacing in
comments.

Added kernel-doc like comments and cleaned up the inline comments in the
structures.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/controlvmchannel.h | 688 --
 1 file changed, 414 insertions(+), 274 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h 
b/drivers/staging/unisys/visorbus/controlvmchannel.h
index ed045ef..5c67baf 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2010 - 2015 UNISYS CORPORATION
+/*
+ * Copyright (C) 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -26,11 +27,12 @@
 #define VISOR_CONTROLVM_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
 #define CONTROLVM_MESSAGE_MAX 64
 
-/* Must increment this whenever you insert or delete fields within
- * this channel struct.  Also increment whenever you change the meaning
- * of fields within this channel struct so as to break pre-existing
- * software.  Note that you can usually add fields to the END of the
- * channel struct withOUT needing to increment this.
+/*
+ * Must increment this whenever you insert or delete fields within this channel
+ * struct.  Also increment whenever you change the meaning of fields within 
this
+ * channel struct so as to break pre-existing software. Note that you can
+ * usually add fields to the END of the channel struct withOUT needing to
+ * increment this.
  */
 #define VISOR_CONTROLVM_CHANNEL_VERSIONID 1
 
@@ -51,28 +53,31 @@
 /* Max num of messages stored during IOVM creation to be reused after crash */
 #define CONTROLVM_CRASHMSG_MAX 2
 
+/*
+ * struct visor_segment_state
+ * @enabled:   May enter other states.
+ * @active:Assigned to active partition.
+ * @alive: Configure message sent to service/server.
+ * @revoked:   Similar to partition state ShuttingDown.
+ * @allocated: Memory (device/port number) has been selected by Command.
+ * @known: Has been introduced to the service/guest partition.
+ * @ready: Service/Guest partition has responded to introduction.
+ * @operating: Resource is configured and operating.
+ * @reserved:  Natural alignment.
+ *
+ * Note: Don't use high bit unless we need to switch to ushort which is
+ * non-compliant.
+ */
 struct visor_segment_state  {
-   /* Bit 0: May enter other states */
u16 enabled:1;
-   /* Bit 1: Assigned to active partition */
u16 active:1;
-   /* Bit 2: Configure message sent to service/server */
u16 alive:1;
-   /* Bit 3: similar to partition state ShuttingDown */
u16 revoked:1;
-   /* Bit 4: memory (device/port number) has been selected by Command */
u16 allocated:1;
-   /* Bit 5: has been introduced to the service/guest partition */
u16 known:1;
-   /* Bit 6: service/Guest partition has responded to introduction */
u16 ready:1;
-   /* Bit 7: resource is configured and operating */
u16 operating:1;
-   /* Natural alignment*/
u16 reserved:8;
-/* Note: don't use high bit unless we need to switch to ushort
- * which is non-compliant
- */
 } __packed;
 
 static const struct visor_segment_state segment_state_running = {
@@ -87,74 +92,101 @@ static const struct visor_segment_state 
segment_state_standby = {
1, 1, 0, 0, 1, 1, 1, 0
 };
 
-/* Ids for commands that may appear in either queue of a ControlVm channel.
+/*
+ * enum controlvm_id
+ * @CONTROLVM_INVALID:
+ * @CONTROLVM_BUS_CREATE:  CP --> SP, GP.
+ * @CONTROLVM_BUS_DESTROY: CP --> SP, GP.
+ * @CONTROLVM_BUS_CONFIGURE:   CP --> SP.
+ * @CONTROLVM_BUS_CHANGESTATE: CP --> SP, GP.
+ * @CONTROLVM_BUS_CHANGESTATE_EVENT:   SP, GP --> CP.
+ * @CONTROLVM_DEVICE_CREATE:   CP --> SP, GP.
+ * @CONTROLVM_DEVICE_DESTROY:  CP --> SP, GP.
+ * @CONTROLVM_DEVICE_CONFIGURE:CP --> SP.
+ * @CONTROLVM_DEVICE_CHANGESTATE:  CP --> SP, GP.
+ * @CONTROLVM_DEVICE_CHANGESTATE_EVENT:SP, GP --> CP.
+ * @CONTROLVM_DEVICE_RECONFIGURE:  CP --> Boot.
+ * @CONTROLVM_CHIPSET_INIT:CP --> SP, GP.
+ * @CONTROLVM_CHIPSET_STOP:CP --> SP, GP.
+ * @CONTROLVM_CHIPSET_READY:   CP --> SP.
+ * @CONTROLVM_CHIPSET_SELFTEST:CP --> SP.
+ *
+ * Ids for commands that may appear in either queue of a ControlVm channel.
  *
- *  Commands that are initiated by the command partition (CP), by an IO or
- *  console service partition (SP), or by a guest partition (GP)are:
- *  - issued on the RequestQueue queue (q #0) in the ControlVm channel
- *  - responded to on the ResponseQueue queue (q #1) in the ControlVm channel
+ * Commands that are initiated by the command partition (CP), by an IO or
+ * console service p

[PATCH 08/25] staging: unisys: include: channel.h: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Added kernel-doc like comments and cleaned up the inline comments in the
structures.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/include/channel.h | 263 +---
 1 file changed, 150 insertions(+), 113 deletions(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index 7f7542c..8affc53 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
+/*
+ * Copyright (C) 2010 - 2013 UNISYS CORPORATION
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -34,52 +35,61 @@
 
 #define VISOR_CHANNEL_SIGNATURE SIGNATURE_32('E', 'C', 'N', 'L')
 
+/*
+ * enum channel_serverstate
+ * @CHANNELSRV_UNINITIALIZED: Channel is in an undefined state.
+ * @CHANNELSRV_READY:Channel has been initialized by server.
+ */
 enum channel_serverstate {
-   CHANNELSRV_UNINITIALIZED = 0,   /* channel is in an undefined state */
-   CHANNELSRV_READY = 1/* channel has been initialized by server */
+   CHANNELSRV_UNINITIALIZED = 0,
+   CHANNELSRV_READY = 1
 };
 
+/*
+ * enum channel_clientstate
+ * @CHANNELCLI_DETACHED:
+ * @CHANNELCLI_DISABLED:  Client can see channel but is NOT allowed to use it
+ *   unless given TBD* explicit request
+ *   (should actually be < DETACHED).
+ * @CHANNELCLI_ATTACHING: Legacy EFI client request for EFI server to attach.
+ * @CHANNELCLI_ATTACHED:  Idle, but client may want to use channel any time.
+ * @CHANNELCLI_BUSY: Client either wants to use or is using channel.
+ * @CHANNELCLI_OWNED:"No worries" state - client can access channel
+ *   anytime.
+ */
 enum channel_clientstate {
CHANNELCLI_DETACHED = 0,
-   CHANNELCLI_DISABLED = 1,/* client can see channel but is NOT
-* allowed to use it unless given TBD
-* explicit request (should actually be
-* < DETACHED)
-*/
-   CHANNELCLI_ATTACHING = 2,   /* legacy EFI client request
-* for EFI server to attach
-*/
-   CHANNELCLI_ATTACHED = 3,/* idle, but client may want
-* to use channel any time
-*/
-   CHANNELCLI_BUSY = 4,/* client either wants to use or is
-* using channel
-*/
-   CHANNELCLI_OWNED = 5/* "no worries" state - client can */
-   /* access channel anytime */
+   CHANNELCLI_DISABLED = 1,
+   CHANNELCLI_ATTACHING = 2,
+   CHANNELCLI_ATTACHED = 3,
+   CHANNELCLI_BUSY = 4,
+   CHANNELCLI_OWNED = 5
 };
 
 /* Values for VISORA_CHANNEL_PROTOCOL.CliErrorBoot: */
-/* throttling invalid boot channel statetransition error due to client
- * disabled
+
+/*
+ * Throttling invalid boot channel statetransition error due to client
+ * disabled.
  */
 #define VISOR_CLIERRORBOOT_THROTTLEMSG_DISABLED 0x01
 
-/* throttling invalid boot channel statetransition error due to client
- * not attached
+/*
+ * Throttling invalid boot channel statetransition error due to client
+ * not attached.
  */
 #define VISOR_CLIERRORBOOT_THROTTLEMSG_NOTATTACHED 0x02
 
-/* throttling invalid boot channel statetransition error due to busy channel */
+/* Throttling invalid boot channel statetransition error due to busy channel */
 #define VISOR_CLIERRORBOOT_THROTTLEMSG_BUSY 0x04
 
-/* Values for VISOR_CHANNEL_PROTOCOL.Features: This define exists so
- * that windows guest can look at the FeatureFlags in the io channel,
- * and configure the windows driver to use interrupts or not based on
- * this setting.  This flag is set in uislib after the
- * VISOR_VHBA_init_channel is called.  All feature bits for all
- * channels should be defined here.  The io channel feature bits are
- * defined right here
+/*
+ * Values for VISOR_CHANNEL_PROTOCOL.Features: This define exists so that
+ * windows guest can look at the FeatureFlags in the io channel, and configure
+ * the windows driver to use interrupts or not based on this setting.  This 
flag
+ * is set in uislib after the VISOR_VHBA_init_channel is called.  All feature
+ * bits for all channels should be defined here.  The io channel feature bits
+ * are defined right here
  */
 #define VISOR_DRIVER_ENABLES_INTS (0x1ULL << 1)
 #define VISOR_CHANNEL_IS_POLLING (0x1ULL << 3)
@@ -87,97 +97,121 @@ enum channel_clientstate {
 #define VISOR_DRIVER_DISABLES_INTS (0x1ULL << 5)
 #define VISOR_DRIVER_ENHANCED_RCVBUF_CHECKING (0x1ULL << 6)
 

[PATCH 06/25] staging: unisys: visorbus: visorchannel.c: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 22 +++
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 6885c2c..0f02509 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -41,11 +41,15 @@ struct visorchannel {
bool requested;
struct channel_header chan_hdr;
uuid_le guid;
-   bool needs_lock;/* channel creator knows if more than one */
-   /* thread will be inserting or removing */
-   spinlock_t insert_lock; /* protect head writes in chan_hdr */
-   spinlock_t remove_lock; /* protect tail writes in chan_hdr */
-
+   /*
+* channel creator knows if more than one
+* thread will be inserting or removing
+*/
+   bool needs_lock;
+   /* protect head writes in chan_hdr */
+   spinlock_t insert_lock;
+   /* protect tail writes in chan_hdr */
+   spinlock_t remove_lock;
uuid_le type;
uuid_le inst;
 };
@@ -246,9 +250,9 @@ signalremove_inner(struct visorchannel *channel, u32 queue, 
void *msg)
 
/*
 * For each data field in SIGNAL_QUEUE_HEADER that was modified,
-* update host memory.
+* update host memory. Required for channel sync.
 */
-   mb(); /* required for channel synch */
+   mb();
 
error = SIG_WRITE_FIELD(channel, queue, &sig_hdr, tail);
if (error)
@@ -351,9 +355,9 @@ signalinsert_inner(struct visorchannel *channel, u32 queue, 
void *msg)
 
/*
 * For each data field in SIGNAL_QUEUE_HEADER that was modified,
-* update host memory.
+* update host memory. Required for channel sync.
 */
-   mb(); /* required for channel synch */
+   mb();
 
err = SIG_WRITE_FIELD(channel, queue, &sig_hdr, head);
if (err)
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/25] staging: unisys: visorinput: ultrainputreport.h: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorinput/ultrainputreport.h | 65 +
 1 file changed, 28 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/unisys/visorinput/ultrainputreport.h 
b/drivers/staging/unisys/visorinput/ultrainputreport.h
index a4baea5..3ffad83 100644
--- a/drivers/staging/unisys/visorinput/ultrainputreport.h
+++ b/drivers/staging/unisys/visorinput/ultrainputreport.h
@@ -20,44 +20,35 @@
 /* These defines identify mouse and keyboard activity which is specified by the
  * firmware to the host using the cmsimpleinput protocol.  @ingroup coretypes
  */
-#define INPUTACTION_XY_MOTION 1/* only motion; arg1=x, arg2=y 
*/
-#define INPUTACTION_MOUSE_BUTTON_DOWN 2 /* arg1: 1=left,2=center,3=right */
-#define INPUTACTION_MOUSE_BUTTON_UP 3  /* arg1: 1=left,2=center,3=right */
-#define INPUTACTION_MOUSE_BUTTON_CLICK 4 /* arg1: 1=left,2=center,3=right */
-#define INPUTACTION_MOUSE_BUTTON_DCLICK 5 /* arg1: 1=left,2=center,
-  * 3=right
-  */
-#define INPUTACTION_WHEEL_ROTATE_AWAY 6  /* arg1: wheel rotation away from
- * user
- */
-#define INPUTACTION_WHEEL_ROTATE_TOWARD 7 /* arg1: wheel rotation toward
-  * user
-  */
-#define INPUTACTION_KEY_DOWN 64/* arg1: scancode, as follows:
-* If arg1 <= 0xff, it's a 1-byte
-* scancode and arg1 is that scancode.
-* If arg1 > 0xff, it's a 2-byte
-* scanecode, with the 1st byte in the
-* low 8 bits, and the 2nd byte in the
-* high 8 bits.  E.g., the right ALT key
-* would appear as x'38e0'.
-*/
-#define INPUTACTION_KEY_UP 65  /* arg1: scancode (in same format as
-* inputaction_keyDown)
-*/
+   /* only motion; arg1=x, arg2=y */
+#define INPUTACTION_XY_MOTION 1
+/* arg1: 1=left,2=center,3=right */
+#define INPUTACTION_MOUSE_BUTTON_DOWN 2
+/* arg1: 1=left,2=center,3=right */
+#define INPUTACTION_MOUSE_BUTTON_UP 3
+/* arg1: 1=left,2=center,3=right */
+#define INPUTACTION_MOUSE_BUTTON_CLICK 4
+/* arg1: 1=left,2=center 3=right */
+#define INPUTACTION_MOUSE_BUTTON_DCLICK 5
+/* arg1: wheel rotation away from user */
+#define INPUTACTION_WHEEL_ROTATE_AWAY 6
+/* arg1: wheel rotation toward user */
+#define INPUTACTION_WHEEL_ROTATE_TOWARD 7
+/* arg1: scancode, as follows: If arg1 <= 0xff, it's a 1-byte scancode and arg1
+ *  is that scancode. If arg1 > 0xff, it's a 2-byte scanecode, with the 1st
+ *  byte in the low 8 bits, and the 2nd byte in the high 8 bits.
+ *  E.g., the right ALT key would appear as x'38e0'.
+ */
+#define INPUTACTION_KEY_DOWN 64
+/* arg1: scancode (in same format as inputaction_keyDown) */
+#define INPUTACTION_KEY_UP 65
+/* arg1: scancode (in same format as inputaction_keyDown); MUST refer to one of
+ *  the locking keys, like capslock, numlock, or scrolllock.
+ * arg2: 1 iff locking key should be in the LOCKED position (e.g., light is ON)
+ */
 #define INPUTACTION_SET_LOCKING_KEY_STATE 66
-   /* arg1: scancode (in same format
-*   as inputaction_keyDown);
-*   MUST refer to one of the
-*   locking keys, like capslock,
-*   numlock, or scrolllock
-* arg2: 1 iff locking key should be
-*   in the LOCKED position
-*   (e.g., light is ON)
-*/
-#define INPUTACTION_KEY_DOWN_UP 67 /* arg1: scancode (in same format
-*   as inputaction_keyDown)
-*/
+/* arg1: scancode (in same format as inputaction_keyDown */
+#define INPUTACTION_KEY_DOWN_UP 67
 
 struct visor_inputactivity {
u16 action;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 24/25] staging: unisys: visorbus: use __func__ over hardcoded name

2017-06-30 Thread David Kershner
From: Zachary Dremann 

As reported by checkpatch.pl, replace hardcoded uses of the current
function's name in format strings with uses of __func__.

Signed-off-by: Zachary Dremann 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 973ed61..7d37a00 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -581,7 +581,7 @@ visorbus_create(struct controlvm_message *inmsg)
bus_info = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL);
if (bus_info && (bus_info->state.created == 1)) {
dev_err(&chipset_dev->acpi_device->dev,
-   "failed visorbus_create: already exists\n");
+   "failed %s: already exists\n", __func__);
err = -EEXIST;
goto err_respond;
}
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 19/25] staging: unisys: include: iochannel.h: Adjust whitespace usage

2017-06-30 Thread David Kershner
From: David Binder 

Adjusts spacing and removes unnecessary blank lines to create a more
uniform coding style.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/include/iochannel.h | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 5212c19..12849bb 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -7,9 +7,7 @@
  * Everything needed for IOPart-GuestPart communication is define in
  * this file. Note: Everything is OS-independent because this file is
  * used by Windows, Linux and possible EFI drivers.
- */
-
-/*
+ *
  * Communication flow between the IOPart and GuestPart uses the channel headers
  * channel state. The following states are currently being used:
  *   UNINIT(All Zeroes), CHANNEL_ATTACHING, CHANNEL_ATTACHED, 
CHANNEL_OPENED
@@ -30,7 +28,6 @@
  */
 
 #include 
-
 #include 
 #include "channel.h"
 
@@ -80,9 +77,7 @@
 
 /* Size of cdb - i.e., SCSI cmnd */
 #define MAX_CMND_SIZE 16
-
 #define MAX_SENSE_SIZE 64
-
 #define MAX_PHYS_INFO 64
 
 /*
@@ -245,9 +240,7 @@ struct uiscmdrsp_scsi {
 /*
  * Defines to support sending correct inquiry result when no disk is
  * configured.
- */
-
-/*
+ *
  * From SCSI SPC2 -
  *
  * If the target is not capable of supporting a device on this logical unit, 
the
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 18/25] staging: unisys: include: channel.h: Adjust whitespace usage

2017-06-30 Thread David Kershner
From: David Binder 

Adjusts spacing and removes unnecessary blank lines to create a more
uniform coding style.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/include/channel.h | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index 8affc53..fef1b0d 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -265,10 +265,7 @@ visor_check_channel(struct channel_header *ch,
return 1;
 }
 
-/*
- * CHANNEL Guids
- */
-
+/* CHANNEL Guids */
 /* {414815ed-c58c-11da-95a9-00e08161165f} */
 #define VISOR_VHBA_CHANNEL_UUID \
UUID_LE(0x414815ed, 0xc58c, 0x11da, \
@@ -276,7 +273,6 @@ visor_check_channel(struct channel_header *ch,
 static const uuid_le visor_vhba_channel_uuid = VISOR_VHBA_CHANNEL_UUID;
 #define VISOR_VHBA_CHANNEL_UUID_STR \
"414815ed-c58c-11da-95a9-00e08161165f"
-
 /* {8cd5994d-c58e-11da-95a9-00e08161165f} */
 #define VISOR_VNIC_CHANNEL_UUID \
UUID_LE(0x8cd5994d, 0xc58e, 0x11da, \
@@ -284,7 +280,6 @@ static const uuid_le visor_vhba_channel_uuid = 
VISOR_VHBA_CHANNEL_UUID;
 static const uuid_le visor_vnic_channel_uuid = VISOR_VNIC_CHANNEL_UUID;
 #define VISOR_VNIC_CHANNEL_UUID_STR \
"8cd5994d-c58e-11da-95a9-00e08161165f"
-
 /* {72120008-4AAB-11DC-8530-444553544200} */
 #define VISOR_SIOVM_UUID \
UUID_LE(0x72120008, 0x4AAB, 0x11DC, \
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/25] staging: unisys: include: Fix spelling mistake

2017-06-30 Thread David Kershner
From: David Binder 

Fixes minor spelling mistake: stired -> stored.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/include/iochannel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index d792610..5212c19 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -184,7 +184,7 @@ struct vhba_wwnn {
  *  is often determined by the resource of the hba.
  *  e.g Max scatter gather list length * page size / sector size.
  *
- * WARNING: Values stired in this structure must contain maximum counts (not
+ * WARNING: Values stored in this structure must contain maximum counts (not
  * maximum values).
  *
  * 20 bytes
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 23/25] staging: unisys: visorbus: Indent struct assignment correctly

2017-06-30 Thread David Kershner
From: Zachary Dremann 

Several structure initializations all had their members indented with 2
tabs instead of one. Remove the extra tabs.

Signed-off-by: Zachary Dremann 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 42 +-
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 075e817..d29f9ae 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -240,23 +240,23 @@ static ssize_t typename_show(struct device *dev, struct 
device_attribute *attr,
 static DEVICE_ATTR_RO(typename);
 
 static struct attribute *channel_attrs[] = {
-   &dev_attr_physaddr.attr,
-   &dev_attr_nbytes.attr,
-   &dev_attr_clientpartition.attr,
-   &dev_attr_typeguid.attr,
-   &dev_attr_zoneguid.attr,
-   &dev_attr_typename.attr,
-   NULL
+   &dev_attr_physaddr.attr,
+   &dev_attr_nbytes.attr,
+   &dev_attr_clientpartition.attr,
+   &dev_attr_typeguid.attr,
+   &dev_attr_zoneguid.attr,
+   &dev_attr_typename.attr,
+   NULL
 };
 
 static struct attribute_group channel_attr_grp = {
-   .name = "channel",
-   .attrs = channel_attrs,
+   .name = "channel",
+   .attrs = channel_attrs,
 };
 
 static const struct attribute_group *visorbus_channel_groups[] = {
-   &channel_attr_grp,
-   NULL
+   &channel_attr_grp,
+   NULL
 };
 
 /* end implementation of specific channel attributes */
@@ -331,22 +331,22 @@ static ssize_t channel_id_show(struct device *dev,
 static DEVICE_ATTR_RO(channel_id);
 
 static struct attribute *dev_attrs[] = {
-   &dev_attr_partition_handle.attr,
-   &dev_attr_partition_guid.attr,
-   &dev_attr_partition_name.attr,
-   &dev_attr_channel_addr.attr,
-   &dev_attr_channel_bytes.attr,
-   &dev_attr_channel_id.attr,
-   NULL
+   &dev_attr_partition_handle.attr,
+   &dev_attr_partition_guid.attr,
+   &dev_attr_partition_name.attr,
+   &dev_attr_channel_addr.attr,
+   &dev_attr_channel_bytes.attr,
+   &dev_attr_channel_id.attr,
+   NULL
 };
 
 static struct attribute_group dev_attr_grp = {
-   .attrs = dev_attrs,
+   .attrs = dev_attrs,
 };
 
 static const struct attribute_group *visorbus_groups[] = {
-   &dev_attr_grp,
-   NULL
+   &dev_attr_grp,
+   NULL
 };
 
 /*
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/25] staging: unisys: include: iochannel.h: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Added kernel-doc like comments and cleaned up the inline comments in the
structures.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/include/iochannel.h | 492 --
 1 file changed, 280 insertions(+), 212 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index c7cb3fb..d792610 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -71,8 +71,10 @@
 #define MAXNUM(a, b) (((a) > (b)) ? (a) : (b))
 
 /* Define the two queues per data channel between iopart and ioguestparts. */
+
 /* Used by ioguestpart to 'insert' signals to iopart. */
 #define IOCHAN_TO_IOPART 0
+
 /* Used by ioguestpart to 'remove' signals from iopart, same previous queue. */
 #define IOCHAN_FROM_IOPART 1
 
@@ -83,46 +85,45 @@
 
 #define MAX_PHYS_INFO 64
 
-/* Various types of network packets that can be sent in cmdrsp. */
+/*
+ * enum net_types - Various types of network packets that can be sent in 
cmdrsp.
+ * @NET_RCV_POST:  Submit buffer to hold receiving incoming packet.
+ * @NET_RCV:   visornic -> uisnic. Incoming packet received.
+ * @NET_XMIT:  uisnic -> visornic. For outgoing packet.
+ * @NET_XMIT_DONE: visornic -> uisnic. Outgoing packet xmitted.
+ * @NET_RCV_ENBDIS:uisnic -> visornic. Enable/Disable packet reception.
+ * @NET_RCV_ENBDIS_ACK:visornic -> uisnic. Acknowledge enable/disable 
packet.
+ * @NET_RCV_PROMISC:   uisnic -> visornic. Enable/Disable promiscuous mode.
+ * @NET_CONNECT_STATUS:visornic -> uisnic. Indicate the loss or 
restoration of
+ * a network connection.
+ * @NET_MACADDR:   uisnic -> visornic. Indicates the client has requested
+ * to update it's MAC address.
+ * @NET_MACADDR_ACK:   MAC address acknowledge.
+ */
 enum net_types {
-   NET_RCV_POST = 0,   /*
-* Submit buffer to hold receiving
-* incoming packet
-*/
-   /* visornic -> uisnic */
-   NET_RCV,/* incoming packet received */
-   /* uisnic -> visornic */
-   NET_XMIT,   /* for outgoing net packets */
-   /* visornic -> uisnic */
-   NET_XMIT_DONE,  /* outgoing packet xmitted */
-   /* uisnic -> visornic */
-   NET_RCV_ENBDIS, /* enable/disable packet reception */
-   /* visornic -> uisnic */
-   NET_RCV_ENBDIS_ACK, /* acknowledge enable/disable packet */
-   /* reception */
-   /* uisnic -> visornic */
-   NET_RCV_PROMISC,/* enable/disable promiscuous mode */
-   /* visornic -> uisnic */
-   NET_CONNECT_STATUS, /*
-* indicate the loss or restoration of a network
-* connection
-*/
-   /* uisnic -> visornic */
-   NET_MACADDR,/*
-* Indicates the client has requested to update
-* it's MAC address
-*/
-   NET_MACADDR_ACK,/* MAC address acknowledge */
-
+   NET_RCV_POST = 0,
+   NET_RCV,
+   NET_XMIT,
+   NET_XMIT_DONE,
+   NET_RCV_ENBDIS,
+   NET_RCV_ENBDIS_ACK,
+   /* Reception */
+   NET_RCV_PROMISC,
+   NET_CONNECT_STATUS,
+   NET_MACADDR,
+   NET_MACADDR_ACK,
 };
 
-#define ETH_MIN_DATA_SIZE 46   /* minimum eth data size */
+/* Minimum eth data size */
+#define ETH_MIN_DATA_SIZE 46
 #define ETH_MIN_PACKET_SIZE (ETH_HLEN + ETH_MIN_DATA_SIZE)
 
-#define VISOR_ETH_MAX_MTU 16384/* maximum data size */
+/* Maximum data size */
+#define VISOR_ETH_MAX_MTU 16384
 
 #ifndef MAX_MACADDR_LEN
-#define MAX_MACADDR_LEN 6  /* number of bytes in MAC address */
+/* Number of bytes in MAC address */
+#define MAX_MACADDR_LEN 6
 #endif
 
 /* Various types of scsi task mgmt commands. */
@@ -156,10 +157,16 @@ struct guest_phys_info {
 
 #define GPI_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof(struct guest_phys_info))
 
+/*
+ * struct uisscsi_dest
+ * @channel: Bus number.
+ * @id:  Target number.
+ * @lun: Logical unit number.
+ */
 struct uisscsi_dest {
-   u32 channel;/* channel == bus number */
-   u32 id; /* id == target number */
-   u32 lun;/* lun == logical unit number */
+   u32 channel;
+   u32 id;
+   u32 lun;
 } __packed;
 
 struct vhba_wwnn {
@@ -168,53 +175,71 @@ struct vhba_wwnn {
 } __packed;
 
 /*
+ * struct vhba_config_max
+ * @max_channel: Maximum channel for devices attached to this bus.
+ * @max_id: Maximum SCSI ID for devices attached to bus.
+ * @max_lun:Maximum SCSI LUN for devices attached to bus.
+ * @cmd_per_lun: Maximum number of outsta

[PATCH 20/25] staging: unisys: include: visorbus.h: Adjust whitespace usage

2017-06-30 Thread David Kershner
From: David Binder 

Adjusts presence of blank lines to create a more uniform coding style.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/include/visorbus.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index de06355..b727dee 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -23,7 +23,6 @@
  *
  *  There should be nothing in this file that is private to the visorbus
  *  bus implementation itself.
- *
  */
 
 #ifndef __VISORBUS_H__
@@ -45,6 +44,7 @@ extern struct bus_type visorbus_type;
 
 typedef void (*visorbus_state_complete_func) (struct visor_device *dev,
  int status);
+
 struct visorchipset_state {
u32 created:1;
u32 attached:1;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/25] staging: unisys: visorbus: Remove unused #define

2017-06-30 Thread David Kershner
From: David Binder 

Removes unused MYDRVNAME define.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index e271de6..075e817 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -21,8 +21,6 @@
 #include "visorbus.h"
 #include "visorbus_private.h"
 
-#define MYDRVNAME "visorbus"
-
 /* Display string that is guaranteed to be no longer the 99 characters */
 #define LINESIZE 99
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/25] staging: unisys: visorhba: visorhba_main.c: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorhba/visorhba_main.c | 33 --
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
b/drivers/staging/unisys/visorhba/visorhba_main.c
index a6e7a6b..1ab4b85 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -48,7 +48,8 @@ MODULE_ALIAS("visorbus:" VISOR_VHBA_CHANNEL_UUID_STR);
 
 struct visordisk_info {
u32 valid;
-   u32 channel, id, lun;   /* Disk Path */
+   /* Disk Path */
+   u32 channel, id, lun;
atomic_t ios_threshold;
atomic_t error_count;
struct visordisk_info *next;
@@ -56,8 +57,10 @@ struct visordisk_info {
 
 struct scsipending {
struct uiscmdrsp cmdrsp;
-   void *sent; /* The Data being tracked */
-   char cmdtype;   /* Type of pointer that is being stored */
+   /* The Data being tracked */
+   void *sent;
+   /* Type of pointer that is being stored */
+   char cmdtype;
 };
 
 /* Each scsi_host has a host_data area that contains this struct. */
@@ -71,7 +74,8 @@ struct visorhba_devdata {
struct scsipending pending[MAX_PENDING_REQUESTS];
/* Start search for next pending free slot here */
unsigned int nextinsert;
-   spinlock_t privlock; /* lock to protect data in devdata */
+   /* lock to protect data in devdata */
+   spinlock_t privlock;
bool serverdown;
bool serverchangingstate;
unsigned long long acquire_failed_cnt;
@@ -136,8 +140,9 @@ static struct task_struct *visor_thread_start
  */
 static void visor_thread_stop(struct task_struct *task)
 {
+   /* no thread running */
if (!task)
-   return;  /* no thread running */
+   return;
kthread_stop(task);
 }
 
@@ -176,7 +181,8 @@ static int add_scsipending_entry(struct visorhba_devdata 
*devdata,
entry->cmdtype = cmdtype;
if (new)
entry->sent = new;
-   else /* wants to send cmdrsp */
+   /* wants to send cmdrsp */
+   else
entry->sent = &entry->cmdrsp;
devdata->nextinsert = (insert_location + 1) % MAX_PENDING_REQUESTS;
spin_unlock_irqrestore(&devdata->privlock, flags);
@@ -249,9 +255,11 @@ static unsigned int simple_idr_get(struct idr *idrtable, 
void *p,
id = idr_alloc(idrtable, p, 1, INT_MAX, GFP_NOWAIT);
spin_unlock_irqrestore(lock, flags);
idr_preload_end();
+   /* failure */
if (id < 0)
-   return 0;  /* failure */
-   return (unsigned int)(id);  /* idr_alloc() guarantees > 0 */
+   return 0;
+   /* idr_alloc() guarantees > 0 */
+   return (unsigned int)(id);
 }
 
 /*
@@ -573,12 +581,14 @@ static int visorhba_slave_alloc(struct scsi_device 
*scsidev)
struct visorhba_devdata *devdata;
struct Scsi_Host *scsihost = (struct Scsi_Host *)scsidev->host;
 
+   /* even though we errored, treat as success */
devdata = (struct visorhba_devdata *)scsihost->hostdata;
if (!devdata)
-   return 0; /* even though we errored, treat as success */
+   return 0;
 
+   /* already allocated return success */
for_each_vdisk_match(vdisk, devdata, scsidev)
-   return 0; /* already allocated return success */
+   return 0;
 
tmpvdisk = kzalloc(sizeof(*tmpvdisk), GFP_ATOMIC);
if (!tmpvdisk)
@@ -930,10 +940,11 @@ drain_queue(struct uiscmdrsp *cmdrsp, struct 
visorhba_devdata *devdata)
struct scsi_cmnd *scsicmd;
 
while (1) {
+   /* queue empty */
if (visorchannel_signalremove(devdata->dev->visorchannel,
  IOCHAN_FROM_IOPART,
  cmdrsp))
-   break; /* queue empty */
+   break;
 
if (cmdrsp->cmdtype == CMD_SCSI_TYPE) {
/* scsicmd location is returned by the
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/25] staging: unisys: visornic: visornic_main.c: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visornic/visornic_main.c | 98 +++---
 1 file changed, 61 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 2891622..5c2614b 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -84,7 +84,8 @@ struct visornic_devdata {
u64 incarnation_id;
/* flags as they were prior to set_multicast_list */
unsigned short old_flags;
-   atomic_t usage; /* count of users */
+   /* count of users */
+   atomic_t usage;
 
/* number of rcv buffers the vnic will post */
int num_rcv_bufs;
@@ -108,31 +109,43 @@ struct visornic_devdata {
struct uiscmdrsp *cmdrsp_rcv;
/* xmit_cmdrsp - issues NET_XMIT - only one active xmit at a time */
struct uiscmdrsp *xmit_cmdrsp;
-
-   bool server_down;/* IOPART is down */
-   bool server_change_state;/* Processing SERVER_CHANGESTATE msg */
-   bool going_away; /* device is being torn down */
+   /* IOPART is down */
+   bool server_down;
+   /* Processing SERVER_CHANGESTATE msg */
+   bool server_change_state;
+   /* device is being torn down */
+   bool going_away;
struct dentry *eth_debugfs_dir;
u64 interrupts_rcvd;
u64 interrupts_notme;
u64 interrupts_disabled;
u64 busy_cnt;
-   spinlock_t priv_lock;  /* spinlock to access devdata structures */
+   /* spinlock to access devdata structures */
+   spinlock_t priv_lock;
 
/* flow control counter */
u64 flow_control_upper_hits;
u64 flow_control_lower_hits;
 
/* debug counters */
-   unsigned long n_rcv0;   /* # rcvs of 0 buffers */
-   unsigned long n_rcv1;   /* # rcvs of 1 buffers */
-   unsigned long n_rcv2;   /* # rcvs of 2 buffers */
-   unsigned long n_rcvx;   /* # rcvs of >2 buffers */
-   unsigned long found_repost_rcvbuf_cnt;  /* # repost_rcvbuf_cnt */
-   unsigned long repost_found_skb_cnt; /* # of found the skb */
-   unsigned long n_repost_deficit; /* # of lost rcv buffers */
-   unsigned long bad_rcv_buf; /* # of unknown rcv skb  not freed */
-   unsigned long n_rcv_packets_not_accepted;/* # bogs rcv packets */
+   /* # rcvs of 0 buffers */
+   unsigned long n_rcv0;
+   /* # rcvs of 1 buffers */
+   unsigned long n_rcv1;
+   /* # rcvs of 2 buffers */
+   unsigned long n_rcv2;
+   /* # rcvs of >2 buffers */
+   unsigned long n_rcvx;
+   /* # repost_rcvbuf_cnt */
+   unsigned long found_repost_rcvbuf_cnt;
+   /* # of found the skb */
+   unsigned long repost_found_skb_cnt;
+   /* # of lost rcv buffers */
+   unsigned long n_repost_deficit;
+   /* # of unknown rcv skb  not freed */
+   unsigned long bad_rcv_buf;
+   /* # bogs rcv packets */
+   unsigned long n_rcv_packets_not_accepted;
 
int queuefullmsg_logged;
struct chanstat chstat;
@@ -493,7 +506,8 @@ visornic_disable_with_timeout(struct net_device *netdev, 
const int timeout)
/* send a msg telling the other end we are stopping incoming pkts */
spin_lock_irqsave(&devdata->priv_lock, flags);
devdata->enabled = 0;
-   devdata->enab_dis_acked = 0; /* must wait for ack */
+   /* must wait for ack */
+   devdata->enab_dis_acked = 0;
spin_unlock_irqrestore(&devdata->priv_lock, flags);
 
/* send disable and wait for ack -- don't hold lock when sending
@@ -578,10 +592,12 @@ init_rcv_bufs(struct net_device *netdev, struct 
visornic_devdata *devdata)
 */
for (i = 0; i < devdata->num_rcv_bufs; i++) {
devdata->rcvbuf[i] = alloc_rcv_buf(netdev);
+   /* if we failed to allocate one let us stop */
if (!devdata->rcvbuf[i])
-   break; /* if we failed to allocate one let us stop */
+   break;
}
-   if (i == 0) /* couldn't even allocate one -- bail out */
+   /* couldn't even allocate one -- bail out */
+   if (i == 0)
return -ENOMEM;
count = i;
 
@@ -1236,7 +1252,8 @@ visornic_rx(struct uiscmdrsp *cmdrsp)
 * firstfrag & set data_len to show rest see if we have to chain
 * frag_list.
 */
-   if (skb->len > RCVPOST_BUF_SIZE) {  /* do PRECAUTIONARY check */
+   /* do PRECAUTIONARY check */
+   if (skb->len > RCVPOST_BUF_SIZE) {
if (cmdrsp->net.rcv.numrcvbufs < 2) {
if (repost_return(cmdrsp, devdata, skb, netdev) < 0)
dev_err(&devdata

[PATCH 12/25] staging: unisys: visorinput: visorinput.c: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorinput/visorinput.c | 20 +++
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorinput/visorinput.c 
b/drivers/staging/unisys/visorinput/visorinput.c
index 45bc340..c15f28f 100644
--- a/drivers/staging/unisys/visorinput/visorinput.c
+++ b/drivers/staging/unisys/visorinput/visorinput.c
@@ -60,11 +60,13 @@ enum visorinput_device_type {
  */
 struct visorinput_devdata {
struct visor_device *dev;
-   struct mutex lock_visor_dev; /* lock for dev */
+   /* lock for dev */
+   struct mutex lock_visor_dev;
struct input_dev *visorinput_dev;
bool paused;
bool interrupts_enabled;
-   unsigned int keycode_table_bytes; /* size of following array */
+   /* size of following array */
+   unsigned int keycode_table_bytes;
/* for keyboard devices: visorkbd_keycode[] + visorkbd_ext_keycode[] */
unsigned char keycode_table[0];
 };
@@ -162,9 +164,8 @@ static const unsigned char 
visorkbd_keycode[KEYCODE_TABLE_BYTES] = {
[81] = KEY_KP3,
[82] = KEY_KP0,
[83] = KEY_KPDOT,
-   [86] = KEY_102ND, /* enables UK backslash+pipe key,
-  * and FR lessthan+greaterthan key
-  */
+   /* enables UK backslash+pipe key and FR lessthan+greaterthan key */
+   [86] = KEY_102ND,
[87] = KEY_F11,
[88] = KEY_F12,
[90] = KEY_KPLEFTPAREN,
@@ -302,7 +303,8 @@ setup_client_keyboard(void *devdata,  /* opaque on purpose 
*/
BIT_MASK(LED_SCROLLL) |
BIT_MASK(LED_NUML);
visorinput_dev->keycode = keycode_table;
-   visorinput_dev->keycodesize = 1; /* sizeof(unsigned char) */
+   /* sizeof(unsigned char) */
+   visorinput_dev->keycodesize = 1;
visorinput_dev->keycodemax = KEYCODE_TABLE_BYTES;
 
for (i = 1; i < visorinput_dev->keycodemax; i++)
@@ -313,7 +315,8 @@ setup_client_keyboard(void *devdata,  /* opaque on purpose 
*/
 
visorinput_dev->open = visorinput_open;
visorinput_dev->close = visorinput_close;
-   input_set_drvdata(visorinput_dev, devdata); /* pre input_register! */
+   /* pre input_register! */
+   input_set_drvdata(visorinput_dev, devdata);
 
return visorinput_dev;
 }
@@ -354,7 +357,8 @@ setup_client_mouse(void *devdata /* opaque on purpose */)
 
visorinput_dev->open = visorinput_open;
visorinput_dev->close = visorinput_close;
-   input_set_drvdata(visorinput_dev, devdata); /* pre input_register! */
+   /* pre input_register! */
+   input_set_drvdata(visorinput_dev, devdata);
input_set_capability(visorinput_dev, EV_REL, REL_WHEEL);
 
return visorinput_dev;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 22/25] staging: unisys: visorbus: adjust tabs in function

2017-06-30 Thread David Kershner
From: Steve Wilson 

Removed extra tabs in visorbus_get_device_by_id function.

Signed-off-by: Steve Wilson 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index bf6f79e..973ed61 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -365,9 +365,9 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, 
u32 dev_no,
struct device *dev_start = NULL;
struct visor_device *vdev = NULL;
struct visor_busdev id = {
-   .bus_no = bus_no,
-   .dev_no = dev_no
-   };
+   .bus_no = bus_no,
+   .dev_no = dev_no
+   };
 
if (from)
dev_start = &from->device;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 16/25] staging: unisys: visorbus: Rename #define to fit surrounding namespace

2017-06-30 Thread David Kershner
From: David Binder 

Renames MYDRVNAME to better fit with the surrounding driver namespace.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 0f02509..fcff231 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -26,7 +26,7 @@
 #include "visorbus_private.h"
 #include "controlvmchannel.h"
 
-#define MYDRVNAME "visorchannel"
+#define VISOR_DRV_NAME "visorchannel"
 
 #define VISOR_CONSOLEVIDEO_CHANNEL_GUID \
UUID_LE(0x3cd6e705, 0xd6a2, 0x4aa5, \
@@ -418,7 +418,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long 
channel_bytes,
 * this. Remember that we haven't requested it so we don't try to
 * release later on.
 */
-   channel->requested = request_mem_region(physaddr, size, MYDRVNAME);
+   channel->requested = request_mem_region(physaddr, size, VISOR_DRV_NAME);
if (!channel->requested && uuid_le_cmp(guid, visor_video_guid))
/* we only care about errors if this is not the video channel */
goto err_destroy_channel;
@@ -448,7 +448,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long 
channel_bytes,
release_mem_region(channel->physaddr, channel->nbytes);
channel->mapped = NULL;
channel->requested = request_mem_region(channel->physaddr,
-   channel_bytes, MYDRVNAME);
+   channel_bytes, VISOR_DRV_NAME);
if (!channel->requested && uuid_le_cmp(guid, visor_video_guid))
/* we only care about errors if this is not the video channel */
goto err_destroy_channel;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 21/25] staging: unisys: visorbus: controlvmchannel.h: Adjust whitespace usage

2017-06-30 Thread David Kershner
From: David Binder 

Removes unnecessary blank lines to create a more uniform coding style.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/controlvmchannel.h |  9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h 
b/drivers/staging/unisys/visorbus/controlvmchannel.h
index 5c67baf..dd3aff0 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -613,17 +613,14 @@ struct visor_controlvm_parameters_header {
 #define CONTROLVM_RESP_KMALLOC_FAILED 3
 #define CONTROLVM_RESP_ID_UNKNOWN 4
 #define CONTROLVM_RESP_ID_INVALID_FOR_CLIENT  5
-
 /* CONTROLVM_INIT_CHIPSET---[100-199] 
*/
 #define CONTROLVM_RESP_CLIENT_SWITCHCOUNT_NONZERO  100
 #define CONTROLVM_RESP_EXPECTED_CHIPSET_INIT  101
-
 /* Maximum Limit[200-299] 
*/
 /* BUS_CREATE */
 #define CONTROLVM_RESP_ERROR_MAX_BUSES201
 /* DEVICE_CREATE */
 #define CONTROLVM_RESP_ERROR_MAX_DEVICES  202
-
 /* Payload and Parameter Related[400-499] 
*/
 /* SWITCH_ATTACHEXTPORT, DEVICE_CONFIGURE */
 #define CONTROLVM_RESP_PAYLOAD_INVALID400
@@ -633,7 +630,6 @@ struct visor_controlvm_parameters_header {
 #define CONTROLVM_RESP_TARGET_PARAMETER_INVALID   402
 /* DEVICE_CONFIGURE */
 #define CONTROLVM_RESP_CLIENT_PARAMETER_INVALID   403
-
 /* Specified[Packet Structure] Value[500-599] 
*/
 /* SWITCH_ATTACHINTPORT */
 /* BUS_CONFIGURE, DEVICE_CREATE, DEVICE_CONFIG, DEVICE_DESTROY */
@@ -652,25 +648,20 @@ struct visor_controlvm_parameters_header {
 /* Generic device callback returned error. */
 /* SWITCH_ATTACHEXTPORT, SWITCH_DETACHEXTPORT, DEVICE_CONFIGURE */
 #define CONTROLVM_RESP_GENERIC_DRIVER_CALLBACK_ERROR   606
-
 /* Bus Related--[700-799] 
*/
 /* BUS_DESTROY */
 #define CONTROLVM_RESP_ERROR_BUS_DEVICE_ATTACHED   700
-
 /* Channel Related--[800-899] 
*/
 /* GET_CHANNELINFO, DEVICE_DESTROY */
 #define CONTROLVM_RESP_CHANNEL_TYPE_UNKNOWN   800
 /* DEVICE_CREATE */
 #define CONTROLVM_RESP_CHANNEL_SIZE_TOO_SMALL 801
-
 /* Chipset Shutdown Related---[1000-1099] 
*/
 #define CONTROLVM_RESP_CHIPSET_SHUTDOWN_FAILED1000
 #define CONTROLVM_RESP_CHIPSET_SHUTDOWN_ALREADY_ACTIVE 1001
-
 /* Chipset Stop Related---[1100-1199] 
*/
 #define CONTROLVM_RESP_CHIPSET_STOP_FAILED_BUS1100
 #define CONTROLVM_RESP_CHIPSET_STOP_FAILED_SWITCH  1101
-
 /* Device Related-[1400-1499] 
*/
 #define CONTROLVM_RESP_DEVICE_UDEV_TIMEOUT1400
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/25] staging: unisys: visorhba: Fix up existing function comments

2017-06-30 Thread David Kershner
From: David Binder 

Refactors existing static function comments to increase code readability.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorhba/visorhba_main.c | 325 -
 1 file changed, 170 insertions(+), 155 deletions(-)

diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
b/drivers/staging/unisys/visorhba/visorhba_main.c
index 1ab4b85..b48a221 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -112,15 +112,15 @@ struct visorhba_devices_open {
(iter->lun == match->lun))
 
 /*
- * visor_thread_start - starts a thread for the device
- * @threadfn: Function the thread starts
- * @thrcontext: Context to pass to the thread, i.e. devdata
- * @name: string describing name of thread
+ * visor_thread_start - Starts a thread for the device
+ * @threadfn:   Function the thread starts
+ * @thrcontext: Context to pass to the thread, i.e. devdata
+ * @name:  String describing name of thread
  *
- * Starts a thread for the device.
+ * Starts a thread for the device.
  *
- * Return the task_struct * denoting the thread on success,
- * or NULL on failure
+ * Return: The task_struct * denoting the thread on success,
+ *or NULL on failure
  */
 static struct task_struct *visor_thread_start
 (int (*threadfn)(void *), void *thrcontext, char *name)
@@ -136,7 +136,8 @@ static struct task_struct *visor_thread_start
 }
 
 /*
- *  visor_thread_stop - stops the thread if it is running
+ * visor_thread_stop - Stops the thread if it is running
+ * @task: Description of process to stop
  */
 static void visor_thread_stop(struct task_struct *task)
 {
@@ -147,17 +148,18 @@ static void visor_thread_stop(struct task_struct *task)
 }
 
 /*
- * add_scsipending_entry - save off io command that is pending in
- * Service Partition
- * @devdata: Pointer to devdata
- * @cmdtype: Specifies the type of command pending
- * @new:   The command to be saved
+ * add_scsipending_entry - Save off io command that is pending in
+ *Service Partition
+ * @devdata: Pointer to devdata
+ * @cmdtype: Specifies the type of command pending
+ * @new: The command to be saved
  *
- * Saves off the io command that is being handled by the Service
- * Partition so that it can be handled when it completes. If new is
- * NULL it is assumed the entry refers only to the cmdrsp.
- * Returns insert_location where entry was added,
- * -EBUSY if it can't
+ * Saves off the io command that is being handled by the Service
+ * Partition so that it can be handled when it completes. If new is
+ * NULL it is assumed the entry refers only to the cmdrsp.
+ *
+ * Return: Insert_location where entry was added on success,
+ *-EBUSY if it can't
  */
 static int add_scsipending_entry(struct visorhba_devdata *devdata,
 char cmdtype, void *new)
@@ -191,12 +193,13 @@ static int add_scsipending_entry(struct visorhba_devdata 
*devdata,
 }
 
 /*
- * del_scsipending_ent - removes an entry from the pending array
- * @devdata: Device holding the pending array
- * @del: Entry to remove
+ * del_scsipending_ent - Removes an entry from the pending array
+ * @devdata: Device holding the pending array
+ * @del: Entry to remove
+ *
+ * Removes the entry pointed at by del and returns it.
  *
- * Removes the entry pointed at by del and returns it.
- * Returns the scsipending entry pointed at
+ * Return: The scsipending entry pointed to on success, NULL on failure
  */
 static void *del_scsipending_ent(struct visorhba_devdata *devdata,
 int del)
@@ -218,13 +221,14 @@ static void *del_scsipending_ent(struct visorhba_devdata 
*devdata,
 }
 
 /*
- * get_scsipending_cmdrsp - return the cmdrsp stored in a pending entry
- * @ddata: Device holding the pending array
- * @ent: Entry that stores the cmdrsp
+ * get_scsipending_cmdrsp - Return the cmdrsp stored in a pending entry
+ * @ddata: Device holding the pending array
+ * @ent:   Entry that stores the cmdrsp
  *
- * Each scsipending entry has a cmdrsp in it. The cmdrsp is only valid
- * if the "sent" field is not NULL
- * Returns a pointer to the cmdrsp.
+ * Each scsipending entry has a cmdrsp in it. The cmdrsp is only valid
+ * if the "sent" field is not NULL.
+ *
+ * Return: A pointer to the cmdrsp, NULL on failure
  */
 static struct uiscmdrsp *get_scsipending_cmdrsp(struct visorhba_devdata *ddata,
int ent)
@@ -236,13 +240,15 @@ static struct uiscmdrsp *get_scsipending_cmdrsp(struct 
visorhba_devdata *ddata,
 }
 
 /*
- *  simple_idr_get - associate a provided pointer with an int value
- *   1 <= value <= INT_MAX, and return this int value;
- *   the pointe

[PATCH 25/25] staging: unisys: visorbus: fix improper bracket blocks

2017-06-30 Thread David Kershner
From: Erik Arfvidson 

This patch fixes visorbus_main.c improper function brackets.
for the following functions:
partition_handle_show
partition_guid_show
partition_name_show
channel_addr_show
channel_bytes_show
channel_id_show

Signed-off-by: Erik Arfvidson 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index d29f9ae..f884b59 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -270,7 +270,8 @@ static const struct attribute_group 
*visorbus_channel_groups[] = {
 
 static ssize_t partition_handle_show(struct device *dev,
 struct device_attribute *attr,
-char *buf) {
+char *buf)
+{
struct visor_device *vdev = to_visor_device(dev);
u64 handle = visorchannel_get_clientpartition(vdev->visorchannel);
 
@@ -280,7 +281,8 @@ static DEVICE_ATTR_RO(partition_handle);
 
 static ssize_t partition_guid_show(struct device *dev,
   struct device_attribute *attr,
-  char *buf) {
+  char *buf)
+{
struct visor_device *vdev = to_visor_device(dev);
 
return sprintf(buf, "{%pUb}\n", &vdev->partition_uuid);
@@ -289,7 +291,8 @@ static DEVICE_ATTR_RO(partition_guid);
 
 static ssize_t partition_name_show(struct device *dev,
   struct device_attribute *attr,
-  char *buf) {
+  char *buf)
+{
struct visor_device *vdev = to_visor_device(dev);
 
return sprintf(buf, "%s\n", vdev->name);
@@ -298,7 +301,8 @@ static DEVICE_ATTR_RO(partition_name);
 
 static ssize_t channel_addr_show(struct device *dev,
 struct device_attribute *attr,
-char *buf) {
+char *buf)
+{
struct visor_device *vdev = to_visor_device(dev);
u64 addr = visorchannel_get_physaddr(vdev->visorchannel);
 
@@ -308,7 +312,8 @@ static DEVICE_ATTR_RO(channel_addr);
 
 static ssize_t channel_bytes_show(struct device *dev,
  struct device_attribute *attr,
- char *buf) {
+ char *buf)
+{
struct visor_device *vdev = to_visor_device(dev);
u64 nbytes = visorchannel_get_nbytes(vdev->visorchannel);
 
@@ -318,7 +323,8 @@ static DEVICE_ATTR_RO(channel_bytes);
 
 static ssize_t channel_id_show(struct device *dev,
   struct device_attribute *attr,
-  char *buf) {
+  char *buf)
+{
struct visor_device *vdev = to_visor_device(dev);
int len = 0;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/25] staging: unisys: visorbus: visorchipset.c: fixed comment formatting issues

2017-06-30 Thread David Kershner
From: Sameer Wadgaonkar 

Removed comments from the right side of the lines.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 2215056..bf6f79e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -312,7 +312,8 @@ parser_string_get(struct parser_context *ctx)
value_length = i;
break;
}
-   if (value_length < 0)   /* '\0' was not included in the length */
+   /* '\0' was not included in the length */
+   if (value_length < 0)
value_length = nscan;
value = kmalloc(value_length + 1, GFP_KERNEL);
if (!value)
@@ -1023,7 +1024,8 @@ parahotplug_request_destroy(struct parahotplug_request 
*req)
 }
 
 static LIST_HEAD(parahotplug_request_list);
-static DEFINE_SPINLOCK(parahotplug_request_list_lock); /* lock for above */
+/* lock for above */
+static DEFINE_SPINLOCK(parahotplug_request_list_lock);
 
 /*
  * parahotplug_request_complete() - mark request as complete
@@ -1326,8 +1328,8 @@ static int unisys_vmcall(unsigned long tuple, unsigned 
long param)
goto error;
 
return 0;
-
-error: /* Need to convert from VMCALL error codes to Linux */
+/* Need to convert from VMCALL error codes to Linux */
+error:
switch (result) {
case VMCALL_RESULT_INVALID_PARAM:
return -EINVAL;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND] staging: sm750fb: avoid conflicting vesafb

2017-06-30 Thread Sudip Mukherjee
From: Teddy Wang 

If vesafb is enabled in the config then /dev/fb0 is created by vesa
and this sm750 driver gets fb1, fb2. But we need to be fb0 and fb1 to
effectively work with xorg.
So if it has been alloted fb1, then try to remove the other fb0.

Cc:  # v4.4+
Signed-off-by: Teddy Wang 
Signed-off-by: Sudip Mukherjee 
---

In the previous send, why #ifdef is used was asked.
https://lkml.org/lkml/2017/6/25/57

Answered at: https://lkml.org/lkml/2017/6/25/69
Also pasting here for reference.

'Did a quick research into "why".
The patch d8801e4df91e ("x86/PCI: Set IORESOURCE_ROM_SHADOW only for the
default VGA device") has started setting IORESOURCE_ROM_SHADOW in flags
for a default VGA device and that is being done only for x86.
And so, we will need that #ifdef to check IORESOURCE_ROM_SHADOW as that
needs to be checked only for a x86 and not for other arch.'

 drivers/staging/sm750fb/sm750.c | 24 
 1 file changed, 24 insertions(+)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index d5934f3..8199dbe 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1053,6 +1053,26 @@ static int sm750fb_frambuffer_alloc(struct sm750_dev 
*sm750_dev, int fbidx)
return err;
 }
 
+static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
+{
+   struct apertures_struct *ap;
+   bool primary = false;
+
+   ap = alloc_apertures(1);
+   if (!ap)
+   return -ENOMEM;
+
+   ap->ranges[0].base = pci_resource_start(pdev, 0);
+   ap->ranges[0].size = pci_resource_len(pdev, 0);
+#ifdef CONFIG_X86
+   primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+   IORESOURCE_ROM_SHADOW;
+#endif
+   remove_conflicting_framebuffers(ap, "sm750_fb1", primary);
+   kfree(ap);
+   return 0;
+}
+
 static int lynxfb_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
 {
@@ -1061,6 +1081,10 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
int fbidx;
int err;
 
+   err = lynxfb_kick_out_firmware_fb(pdev);
+   if (err)
+   return err;
+
/* enable device */
err = pcim_enable_device(pdev);
if (err)
-- 
1.9.1

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


[PATCH 1/4] staging: vt6656: Add spaces between operators

2017-06-30 Thread Simon Sandström
Fixes checkpatch.pl warnings "spaces preferred around that ".

Signed-off-by: Simon Sandström 
---
 drivers/staging/vt6656/device.h   | 2 +-
 drivers/staging/vt6656/firmware.c | 2 +-
 drivers/staging/vt6656/rf.c   | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index 4832666cc580..74715c854856 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -83,7 +83,7 @@
 #define CONFIG_PATH"/etc/vntconfiguration.dat"
 
 #define MAX_UINTS  8
-#define OPTION_DEFAULT { [0 ... MAX_UINTS-1] = -1}
+#define OPTION_DEFAULT { [0 ... MAX_UINTS - 1] = -1}
 
 #define DUPLICATE_RX_CACHE_LENGTH   5
 
diff --git a/drivers/staging/vt6656/firmware.c 
b/drivers/staging/vt6656/firmware.c
index 282f665aacfa..093a6048bd22 100644
--- a/drivers/staging/vt6656/firmware.c
+++ b/drivers/staging/vt6656/firmware.c
@@ -65,7 +65,7 @@ int vnt_download_firmware(struct vnt_private *priv)
 
status = vnt_control_out(priv,
 0,
-0x1200+ii,
+0x1200 + ii,
 0x,
 length,
 buffer);
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 23581afb4211..42ac86747b30 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -643,9 +643,9 @@ int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 
channel)
case RATE_48M:
case RATE_54M:
if (channel > CB_MAX_CHANNEL_24G)
-   power = priv->ofdm_a_pwr_tbl[channel-15];
+   power = priv->ofdm_a_pwr_tbl[channel - 15];
else
-   power = priv->ofdm_pwr_tbl[channel-1];
+   power = priv->ofdm_pwr_tbl[channel - 1];
break;
}
 
-- 
2.11.0

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


[PATCH 0/4] staging: vt6656: Correct checkpatch.pl warnings

2017-06-30 Thread Simon Sandström
Here are some minor checkpatch.pl corrections to staging/vt6656.

I was about to ask before sending these in if you rather see commits
grouped on file or on type of warning, e.g. each commit fixes multiple
types of warnings in a single file versus each commit fixes one type
of warning in multiple files. It was easier to write commit messages
when grouped on type of warning, so that's what I did :-)


- Simon

---

Simon Sandström (4):
  staging: vt6656: Add spaces between operators
  staging: vt6656: Remove unnecessary blank lines
  staging: vt6656: Align function parameters
  staging: vt6656: Use variable instead of its type in sizeof(...)

 drivers/staging/vt6656/device.h   | 2 +-
 drivers/staging/vt6656/firmware.c | 2 +-
 drivers/staging/vt6656/key.h  | 2 +-
 drivers/staging/vt6656/main_usb.c | 5 ++---
 drivers/staging/vt6656/power.c| 6 ++
 drivers/staging/vt6656/rf.c   | 6 +++---
 drivers/staging/vt6656/usbpipe.c  | 4 ++--
 7 files changed, 12 insertions(+), 15 deletions(-)

-- 
2.11.0

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


[PATCH 2/4] staging: vt6656: Remove unnecessary blank lines

2017-06-30 Thread Simon Sandström
Fixes checkpatch.pl warning "Blank lines aren't necessary after an open
brace". Also adds braces to balance if-else statement.

Signed-off-by: Simon Sandström 
---
 drivers/staging/vt6656/power.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6656/power.c b/drivers/staging/vt6656/power.c
index e322b7d8c617..c466e0614bc4 100644
--- a/drivers/staging/vt6656/power.c
+++ b/drivers/staging/vt6656/power.c
@@ -74,16 +74,15 @@ void vnt_enable_power_saving(struct vnt_private *priv, u16 
listen_interval)
vnt_mac_reg_bits_on(priv, MAC_REG_PSCTL, PSCTL_GO2DOZE);
 
if (listen_interval >= 2) {
-
/* clear always listen beacon */
vnt_mac_reg_bits_off(priv, MAC_REG_PSCTL, PSCTL_ALBCN);
 
/* first time set listen next beacon */
vnt_mac_reg_bits_on(priv, MAC_REG_PSCTL, PSCTL_LNBCN);
-   } else
-
+   } else {
/* always listen beacon */
vnt_mac_reg_bits_on(priv, MAC_REG_PSCTL, PSCTL_ALBCN);
+   }
 
dev_dbg(&priv->usb->dev,  "PS:Power Saving Mode Enable...\n");
 }
@@ -100,7 +99,6 @@ void vnt_enable_power_saving(struct vnt_private *priv, u16 
listen_interval)
 
 void vnt_disable_power_saving(struct vnt_private *priv)
 {
-
/* disable power saving hw function */
vnt_control_out(priv, MESSAGE_TYPE_DISABLE_PS, 0,
0, 0, NULL);
-- 
2.11.0

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


[PATCH 3/4] staging: vt6656: Align function parameters

2017-06-30 Thread Simon Sandström
Fixes checkpatch.pl warnings "Alignment should match open parenthesis".

Signed-off-by: Simon Sandström 
---
 drivers/staging/vt6656/key.h | 2 +-
 drivers/staging/vt6656/rf.c  | 2 +-
 drivers/staging/vt6656/usbpipe.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6656/key.h b/drivers/staging/vt6656/key.h
index 906d3454591d..cfc6c2131536 100644
--- a/drivers/staging/vt6656/key.h
+++ b/drivers/staging/vt6656/key.h
@@ -46,6 +46,6 @@
 int vnt_key_init_table(struct vnt_private *priv);
 
 int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
- struct ieee80211_vif *vif, struct ieee80211_key_conf *key);
+struct ieee80211_vif *vif, struct ieee80211_key_conf *key);
 
 #endif /* __KEY_H__ */
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 42ac86747b30..3a9d19a0b842 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -611,7 +611,7 @@ int vnt_rf_write_embedded(struct vnt_private *priv, u32 
data)
reg_data[3] = (u8)(data >> 24);
 
vnt_control_out(priv, MESSAGE_TYPE_WRITE_IFRF,
-   0, 0, ARRAY_SIZE(reg_data), reg_data);
+   0, 0, ARRAY_SIZE(reg_data), reg_data);
 
return true;
 }
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index dc11a05be8c4..23eaef458556 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -44,7 +44,7 @@
 #define USB_CTL_WAIT   500 /* ms */
 
 int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
-u16 index, u16 length, u8 *buffer)
+   u16 index, u16 length, u8 *buffer)
 {
int status = 0;
u8 *usb_buffer;
@@ -82,7 +82,7 @@ void vnt_control_out_u8(struct vnt_private *priv, u8 reg, u8 
reg_off, u8 data)
 }
 
 int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
-   u16 index, u16 length, u8 *buffer)
+  u16 index, u16 length, u8 *buffer)
 {
int status;
u8 *usb_buffer;
-- 
2.11.0

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


[PATCH 4/4] staging: vt6656: Use variable instead of its type in sizeof(...)

2017-06-30 Thread Simon Sandström
Use sizeof(variable) instead of sizeof(type) in memory allocations to
prevent problems if the variable type changes in the future.

Signed-off-by: Simon Sandström 
---
 drivers/staging/vt6656/main_usb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6656/main_usb.c 
b/drivers/staging/vt6656/main_usb.c
index 095b85567306..cc6d8778fe5b 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -419,8 +419,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
int ii;
 
for (ii = 0; ii < priv->num_tx_context; ii++) {
-   tx_context = kmalloc(sizeof(struct vnt_usb_send_context),
-GFP_KERNEL);
+   tx_context = kmalloc(sizeof(*tx_context), GFP_KERNEL);
if (!tx_context)
goto free_tx;
 
@@ -437,7 +436,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
}
 
for (ii = 0; ii < priv->num_rcb; ii++) {
-   priv->rcb[ii] = kzalloc(sizeof(struct vnt_rcb), GFP_KERNEL);
+   priv->rcb[ii] = kzalloc(sizeof(*priv->rcb[ii]), GFP_KERNEL);
if (!priv->rcb[ii]) {
dev_err(&priv->usb->dev,
"failed to allocate rcb no %d\n", ii);
-- 
2.11.0

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


Re: [PATCH 08/10] x86/hyper-v: use hypercall for remote TLB flush

2017-06-30 Thread kbuild test robot
Hi Vitaly,

[auto build test WARNING on next-20170619]
[cannot apply to tip/x86/core linus/master linux/master v4.12-rc6 v4.12-rc5 
v4.12-rc4 v4.12-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/kys-exchange-microsoft-com/x86-hyper-v-include-hyperv-only-when-CONFIG_HYPERV-is-set/20170626-133601
config: x86_64-randconfig-ws0-07010157 (attached as .config)
compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   arch/x86//hyperv/mmu.c: In function 'hyperv_flush_tlb_others':
>> arch/x86//hyperv/mmu.c:120:2: warning: passing argument 2 of 
>> 'native_flush_tlb_others' from incompatible pointer type [enabled by default]
 native_flush_tlb_others(cpus, mm, start, end);
 ^
   In file included from arch/x86//hyperv/mmu.c:9:0:
   arch/x86/include/asm/tlbflush.h:256:6: note: expected 'const struct 
flush_tlb_info *' but argument is of type 'struct mm_struct *'
void native_flush_tlb_others(const struct cpumask *cpumask,
 ^
   arch/x86//hyperv/mmu.c:120:2: error: too many arguments to function 
'native_flush_tlb_others'
 native_flush_tlb_others(cpus, mm, start, end);
 ^
   In file included from arch/x86//hyperv/mmu.c:9:0:
   arch/x86/include/asm/tlbflush.h:256:6: note: declared here
void native_flush_tlb_others(const struct cpumask *cpumask,
 ^
   arch/x86//hyperv/mmu.c: In function 'hyperv_setup_mmu_ops':
>> arch/x86//hyperv/mmu.c:127:31: warning: assignment from incompatible pointer 
>> type [enabled by default]
  pv_mmu_ops.flush_tlb_others = hyperv_flush_tlb_others;
  ^

vim +/native_flush_tlb_others +120 arch/x86//hyperv/mmu.c

   114  
   115  local_irq_restore(flags);
   116  
   117  if (!(status & HV_HYPERCALL_RESULT_MASK))
   118  return;
   119  do_native:
 > 120  native_flush_tlb_others(cpus, mm, start, end);
   121  }
   122  
   123  void hyperv_setup_mmu_ops(void)
   124  {
   125  if (ms_hyperv.hints & HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED) {
   126  pr_info("Hyper-V: Using hypercall for remote TLB 
flush\n");
 > 127  pv_mmu_ops.flush_tlb_others = hyperv_flush_tlb_others;
   128  }
   129  }
   130  

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


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