[PATCH V3 5/9] Staging: rtl8712: rtl871x_mp_ioctl.h - style fix

2017-03-01 Thread Derek Robson
Fixed style of block comments
Found using checkpatch


Signed-off-by: Derek Robson 
---
Version #1 Introduced lines longer then 80
Version #2 Lacked spaces at either end of comment line


 drivers/staging/rtl8712/rtl871x_mp_ioctl.h | 191 -
 1 file changed, 107 insertions(+), 84 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_mp_ioctl.h 
b/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
index 1102451a733d..8efa6d3388bc 100644
--- a/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
+++ b/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
@@ -150,103 +150,126 @@ uint oid_rt_get_power_mode_hdl(
 #ifdef _RTL871X_MP_IOCTL_C_ /* CAUTION!!! */
 /* This ifdef _MUST_ be left in!! */
 static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = {
-   {1, oid_null_function}, /*0x00  OID_RT_PRO_RESET_DUT */
-   {1, oid_rt_pro_set_data_rate_hdl},  /*0x01*/
-   {1, oid_rt_pro_start_test_hdl}, /*0x02*/
-   {1, oid_rt_pro_stop_test_hdl},  /*0x03*/
-   {1, oid_null_function}, /*0x04  OID_RT_PRO_SET_PREAMBLE*/
-   {1, oid_null_function}, /*0x05  OID_RT_PRO_SET_SCRAMBLER*/
-   {1, oid_null_function}, /*0x06  OID_RT_PRO_SET_FILTER_BB*/
-   {1, oid_null_function}, /*0x07
-* OID_RT_PRO_SET_MANUAL_DIVERS_BB
-*/
-   {1, oid_rt_pro_set_channel_direct_call_hdl},/*0x08*/
-   {1, oid_null_function}, /*0x09
-   * OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL
-   */
-   {1, oid_null_function}, /*0x0A
-   * OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL
-   */
-   {1, oid_rt_pro_set_continuous_tx_hdl},  /*0x0B
-   * OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL
-   */
-   {1, oid_rt_pro_set_single_carrier_tx_hdl}, /*0x0C
-   * OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS
-   */
-   {1, oid_null_function}, /*0x0D
-   * OID_RT_PRO_SET_TX_ANTENNA_BB
-   */
-   {1, oid_rt_pro_set_antenna_bb_hdl}, /*0x0E*/
-   {1, oid_null_function}, /*0x0F  OID_RT_PRO_SET_CR_SCRAMBLER*/
-   {1, oid_null_function}, /*0x10  OID_RT_PRO_SET_CR_NEW_FILTER*/
-   {1, oid_rt_pro_set_tx_power_control_hdl}, /*0x11
-   * OID_RT_PRO_SET_TX_POWER_CONTROL
-   */
-   {1, oid_null_function}, /*0x12  OID_RT_PRO_SET_CR_TX_CONFIG*/
-   {1, oid_null_function}, /*0x13
-* OID_RT_PRO_GET_TX_POWER_CONTROL
-*/
-   {1, oid_null_function}, /*0x14
-* OID_RT_PRO_GET_CR_SIGNAL_QUALITY
-*/
-   {1, oid_null_function}, /*0x15  OID_RT_PRO_SET_CR_SETPOINT*/
-   {1, oid_null_function}, /*0x16  OID_RT_PRO_SET_INTEGRATOR*/
-   {1, oid_null_function}, /*0x17  OID_RT_PRO_SET_SIGNAL_QUALITY*/
-   {1, oid_null_function}, /*0x18  OID_RT_PRO_GET_INTEGRATOR*/
-   {1, oid_null_function}, /*0x19  OID_RT_PRO_GET_SIGNAL_QUALITY*/
-   {1, oid_null_function}, /*0x1A  OID_RT_PRO_QUERY_EEPROM_TYPE*/
-   {1, oid_null_function}, /*0x1B  OID_RT_PRO_WRITE_MAC_ADDRESS*/
-   {1, oid_null_function}, /*0x1C  OID_RT_PRO_READ_MAC_ADDRESS*/
-   {1, oid_null_function}, /*0x1D  OID_RT_PRO_WRITE_CIS_DATA*/
-   {1, oid_null_function}, /*0x1E  OID_RT_PRO_READ_CIS_DATA*/
-   {1, oid_null_function}  /*0x1F  OID_RT_PRO_WRITE_POWER_CONTROL*/
+   /* 0x00 OID_RT_PRO_RESET_DUT */
+   {1, oid_null_function},
+   /* 0x01 */
+   {1, oid_rt_pro_set_data_rate_hdl},
+   /* 0x02 */
+   {1, oid_rt_pro_start_test_hdl},
+   /* 0x03 */
+   {1, oid_rt_pro_stop_test_hdl},
+   /* 0x04 OID_RT_PRO_SET_PREAMBLE */
+   {1, oid_null_function},
+   /* 0x05 OID_RT_PRO_SET_SCRAMBLER */
+   {1, oid_null_function},
+   /* 0x06 OID_RT_PRO_SET_FILTER_BB */
+   {1, oid_null_function},
+   /* 0x07  OID_RT_PRO_SET_MANUAL_DIVERS_BB */
+   {1, oid_null_function},
+   /* 0x08 */
+   {1, oid_rt_pro_set_channel_direct_call_hdl},
+   /* 0x09  OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL */
+   {1, oid_null_function},
+   /* 0x0A  OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL */
+   {1, oid_null_function},
+   /* 0x0B OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL */
+   {1, oid_rt_pro_set_continuous_tx_hdl},
+   /* 0x0C OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS */
+   {1, oid_rt_pro_set_single_carrier_tx_hdl},
+   /* 0x0D OID_RT_PRO_SET_TX_ANTENNA_BB */
+   {1, oid_null_function},
+

[RESEND PATCH V4] staging: vchiq_arm: Add compatibility wrappers for ioctls

2017-03-01 Thread Michael Zoran
This patch adds compatibility wrappers for the ioctls
exposed by vchiq/vc04_services.  The compat ioctls are
completely implemented on top of the native ioctls.  No
existing lines are modified.

While the ideal approach would be to cleanup the existing
code, this path is simplier and easier to review. While
it does have a small runtime performance penality vs
seperating the existing code into wrapper+worker functions,
the penality is small since only the metadata is copied
back onto the 32 bit user mode stack.

The on top of approach is the approach used by several
existing performance critical subsystems of Linux such
as the DRM 3D graphics subsystem.

Testing:

1. A 32 bit chroot was created on a RPI 3 and vchiq_test
was built for armhf.  The usual tests were run such as
vchiq_test -f 10 and vchiq_test -p.

2. This patch was applied to the shipping version of
the Linux kernel used for the RPI and that kernel was
built for arm64. That kernel was used to boot Raspbian.
Many of the builtin features are now functional such
as the "hello_pi" examples, and minecraft_pi.

Changes:
V1 - Complete rewrite of the ioctl code.
V2 - Rewrite of only ioctls that change
 between 32 bit and 64 bit.
V3 - Minor changes.
V4(This Version) - Abandon cleaning up the
 exising code and completely write the
 wrappers on top of the native ioctls.
 No existing lines are changed.

Signed-off-by: Michael Zoran 
---
 .../vc04_services/interface/vchiq_arm/vchiq_arm.c  | 446 +
 1 file changed, 446 insertions(+)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 19bd4ac6e855..90dfa79089d3 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "vchiq_core.h"
@@ -1227,6 +1228,448 @@ vchiq_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
return ret;
 }
 
+#if defined(CONFIG_COMPAT)
+
+struct vchiq_service_params32 {
+   int fourcc;
+   compat_uptr_t callback;
+   compat_uptr_t userdata;
+   short version; /* Increment for non-trivial changes */
+   short version_min; /* Update for incompatible changes */
+};
+
+struct vchiq_create_service32 {
+   struct vchiq_service_params32 params;
+   int is_open;
+   int is_vchi;
+   unsigned int handle; /* OUT */
+};
+
+#define VCHIQ_IOC_CREATE_SERVICE32 \
+   _IOWR(VCHIQ_IOC_MAGIC, 2, struct vchiq_create_service32)
+
+static long
+vchiq_compat_ioctl_create_service(
+   struct file *file,
+   unsigned int cmd,
+   unsigned long arg)
+{
+   VCHIQ_CREATE_SERVICE_T __user *args;
+   struct vchiq_create_service32 __user *ptrargs32 =
+   (struct vchiq_create_service32 __user *)arg;
+   struct vchiq_create_service32 args32;
+   long ret;
+
+   args = compat_alloc_user_space(sizeof(*args));
+   if (!args)
+   return -EFAULT;
+
+   if (copy_from_user(&args32,
+  (struct vchiq_create_service32 __user *)arg,
+  sizeof(args32)))
+   return -EFAULT;
+
+   if (put_user(args32.params.fourcc, &args->params.fourcc) ||
+   put_user(compat_ptr(args32.params.callback),
+&args->params.callback) ||
+   put_user(compat_ptr(args32.params.userdata),
+&args->params.userdata) ||
+   put_user(args32.params.version, &args->params.version) ||
+   put_user(args32.params.version_min,
+&args->params.version_min) ||
+   put_user(args32.is_open, &args->is_open) ||
+   put_user(args32.is_vchi, &args->is_vchi) ||
+   put_user(args32.handle, &args->handle))
+   return -EFAULT;
+
+   ret = vchiq_ioctl(file, VCHIQ_IOC_CREATE_SERVICE, (unsigned long)args);
+
+   if (ret < 0)
+   return ret;
+
+   if (get_user(args32.handle, &args->handle))
+   return -EFAULT;
+
+   if (copy_to_user(&ptrargs32->handle,
+&args32.handle,
+sizeof(args32.handle)))
+   return -EFAULT;
+
+   return ret;
+}
+
+struct vchiq_element32 {
+   compat_uptr_t data;
+   unsigned int size;
+};
+
+struct vchiq_queue_message32 {
+   unsigned int handle;
+   unsigned int count;
+   compat_uptr_t elements;
+};
+
+#define VCHIQ_IOC_QUEUE_MESSAGE32 \
+   _IOW(VCHIQ_IOC_MAGIC,  4, struct vchiq_queue_message32)
+
+static long
+vchiq_compat_ioctl_queue_message(struct file *file,
+unsigned int cmd,
+unsigned long arg)
+{
+   VCHIQ_QUEUE_MESSAGE_T *args;
+   VCHIQ_ELEMENT_T *elements;
+   struct vchiq_queue_messa

[PATCH V2 2/3] staging: bcm2835-audio: select BCM2835_VCHIQ rather then depending on it.

2017-03-01 Thread Michael Zoran
Change the audio's dependency on BCM2835_VCHIQ to a select
since audio support is typically more important to people
then base VCHIQ(which they may not even know what it's for).

Also, with a dependency the audio support would not be
visiable until VCHIQ is selected first, and that may
not be what most people would expect.

Signed-off-by: Michael Zoran 
---
 drivers/staging/vc04_services/bcm2835-audio/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/Kconfig 
b/drivers/staging/vc04_services/bcm2835-audio/Kconfig
index b2e6d90ef1cb..9f536533c257 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/Kconfig
+++ b/drivers/staging/vc04_services/bcm2835-audio/Kconfig
@@ -1,7 +1,8 @@
 config SND_BCM2835
 tristate "BCM2835 Audio"
-depends on ARCH_BCM2835 && BCM2835_VCHIQ && SND
+depends on ARCH_BCM2835 && SND
 select SND_PCM
+select BCM2835_VCHIQ
 help
   Say Y or M if you want to support BCM2835 built in audio
 
-- 
2.11.0

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


[PATCH V2 1/3] staging: vc04_services: Create new BCM_VIDEOCORE setting for VideoCore services.

2017-03-01 Thread Michael Zoran
Create a new memuconfig for Broadcom VideoCore services
since VideoCore is a general term used by Broadcom for a
large family of products that includes more then the BCM2835.

Signed-off-by: Michael Zoran 
---
 drivers/staging/vc04_services/Kconfig | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vc04_services/Kconfig 
b/drivers/staging/vc04_services/Kconfig
index 3b576b0b49ae..eb52cec18c87 100644
--- a/drivers/staging/vc04_services/Kconfig
+++ b/drivers/staging/vc04_services/Kconfig
@@ -1,16 +1,23 @@
-menuconfig BCM2835_VCHIQ
-   tristate "Videocore VCHIQ"
+menuconfig BCM_VIDEOCORE
+   bool "Broadcom VideoCore support"
depends on HAS_DMA
depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && 
!RASPBERRYPI_FIRMWARE)
default y
help
+   Support for Broadcom VideoCore services including
+   the BCM2835 family of products which is used
+   by the Raspberry PI.
+
+if BCM_VIDEOCORE
+
+config BCM2835_VCHIQ
+   tristate "BCM2835 VCHIQ"
+   help
Kernel to VideoCore communication interface for the
BCM2835 family of products.
Defaults to Y when the Broadcom Videocore services
are included in the build, N otherwise.
 
-if BCM2835_VCHIQ
-
 source "drivers/staging/vc04_services/bcm2835-audio/Kconfig"
 
 source "drivers/staging/vc04_services/bcm2835-camera/Kconfig"
-- 
2.11.0

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


[PATCH V2 3/3] staging: bcm2835-camera: select BCM2835_VCHIQ rather then depending on it.

2017-03-01 Thread Michael Zoran
Change the camera's dependency on BCM2835_VCHIQ to a select
since camera support is typically more important to people
then base VCHIQ(which they may not even know what it's for).

Also, with a dependency the camera support would not be
visiable until VCHIQ is selected first, and that may
not be what most people would expect.

Signed-off-by: Michael Zoran 
---
 drivers/staging/vc04_services/bcm2835-camera/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/Kconfig 
b/drivers/staging/vc04_services/bcm2835-camera/Kconfig
index 64be42ef344d..25e534cd3fd1 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/Kconfig
+++ b/drivers/staging/vc04_services/bcm2835-camera/Kconfig
@@ -2,8 +2,8 @@ config VIDEO_BCM2835
tristate "BCM2835 Camera"
depends on MEDIA_SUPPORT
depends on VIDEO_V4L2 && (ARCH_BCM2835 || COMPILE_TEST)
-   depends on BCM2835_VCHIQ
depends on ARM
+   select BCM2835_VCHIQ
select VIDEOBUF2_VMALLOC
help
  Say Y here to enable camera host interface devices for
-- 
2.11.0

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


[PATCH V2 0/3] staging: vc04-services: Create new toplevel config BCM_VIDEOCORE

2017-03-01 Thread Michael Zoran
The current toplevel menu item for vc04-services has this description:

Kernel to VideoCore communication interface for the
BCM2835 family of products.
Defaults to Y when the Broadcom Videocore services
are included in the build, N otherwise.

1. This isn't quite how things work today. Videocore is always included.
2. It's confusing and I don't believe anything about the brand VideoCore
   is specific to the BCM2835.

So what this patch set does is change the toplevel of the menu to be:

menuconfig BCM_VIDEOCORE
bool "Broadcom VideoCore support"
depends on HAS_DMA
depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWAR
E)
default y
help
Support for Broadcom VideoCore services including
the BCM2835 family of products which is used
by the Raspberry PI.

This makes it clear that VideoCore is a general set of Broadcom 
services that may not be exclusive to the BCM2835.

Also, I have kept the BCM2835_VCHIQ config, but changed it to a
simple config rather then a menuconfig.

Finally, I have changed the camera and the audio to select rather 
then depend on BCM2835_VCHIQ.  This allows BCM2835_VCHIQ to be changed
to say a module independenly, but yet the menu still works just like
the original description says that it should.  It is forced in if any
of the specific VideoCore services(like camera) are enabled.

V2 Changes: 
1. Change toplevel config to BCM_VIDEOCORE

Michael Zoran (3):
  staging: vc04_services: Create new BCM_VIDEOCORE setting for VideoCore
services.
  staging: bcm2835-audio: select BCM2835_VCHIQ rather then depending on
it.
  staging: bcm2835-camera: select BCM2835_VCHIQ rather then depending on
it.

 drivers/staging/vc04_services/Kconfig| 15 +++
 drivers/staging/vc04_services/bcm2835-audio/Kconfig  |  3 ++-
 drivers/staging/vc04_services/bcm2835-camera/Kconfig |  2 +-
 3 files changed, 14 insertions(+), 6 deletions(-)

-- 
2.11.0

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


[PATCH] staging: speakup: Alignment match open parenthesis

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

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

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

Re: [PATCH 1/2] staging/vc04_services: initialize cache line size properly

2017-03-01 Thread Michael Zoran
Hi Arnd,

I submitted a change which is in Linux-next now that makes the whole
CACHE_LINE_SIZE macro meaningless.  It now always reads the size from
the DT and errors out with -ENODEV if the property is missing.

I was going to submit a change to delete the macro completely, just
never got to it.

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit
/drivers/staging/vc04_services/interface?id=6cf1bf636a067eb308cb3a8322b
9d6b1844a075d

On Wed, 2017-03-01 at 23:50 +0100, Arnd Bergmann wrote:
> While debugging another problem I noticed that g_cache_line_size gets
> set
> to sizeof(CACHE_LINE_SIZE), which is sizeof(int) or 4, while
> presumably
> CACHE_LINE_SIZE (e.g. 32) was meant.
> 
> This initializes it the way it was meant.
> 
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c |
> 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> index 3aeffcb9c87e..b0e9eb6ff73f 100644
> ---
> a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> +++
> b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
> @@ -78,7 +78,7 @@ struct vchiq_pagelist_info {
>  };
>  
>  static void __iomem *g_regs;
> -static unsigned int g_cache_line_size = sizeof(CACHE_LINE_SIZE);
> +static unsigned int g_cache_line_size = CACHE_LINE_SIZE;
>  static unsigned int g_fragments_size;
>  static char *g_fragments_base;
>  static char *g_free_fragments;
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch 3/3] speakup: add unicode variant of /dev/softsynth

2017-03-01 Thread Samuel Thibault
This adds /dev/softsynthu, along /dev/softsynth, which emits output in
UTF-8 encoding, thus allowing to support 16bit characters.  Most of the
code is shared, only the read function has to behave differently in
latin1 and in unicode mode.  Since Linux only supports 16bit characters,
we can just hardcode the UTF-8 encoding.

Signed-off-by: Samuel Thibault 

Index: linux-4.10/drivers/staging/speakup/speakup_soft.c
===
--- linux-4.10.orig/drivers/staging/speakup/speakup_soft.c
+++ linux-4.10/drivers/staging/speakup/speakup_soft.c
@@ -29,6 +29,7 @@
 
 #define DRV_VERSION "2.6"
 #define SOFTSYNTH_MINOR 26 /* might as well give it one more than /dev/synth */
+#define SOFTSYNTHU_MINOR 27 /* might as well give it one more than /dev/synth 
*/
 #define PROCSPEECH 0x0d
 #define CLEAR_SYNTH 0x18
 
@@ -37,7 +38,7 @@ static void softsynth_release(void);
 static int softsynth_is_alive(struct spk_synth *synth);
 static unsigned char get_index(void);
 
-static struct miscdevice synth_device;
+static struct miscdevice synth_device, synthu_device;
 static int init_pos;
 static int misc_registered;
 
@@ -199,13 +200,13 @@ static int softsynth_close(struct inode
return 0;
 }
 
-static ssize_t softsynth_read(struct file *fp, char __user *buf, size_t count,
- loff_t *pos)
+static ssize_t softsynthx_read(struct file *fp, char __user *buf, size_t count,
+  loff_t *pos, int unicode)
 {
int chars_sent = 0;
char __user *cp;
char *init;
-   char ch;
+   u16 ch;
int empty;
unsigned long flags;
DEFINE_WAIT(wait);
@@ -213,7 +214,8 @@ static ssize_t softsynth_read(struct fil
spin_lock_irqsave(&speakup_info.spinlock, flags);
while (1) {
prepare_to_wait(&speakup_event, &wait, TASK_INTERRUPTIBLE);
-   synth_buffer_skip_nonlatin1();
+   if (!unicode)
+   synth_buffer_skip_nonlatin1();
if (!synth_buffer_empty() || speakup_info.flushing)
break;
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
@@ -232,23 +234,57 @@ static ssize_t softsynth_read(struct fil
 
cp = buf;
init = get_initstring();
-   while (chars_sent < count) {
+
+   /* Keep 3 bytes available for a 16bit UTF-8-encoded character */
+   while (chars_sent <= count - 3) {
if (speakup_info.flushing) {
speakup_info.flushing = 0;
ch = '\x18';
-   } else if (synth_buffer_empty()) {
-   break;
} else if (init[init_pos]) {
ch = init[init_pos++];
} else {
+   if (!unicode)
+   synth_buffer_skip_nonlatin1();
+   if (synth_buffer_empty())
+   break;
ch = synth_buffer_getc();
}
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
-   if (copy_to_user(cp, &ch, 1))
-   return -EFAULT;
+
+   if ((!unicode && ch < 0x100) || (unicode && ch < 0x80)) {
+   u_char c = ch;
+
+   if (copy_to_user(cp, &c, 1))
+   return -EFAULT;
+
+   chars_sent++;
+   cp++;
+   } else if (unicode && ch < 0x800) {
+   u_char s[2] = {
+   0xc0 | (ch >> 6),
+   0x80 | (ch & 0x3f)
+   };
+
+   if (copy_to_user(cp, s, sizeof(s)))
+   return -EFAULT;
+
+   chars_sent += sizeof(s);
+   cp += sizeof(s);
+   } else if (unicode) {
+   u_char s[3] = {
+   0xe0 | (ch >> 12),
+   0x80 | ((ch >> 6) & 0x3f),
+   0x80 | (ch & 0x3f)
+   };
+
+   if (copy_to_user(cp, s, sizeof(s)))
+   return -EFAULT;
+
+   chars_sent += sizeof(s);
+   cp += sizeof(s);
+   }
+
spin_lock_irqsave(&speakup_info.spinlock, flags);
-   chars_sent++;
-   cp++;
}
*pos += chars_sent;
empty = synth_buffer_empty();
@@ -260,6 +296,18 @@ static ssize_t softsynth_read(struct fil
return chars_sent;
 }
 
+static ssize_t softsynth_read(struct file *fp, char __user *buf, size_t count,
+ loff_t *pos)
+{
+   return softsynthx_read(fp, buf, count, pos, 0);
+}
+
+static ssize_t softsynthu_read(struct file *fp, char __user *buf, size_t count,
+  

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

2017-03-01 Thread Samuel Thibault
Hello,

This patch series adds 16bit unicode support to speakup, through three
patches:

- extend synth buffer to 16bit unicode characters
- convert screen reading to 16bit characters
- add unicode variant of /dev/softsynth

Samuel

-- 
Samuel
 hm. I've lost a machine.. literally _lost_. it responds to ping, it 
works completely, I just can't figure out where in my apartment it is.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch 2/3] speakup: convert screen reading to 16bit characters

2017-03-01 Thread Samuel Thibault
This adds 16bit character support to most of the screen reading by
extending characters to u16 throughout the code.

Non-latin1 characters are assumed to be alphabetic type for now.

non-latin1 vt_notifier_call-provided characters are not ignored any
more, and the 16bit character returned by get_char is not truncated any
more. For simplicity, speak_char still only supports latin1 characters.
Its direct mode however does support 16bit characters, so in practice
this will not be a limitation, non-latin1 languages will be handled by
the synthesizer. spelling words does not support direct mode yet, for
simplicity for now it will ignore 16bit characters.

For simplicity again, speakup messages are left in latin1 for now.

Some coding style is fixed along the way.

Signed-off-by: Samuel Thibault 

Index: linux-4.10/drivers/staging/speakup/main.c
===
--- linux-4.10.orig/drivers/staging/speakup/main.c
+++ linux-4.10/drivers/staging/speakup/main.c
@@ -67,7 +67,7 @@ MODULE_PARM_DESC(quiet, "Do not announce
 special_func spk_special_handler;
 
 short spk_pitch_shift, synth_flags;
-static char buf[256];
+static u16 buf[256];
 int spk_attrib_bleep, spk_bleeps, spk_bleep_time = 10;
 int spk_no_intr, spk_spell_delay;
 int spk_key_echo, spk_say_word_ctl;
@@ -112,7 +112,7 @@ enum {
 
 static struct tty_struct *tty;
 
-static void spkup_write(const char *in_buf, int count);
+static void spkup_write(const u16 *in_buf, int count);
 
 static char *phonetic[] = {
"alfa", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel",
@@ -238,7 +238,8 @@ static u_short default_chartab[256] = {
 struct task_struct *speakup_task;
 struct bleep spk_unprocessed_sound;
 static int spk_keydown;
-static u_char spk_lastkey, spk_close_press, keymap_flags;
+static u16 spk_lastkey;
+static u_char spk_close_press, keymap_flags;
 static u_char last_keycode, this_speakup_key;
 static u_long last_spk_jiffy;
 
@@ -426,9 +427,9 @@ static void announce_edge(struct vc_data
spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1));
 }
 
-static void speak_char(u_char ch)
+static void speak_char(u16 ch)
 {
-   char *cp = spk_characters[ch];
+   char *cp;
struct var_t *direct = spk_get_var(DIRECT);
 
if (direct && direct->u.n.value) {
@@ -436,11 +437,15 @@ static void speak_char(u_char ch)
spk_pitch_shift++;
synth_printf("%s", spk_str_caps_start);
}
-   synth_printf("%c", ch);
+   synth_putwc_s(ch);
if (IS_CHAR(ch, B_CAP))
synth_printf("%s", spk_str_caps_stop);
return;
}
+
+   if (ch >= 0x100)
+   return;
+   cp = spk_characters[ch];
if (cp == NULL) {
pr_info("speak_char: cp == NULL!\n");
return;
@@ -486,7 +491,7 @@ static u16 get_char(struct vc_data *vc,
 
 static void say_char(struct vc_data *vc)
 {
-   u_short ch;
+   u16 ch;
 
spk_old_attr = spk_attr;
ch = get_char(vc, (u_short *)spk_pos, &spk_attr);
@@ -496,20 +501,20 @@ static void say_char(struct vc_data *vc)
if (spk_attrib_bleep & 2)
say_attributes(vc);
}
-   speak_char(ch & 0xff);
+   speak_char(ch);
 }
 
 static void say_phonetic_char(struct vc_data *vc)
 {
-   u_short ch;
+   u16 ch;
 
spk_old_attr = spk_attr;
ch = get_char(vc, (u_short *)spk_pos, &spk_attr);
-   if (isascii(ch) && isalpha(ch)) {
+   if (ch <= 0x7f && isalpha(ch)) {
ch &= 0x1f;
synth_printf("%s\n", phonetic[--ch]);
} else {
-   if (IS_CHAR(ch, B_NUM))
+   if (ch < 0x100 && IS_CHAR(ch, B_NUM))
synth_printf("%s ", spk_msg_get(MSG_NUMBER));
speak_char(ch);
}
@@ -551,42 +556,42 @@ static void say_next_char(struct vc_data
 static u_long get_word(struct vc_data *vc)
 {
u_long cnt = 0, tmpx = spk_x, tmp_pos = spk_pos;
-   char ch;
-   u_short attr_ch;
+   u16 ch;
+   u16 attr_ch;
u_char temp;
 
spk_old_attr = spk_attr;
-   ch = (char)get_char(vc, (u_short *)tmp_pos, &temp);
+   ch = get_char(vc, (u_short *)tmp_pos, &temp);
 
 /* decided to take out the sayword if on a space (mis-information */
if (spk_say_word_ctl && ch == SPACE) {
*buf = '\0';
synth_printf("%s\n", spk_msg_get(MSG_SPACE));
return 0;
-   } else if ((tmpx < vc->vc_cols - 2)
-  && (ch == SPACE || ch == 0 || IS_WDLM(ch))
-  && ((char)get_char(vc, (u_short *)&tmp_pos + 1, &temp) >
-  SPACE)) {
+   } else if (tmpx < vc->vc_cols - 2 &&
+  (ch == SPACE || ch == 0 || (ch < 0x100 && IS_WDLM(ch))) &&
+  get_char(vc, (u_short *)&tmp_pos + 1, &temp

[patch 1/3] speakup: extend synth buffer to 16bit unicode characters

2017-03-01 Thread Samuel Thibault
This extends the synth buffer slots to 16bit, so as to hold 16bit
unicode characters.

synth_buffer_getc and synth_buffer_peek now return 16bit characters.
Speech synthesizers which do not support characters beyond latin1 can
use the synth_buffer_skip_nonlatin1() helper to skip the non-latin1
characters before getting or peeking. All synthesizers are made to use
it for now.

This makes synth_buffer_add take a 16bit character. For simplicity for
now, synth_printf is left to using latin1 formats and strings.
synth_putwc, synth_putwc_s, synth_putws and synth_putws_s helpers are
however added to put 16bit characters and strings.

Signed-off-by: Samuel Thibault 

Index: linux-4.10/drivers/staging/speakup/spk_priv.h
===
--- linux-4.10.orig/drivers/staging/speakup/spk_priv.h
+++ linux-4.10/drivers/staging/speakup/spk_priv.h
@@ -48,8 +48,9 @@ unsigned char spk_serial_in_nowait(void)
 int spk_serial_out(const char ch);
 void spk_serial_release(void);
 
-char synth_buffer_getc(void);
-char synth_buffer_peek(void);
+void synth_buffer_skip_nonlatin1(void);
+u16 synth_buffer_getc(void);
+u16 synth_buffer_peek(void);
 int synth_buffer_empty(void);
 struct var_t *spk_get_var(enum var_id_t var_id);
 ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr,
@@ -64,6 +65,10 @@ void spk_synth_flush(struct spk_synth *s
 int spk_synth_is_alive_nop(struct spk_synth *synth);
 int spk_synth_is_alive_restart(struct spk_synth *synth);
 void synth_printf(const char *buf, ...);
+void synth_putwc(u16 wc);
+void synth_putwc_s(u16 wc);
+void synth_putws(const u16 *buf);
+void synth_putws_s(const u16 *buf);
 int synth_request_region(u_long, u_long);
 int synth_release_region(u_long, u_long);
 int synth_add(struct spk_synth *in_synth);
Index: linux-4.10/drivers/staging/speakup/speakup.h
===
--- linux-4.10.orig/drivers/staging/speakup/speakup.h
+++ linux-4.10/drivers/staging/speakup/speakup.h
@@ -70,7 +70,7 @@ void synth_release(void);
 
 void spk_do_flush(void);
 void speakup_start_ttys(void);
-void synth_buffer_add(char ch);
+void synth_buffer_add(u16 ch);
 void synth_buffer_clear(void);
 void speakup_clear_selection(void);
 int speakup_set_selection(struct tty_struct *tty);
Index: linux-4.10/drivers/staging/speakup/synth.c
===
--- linux-4.10.orig/drivers/staging/speakup/synth.c
+++ linux-4.10/drivers/staging/speakup/synth.c
@@ -109,6 +109,7 @@ void spk_do_catch_up(struct spk_synth *s
synth->flush(synth);
continue;
}
+   synth_buffer_skip_nonlatin1();
if (synth_buffer_empty()) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
break;
@@ -255,6 +256,35 @@ void synth_printf(const char *fmt, ...)
 }
 EXPORT_SYMBOL_GPL(synth_printf);
 
+void synth_putwc(u16 wc)
+{
+   synth_buffer_add(wc);
+}
+EXPORT_SYMBOL_GPL(synth_putwc);
+
+void synth_putwc_s(u16 wc)
+{
+   synth_buffer_add(wc);
+   synth_start();
+}
+EXPORT_SYMBOL_GPL(synth_putwc_s);
+
+void synth_putws(const u16 *buf)
+{
+   const u16 *p;
+
+   for (p = buf; *p; p++)
+   synth_buffer_add(*p);
+}
+EXPORT_SYMBOL_GPL(synth_putws);
+
+void synth_putws_s(const u16 *buf)
+{
+   synth_putws(buf);
+   synth_start();
+}
+EXPORT_SYMBOL_GPL(synth_putws_s);
+
 static int index_count;
 static int sentence_count;
 
Index: linux-4.10/drivers/staging/speakup/buffers.c
===
--- linux-4.10.orig/drivers/staging/speakup/buffers.c
+++ linux-4.10/drivers/staging/speakup/buffers.c
@@ -7,10 +7,10 @@
 
 #define SYNTH_BUF_SIZE 8192/* currently 8K bytes */
 
-static u_char synth_buffer[SYNTH_BUF_SIZE];/* guess what this is for! */
-static u_char *buff_in = synth_buffer;
-static u_char *buff_out = synth_buffer;
-static u_char *buffer_end = synth_buffer + SYNTH_BUF_SIZE - 1;
+static u16 synth_buffer[SYNTH_BUF_SIZE];   /* guess what this is for! */
+static u16 *buff_in = synth_buffer;
+static u16 *buff_out = synth_buffer;
+static u16 *buffer_end = synth_buffer + SYNTH_BUF_SIZE - 1;
 
 /* These try to throttle applications by stopping the TTYs
  * Note: we need to make sure that we will restart them eventually, which is
@@ -44,13 +44,13 @@ static void speakup_stop_ttys(void)
 
 static int synth_buffer_free(void)
 {
-   int bytes_free;
+   int chars_free;
 
if (buff_in >= buff_out)
-   bytes_free = SYNTH_BUF_SIZE - (buff_in - buff_out);
+   chars_free = SYNTH_BUF_SIZE - (buff_in - buff_out);
else
-   bytes_free = buff_out - buff_in;
-   return bytes_free;
+   chars_free = buff_out - buff_in;
+   return chars_free;
 }
 
 int synth_buffer_empty(void)
@@ -59,7 +59,7 @@ int synth_buff

[PATCH] staging: lustre: fix sparse warning about different address spaces

2017-03-01 Thread Mario Bambagini
fixed the following sparse warning by adding proper cast:
drivers/staging//lustre/lustre/obdclass/obd_config.c:1055:74: warning: 
incorrect type in argument 2 (different address spaces)
drivers/staging//lustre/lustre/obdclass/obd_config.c:1055:74:expected char 
const [noderef] *
drivers/staging//lustre/lustre/obdclass/obd_config.c:1055:74:got char 
*[assigned] sval

Signed-off-by: Mario Bambagini 
---
 drivers/staging/lustre/lustre/obdclass/obd_config.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c 
b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index 9ca84c7..8fce88f 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -1052,7 +1052,8 @@ int class_process_proc_param(char *prefix, struct 
lprocfs_vars *lvars,
 
oldfs = get_fs();
set_fs(KERNEL_DS);
-   rc = var->fops->write(&fakefile, sval,
+   rc = var->fops->write(&fakefile,
+   (const char __user *)sval,
vallen, NULL);
set_fs(oldfs);
}
-- 
2.1.4

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


[PATCH] [media] Staging: media: radio-bcm2048: remove incorrect __exit markups

2017-03-01 Thread Dmitry Torokhov
Even if bus is not hot-pluggable, devices can be unbound from the
driver via sysfs, so we should not be using __exit annotations on
remove() methods. The only exception is drivers registered with
platform_driver_probe() which specifically disables sysfs bind/unbind
attributes.

Signed-off-by: Dmitry Torokhov 
---
 drivers/staging/media/bcm2048/radio-bcm2048.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 37bd439ee08b..1fba377f816b 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -2634,7 +2634,7 @@ static int bcm2048_i2c_driver_probe(struct i2c_client 
*client,
return err;
 }
 
-static int __exit bcm2048_i2c_driver_remove(struct i2c_client *client)
+static int bcm2048_i2c_driver_remove(struct i2c_client *client)
 {
struct bcm2048_device *bdev = i2c_get_clientdata(client);
 
@@ -2673,7 +2673,7 @@ static struct i2c_driver bcm2048_i2c_driver = {
.name   = BCM2048_DRIVER_NAME,
},
.probe  = bcm2048_i2c_driver_probe,
-   .remove = __exit_p(bcm2048_i2c_driver_remove),
+   .remove = bcm2048_i2c_driver_remove,
.id_table   = bcm2048_id,
 };
 
-- 
2.12.0.rc1.440.g5b76565f74-goog


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


[PATCH 2/2] staging/vc04_services: add CONFIG_OF dependency

2017-03-01 Thread Arnd Bergmann
After several hours of debugging this obviously bogus but elaborate
gcc-7.0.1 warning,

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c: In function 
'vchiq_complete_bulk':
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:603:4: 
error: argument 2 null where non-null expected [-Werror=nonnull]
memcpy((char *)page_address(pages[0]) +
^~~
 pagelist->offset,
 ~
 fragments,
 ~~
 head_bytes);
 ~~~
In file included from include/linux/string.h:18:0,
 from include/linux/bitmap.h:8,
 from include/linux/cpumask.h:11,
 from include/linux/interrupt.h:9,
 from 
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:37:
arch/arm/include/asm/string.h:16:15: note: in a call to function 'memcpy' 
declared here
 extern void * memcpy(void *, const void *, __kernel_size_t) __nocapture(2);
   ^~

I have concluded that gcc was technically right in the first place:

vchiq_complete_bulk is an externally visible function that calls
free_pagelist(), which in turn derives a pointer from the global
g_fragments_base variable.

g_fragments_base is initialized in vchiq_platform_init(), but
we only get there if of_property_read_u32() successfully reads the
cache line size. When CONFIG_OF is disabled, this always fails, and
g_fragments_base is guaranteed to be NULL when vchiq_complete_bulk()
gets called.

This adds a CONFIG_OF Kconfig dependency, which is also technically correct
but nonobvious, and thus seems like a good fit for the warning.

Signed-off-by: Arnd Bergmann 
---
 drivers/staging/vc04_services/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/vc04_services/Kconfig 
b/drivers/staging/vc04_services/Kconfig
index e61e4ca064a8..74094fff4367 100644
--- a/drivers/staging/vc04_services/Kconfig
+++ b/drivers/staging/vc04_services/Kconfig
@@ -1,6 +1,7 @@
 config BCM2835_VCHIQ
tristate "Videocore VCHIQ"
depends on HAS_DMA
+   depends on OF
depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && 
!RASPBERRYPI_FIRMWARE)
default y
help
-- 
2.9.0

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


[PATCH 1/2] staging/vc04_services: initialize cache line size properly

2017-03-01 Thread Arnd Bergmann
While debugging another problem I noticed that g_cache_line_size gets set
to sizeof(CACHE_LINE_SIZE), which is sizeof(int) or 4, while presumably
CACHE_LINE_SIZE (e.g. 32) was meant.

This initializes it the way it was meant.

Signed-off-by: Arnd Bergmann 
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 3aeffcb9c87e..b0e9eb6ff73f 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -78,7 +78,7 @@ struct vchiq_pagelist_info {
 };
 
 static void __iomem *g_regs;
-static unsigned int g_cache_line_size = sizeof(CACHE_LINE_SIZE);
+static unsigned int g_cache_line_size = CACHE_LINE_SIZE;
 static unsigned int g_fragments_size;
 static char *g_fragments_base;
 static char *g_free_fragments;
-- 
2.9.0

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


Re: [PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread Fengguang Wu

On Wed, Mar 01, 2017 at 10:58:59PM +0100, Daniel Glöckner wrote:

On Wed, Mar 01, 2017 at 06:30:17PM +0800, kbuild test robot wrote:

drivers/staging/media/atomisp/i2c/imx/imx.c:2486:3-8: No need to set .owner 
here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 



May I ask which repository this patch is based on?


The email is replying to this one, which shows Greg's staging tree.

 Date: Wed, 1 Mar 2017 18:30:16 +0800
 From: kbuild test robot 
 To: Alan Cox 
 Cc: de...@driverdev.osuosl.org, Greg Kroah-Hartman 
, kbuild-...@01.org
 Subject: [kbuild-all] [staging:staging-testing 209/209] 
drivers/staging/media/atomisp/i2c/gc2235.c:37:41: fatal error:
 linux/atomisp_gmin_platform.h: No such file or directory
 
 tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing

 head:   628b2b91d50c74e2475a11a0db5978d9a36d2026
 commit: 628b2b91d50c74e2475a11a0db5978d9a36d2026 [209/209] staging/atomisp: 
Add support for the Intel IPU v2
 config: i386-allmodconfig (attached as .config)
 compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
 reproduce:
 git checkout 628b2b91d50c74e2475a11a0db5978d9a36d2026
 # save the attached .config to linux build tree
 make ARCH=i386


Does Intel finally attempt to upstream the atomisp driver?


It looks so.

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


Re: [PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread Daniel Glöckner
On Wed, Mar 01, 2017 at 06:30:17PM +0800, kbuild test robot wrote:
> drivers/staging/media/atomisp/i2c/imx/imx.c:2486:3-8: No need to set .owner 
> here. The core will do it.
> 
>  Remove .owner field if calls are used which set it automatically
> 
> Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
> 
> CC: Alan Cox 
> Signed-off-by: Fengguang Wu 


May I ask which repository this patch is based on?
Does Intel finally attempt to upstream the atomisp driver?

Best regards,

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


[PATCH] Staging: bcm2835-audio: bcm2835-pcm: fix a brace coding style issue

2017-03-01 Thread Maciej Billewicz
Fix coding style issue.

Signed-off-by: Maciej Billewicz 
---
 drivers/staging/bcm2835-audio/bcm2835-pcm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835-pcm.c 
b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
index 16127e0..18e2f40 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
@@ -317,9 +317,8 @@ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream 
*substream)
err = bcm2835_audio_set_params(alsa_stream, channels,
alsa_stream->params_rate,
alsa_stream->pcm_format_width);
-   if (err < 0) {
+   if (err < 0)
audio_error(" error setting hw params\n");
-   }
 
bcm2835_audio_setup(alsa_stream);
 
-- 
2.7.4

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


Re: [Outreachy kernel] [PATCH] staging: speakup: Comparison to NULL could be written

2017-03-01 Thread Joe Perches
On Wed, 2017-03-01 at 20:58 +0100, Julia Lawall wrote:
> 
> On Thu, 2 Mar 2017, Arushi Singhal wrote:
> 
> > Fixed coding style for null comparisons in speakup driver to be more
> > consistant with the rest of the kernel coding style.

And Arushi, please use checkpatch on your proposed
patches before sending them.

$ ./scripts/checkpatch.pl 
~/staging-speakup-Comparison-to-NULL-could-be-written.patch  --nosummary
WARNING: 'consistant' may be misspelled - perhaps 'consistent'?
#18: 
consistant with the rest of the kernel coding style.

CHECK: Avoid CamelCase: 
#138: FILE: drivers/staging/speakup/main.c:1512:
+   if (!synth || up_flag || spk_shut_up || cursor_track == CT_Off) {

ERROR: space prohibited before that close parenthesis ')'
#147: FILE: drivers/staging/speakup/main.c:1708:
+   if (spk_shut_up || !synth ) {

ERROR: space prohibited before that close parenthesis ')'
#156: FILE: drivers/staging/speakup/main.c:1725:
+   if ((vc->vc_num != fg_console) || spk_shut_up || !synth )

ERROR: space prohibited before that close parenthesis ')'
#183: FILE: drivers/staging/speakup/main.c:1813:
+   if (!p_header )

ERROR: space prohibited before that close parenthesis ')'
#210: FILE: drivers/staging/speakup/main.c:2068:
+   if (!synth )

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


Re: [Outreachy kernel] [PATCH] staging: speakup: Comparison to NULL could be written

2017-03-01 Thread Julia Lawall


On Thu, 2 Mar 2017, Arushi Singhal wrote:

> Fixed coding style for null comparisons in speakup driver to be more
> consistant with the rest of the kernel coding style.
>
> Signed-off-by: Arushi Singhal 
> ---
>  drivers/staging/speakup/fakekey.c  |  2 +-
>  drivers/staging/speakup/kobjects.c |  2 +-
>  drivers/staging/speakup/main.c | 38 
> +++---
>  3 files changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/staging/speakup/fakekey.c 
> b/drivers/staging/speakup/fakekey.c
> index d76da0a1382c..294c74b47224 100644
> --- a/drivers/staging/speakup/fakekey.c
> +++ b/drivers/staging/speakup/fakekey.c
> @@ -56,7 +56,7 @@ int speakup_add_virtual_keyboard(void)
>
>  void speakup_remove_virtual_keyboard(void)
>  {
> - if (virt_keyboard != NULL) {
> + if (virt_keyboard) {
>   input_unregister_device(virt_keyboard);
>   virt_keyboard = NULL;
>   }
> diff --git a/drivers/staging/speakup/kobjects.c 
> b/drivers/staging/speakup/kobjects.c
> index 5d871ec3693c..fdd6e4b33951 100644
> --- a/drivers/staging/speakup/kobjects.c
> +++ b/drivers/staging/speakup/kobjects.c
> @@ -391,7 +391,7 @@ static ssize_t synth_store(struct kobject *kobj, struct 
> kobj_attribute *attr,
>   len--;
>   new_synth_name[len] = '\0';
>   spk_strlwr(new_synth_name);
> - if ((synth != NULL) && (!strcmp(new_synth_name, synth->name))) {
> + if ((synth) && (!strcmp(new_synth_name, synth->name))) {

A variable reference should not have parentheses around it.  The negated
function call doesn't need them either.

>   pr_warn("%s already in use\n", new_synth_name);
>   } else if (synth_init(new_synth_name) != 0) {
>   pr_warn("failed to init synth %s\n", new_synth_name);
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index c2f70ef5b9b3..3d3d62c7a5ef 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -299,7 +299,7 @@ static void speakup_shut_up(struct vc_data *vc)
>   spk_shut_up |= 0x01;
>   spk_parked &= 0xfe;
>   speakup_date(vc);
> - if (synth != NULL)
> + if (synth)
>   spk_do_flush();
>  }
>
> @@ -441,7 +441,7 @@ static void speak_char(u_char ch)
>   synth_printf("%s", spk_str_caps_stop);
>   return;
>   }
> - if (cp == NULL) {
> + if (!cp) {
>   pr_info("speak_char: cp == NULL!\n");
>   return;
>   }
> @@ -1157,7 +1157,7 @@ static void do_handle_shift(struct vc_data *vc, u_char 
> value, char up_flag)
>  {
>   unsigned long flags;
>
> - if (synth == NULL || up_flag || spk_killed)
> + if (!synth || up_flag || spk_killed)
>   return;
>   spin_lock_irqsave(&speakup_info.spinlock, flags);
>   if (cursor_track == read_all_mode) {
> @@ -1195,7 +1195,7 @@ static void do_handle_latin(struct vc_data *vc, u_char 
> value, char up_flag)
>   spin_unlock_irqrestore(&speakup_info.spinlock, flags);
>   return;
>   }
> - if (synth == NULL || spk_killed) {
> + if (!synth || spk_killed) {
>   spin_unlock_irqrestore(&speakup_info.spinlock, flags);
>   return;
>   }
> @@ -1279,7 +1279,7 @@ void spk_reset_default_chars(void)
>
>   /* First, free any non-default */
>   for (i = 0; i < 256; i++) {
> - if ((spk_characters[i] != NULL)
> + if ((spk_characters[i])

An array reference also doesn't need parentheses around it.

>   && (spk_characters[i] != spk_default_chars[i]))

These parentheses are also not needed.

>   kfree(spk_characters[i]);
>   }
> @@ -1321,10 +1321,10 @@ static int speakup_allocate(struct vc_data *vc)
>   int vc_num;
>
>   vc_num = vc->vc_num;
> - if (speakup_console[vc_num] == NULL) {
> + if (!speakup_console[vc_num]) {
>   speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]),
> GFP_ATOMIC);
> - if (speakup_console[vc_num] == NULL)
> + if (!speakup_console[vc_num])
>   return -ENOMEM;
>   speakup_date(vc);
>   } else if (!spk_parked)
> @@ -1373,7 +1373,7 @@ static void kbd_fakekey2(struct vc_data *vc, int 
> command)
>
>  static void read_all_doc(struct vc_data *vc)
>  {
> - if ((vc->vc_num != fg_console) || synth == NULL || spk_shut_up)
> + if ((vc->vc_num != fg_console) || !synth || spk_shut_up)
>   return;
>   if (!synth_supports_indexing())
>   return;
> @@ -1487,7 +1487,7 @@ static int pre_handle_cursor(struct vc_data *vc, u_char 
> value, char up_flag)
>   spin_lock_irqsave(&speakup_info.spinlock, flags);
>   if (cursor_track == read_all_mode) {
>   spk_parked &= 0xfe;
> - if (synth == NULL || up_flag || spk_shut_up) {
> + if (!synth || up_fl

Re: [PATCH] staging: speakup: Comparison to NULL could be written

2017-03-01 Thread David Daney

On 03/01/2017 11:21 AM, Arushi Singhal wrote:

Fixed coding style for null comparisons in speakup driver to be more
consistant with the rest of the kernel coding style.

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

diff --git a/drivers/staging/speakup/fakekey.c 
b/drivers/staging/speakup/fakekey.c
index d76da0a1382c..294c74b47224 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -56,7 +56,7 @@ int speakup_add_virtual_keyboard(void)

 void speakup_remove_virtual_keyboard(void)
 {
-   if (virt_keyboard != NULL) {
+   if (virt_keyboard) {
input_unregister_device(virt_keyboard);
virt_keyboard = NULL;
}
diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index 5d871ec3693c..fdd6e4b33951 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -391,7 +391,7 @@ static ssize_t synth_store(struct kobject *kobj, struct 
kobj_attribute *attr,
len--;
new_synth_name[len] = '\0';
spk_strlwr(new_synth_name);
-   if ((synth != NULL) && (!strcmp(new_synth_name, synth->name))) {
+   if ((synth) && (!strcmp(new_synth_name, synth->name))) {


With the change, the parenthesis are not needed.  In fact were then 
needed before?  There are two sets of unneeded parenthesis, get rid of 
them both.



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


[PATCH] staging: speakup:indentation should use tabs

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

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

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

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


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

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

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

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

Re: [PATCH 2/3] staging: bcm2835-audio: select BCM2835_VCHIQ rather then depending on it.

2017-03-01 Thread Stefan Wahren

> Michael Zoran  hat am 1. März 2017 um 17:39 geschrieben:
> 
> 
> On Wed, 2017-03-01 at 16:51 +0300, Dan Carpenter wrote:
> > On Tue, Feb 28, 2017 at 09:18:56PM +0100, Stefan Wahren wrote:
> > > 
> > > > Michael Zoran  hat am 28. Februar 2017 um
> > > > 19:49 geschrieben:
> > > > 
> > > > 
> > > > Change the audio's dependency on BCM2835_VCHIQ to a select.
> > > > 
> > > > Signed-off-by: Michael Zoran 
> > > > ---
> > > >  drivers/staging/vc04_services/bcm2835-audio/Kconfig | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > > > b/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > > > index b2e6d90ef1cb..479c9e3ace11 100644
> > > > --- a/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > > > +++ b/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > > > @@ -1,7 +1,8 @@
> > > >  config SND_BCM2835
> > > >  tristate "BCM2835 Audio"
> > > > -depends on ARCH_BCM2835 && BCM2835_VCHIQ && SND
> > > > +depends on ARCH_BCM2835 && SND
> > > >  select SND_PCM
> > > > +   select BCM2835_VCHIQ
> > > >  help
> > > >Say Y or M if you want to support BCM2835 built in
> > > > audio
> > > >  
> > > 
> > > AFAIK "depends on" is perferred instead of "select", because it's
> > > causes less issues. Please explain in the commit messages instead
> > > of the cover letter why this patch and patch 3 is necessary.
> > 
> > There is a place for both depends and select.
> > 
> > The thing is that users basically don't care about BCM2835_VCHIQ,
> > they
> > just want audio.  With a depend it shows what they don't care about
> > and
> > hides what they want which is the opposite of how it should be.
> > 
> > Michael's reference to Linus's email is too vague (not a URL) so I
> > have
> > no idea what he's talking about.  Selecting BCM2835_VCHIQ doesn't
> > pull
> > in very much code, and it's all essential anyway.
> > 
> > regards,
> > dan carpenter
> > 
> 
> Thanks Dan, I completely agree with what you are saying.  

I don't have a problem with select. The commit message above only says what the 
patch does, but not why. After reading your explanations i'm okay with them. 
Please use a short version for the commit messages.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: iio: ad9832: Move header file content to source file

2017-03-01 Thread Arushi Singhal
The contents of the header file are used only by this single
source file. Move content into .c and remove .h.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/iio/frequency/ad9832.c | 100 +-
 drivers/staging/iio/frequency/ad9832.h | 128 -
 2 files changed, 99 insertions(+), 129 deletions(-)
 delete mode 100644 drivers/staging/iio/frequency/ad9832.h

diff --git a/drivers/staging/iio/frequency/ad9832.c 
b/drivers/staging/iio/frequency/ad9832.c
index a5b2f068168d..8302ec91b2d7 100644
--- a/drivers/staging/iio/frequency/ad9832.c
+++ b/drivers/staging/iio/frequency/ad9832.c
@@ -20,7 +20,105 @@
 #include 
 #include "dds.h"
 
-#include "ad9832.h"
+#define AD9832_FREQ0LL 0x0
+#define AD9832_FREQ0HL 0x1
+#define AD9832_FREQ0LM 0x2
+#define AD9832_FREQ0HM 0x3
+#define AD9832_FREQ1LL 0x4
+#define AD9832_FREQ1HL 0x5
+#define AD9832_FREQ1LM 0x6
+#define AD9832_FREQ1HM 0x7
+#define AD9832_PHASE0L 0x8
+#define AD9832_PHASE0H 0x9
+#define AD9832_PHASE1L 0xA
+#define AD9832_PHASE1H 0xB
+#define AD9832_PHASE2L 0xC
+#define AD9832_PHASE2H 0xD
+#define AD9832_PHASE3L 0xE
+#define AD9832_PHASE3H 0xF
+
+#define AD9832_PHASE_SYM   0x10
+#define AD9832_FREQ_SYM0x11
+#define AD9832_PINCTRL_EN  0x12
+#define AD9832_OUTPUT_EN   0x13
+
+/* Command Control Bits */
+
+#define AD9832_CMD_PHA8BITSW   0x1
+#define AD9832_CMD_PHA16BITSW  0x0
+#define AD9832_CMD_FRE8BITSW   0x3
+#define AD9832_CMD_FRE16BITSW  0x2
+#define AD9832_CMD_FPSELECT0x6
+#define AD9832_CMD_SYNCSELSRC  0x8
+#define AD9832_CMD_SLEEPRESCLR 0xC
+
+#define AD9832_FREQBIT(11)
+#define AD9832_PHASE(x)(((x) & 3) << 9)
+#define AD9832_SYNCBIT(13)
+#define AD9832_SELSRC  BIT(12)
+#define AD9832_SLEEP   BIT(13)
+#define AD9832_RESET   BIT(12)
+#define AD9832_CLR BIT(11)
+#define CMD_SHIFT  12
+#define ADD_SHIFT  8
+#define AD9832_FREQ_BITS   32
+#define AD9832_PHASE_BITS  12
+#define RES_MASK(bits) ((1 << (bits)) - 1)
+
+/**
+ * struct ad9832_state - driver instance specific data
+ * @spi:   spi_device
+ * @avdd:  supply regulator for the analog section
+ * @dvdd:  supply regulator for the digital section
+ * @mclk:  external master clock
+ * @ctrl_fp:   cached frequency/phase control word
+ * @ctrl_ss:   cached sync/selsrc control word
+ * @ctrl_src:  cached sleep/reset/clr word
+ * @xfer:  default spi transfer
+ * @msg:   default spi message
+ * @freq_xfer: tuning word spi transfer
+ * @freq_msg:  tuning word spi message
+ * @phase_xfer:tuning word spi transfer
+ * @phase_msg: tuning word spi message
+ * @data:  spi transmit buffer
+ * @phase_data:tuning word spi transmit buffer
+ * @freq_data: tuning word spi transmit buffer
+ */
+
+struct ad9832_state {
+   struct spi_device   *spi;
+   struct regulator*avdd;
+   struct regulator*dvdd;
+   unsigned long   mclk;
+   unsigned short  ctrl_fp;
+   unsigned short  ctrl_ss;
+   unsigned short  ctrl_src;
+   struct spi_transfer xfer;
+   struct spi_message  msg;
+   struct spi_transfer freq_xfer[4];
+   struct spi_message  freq_msg;
+   struct spi_transfer phase_xfer[2];
+   struct spi_message  phase_msg;
+   /*
+* DMA (thus cache coherency maintenance) requires the
+* transfer buffers to live in their own cache lines.
+*/
+   union {
+   __be16  freq_data[4]cacheline_aligned;
+   __be16  phase_data[2];
+   __be16  data;
+   };
+};
+
+struct ad9832_platform_data {
+   unsigned long   mclk;
+   unsigned long   freq0;
+   unsigned long   freq1;
+   unsigned short  phase0;
+   unsigned short  phase1;
+   unsigned short  phase2;
+   unsigned short  phase3;
+};
 
 static unsigned long ad9832_calc_freqreg(unsigned long mclk, unsigned long 
fout)
 {
diff --git a/drivers/staging/iio/frequency/ad9832.h 
b/drivers/staging/iio/frequency/ad9832.h
deleted file mode 100644
index 1b08b04482a4..
--- a/drivers/staging/iio/frequency/ad9832.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * AD9832 SPI DDS driver
- *
- * Copyright 2011 Analog Devices Inc.
- *
- * Licensed under the GPL-2 or later.
- */
-#ifndef IIO_DDS_AD9832_H_
-#define IIO_DDS_AD9832_H_
-
-/* Registers */
-
-#define AD9832_FREQ0LL 0x0
-#def

[PATCH] staging: xgifb: Improved coding style

2017-03-01 Thread Arushi Singhal
New variable is added to make the code more readable.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/xgifb/XGI_main_26.c | 29 ++---
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 69ed137337ce..9870ea3b76b4 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -878,30 +878,13 @@ static void XGIfb_post_setmode(struct xgifb_video_info 
*xgifb_info)
}
 
if ((filter >= 0) && (filter <= 7)) {
+   const u8 *f = 
XGI_TV_filter[filter_tb].filter[filter];
pr_debug("FilterTable[%d]-%d: %*ph\n",
-filter_tb, filter,
-4, XGI_TV_filter[filter_tb].
-  filter[filter]);
-   xgifb_reg_set(
-   XGIPART2,
-   0x35,
-   (XGI_TV_filter[filter_tb].
-   filter[filter][0]));
-   xgifb_reg_set(
-   XGIPART2,
-   0x36,
-   (XGI_TV_filter[filter_tb].
-   filter[filter][1]));
-   xgifb_reg_set(
-   XGIPART2,
-   0x37,
-   (XGI_TV_filter[filter_tb].
-   filter[filter][2]));
-   xgifb_reg_set(
-   XGIPART2,
-   0x38,
-   (XGI_TV_filter[filter_tb].
-   filter[filter][3]));
+filter_tb, filter, 4, f);
+   xgifb_reg_set(XGIPART2, 0x35, f[0]);
+   xgifb_reg_set(XGIPART2, 0x36, f[1]);
+   xgifb_reg_set(XGIPART2, 0x37, f[2]);
+   xgifb_reg_set(XGIPART2, 0x38, f[3]);
}
}
}
-- 
2.11.0

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


Re: [PATCH 2/3] staging: bcm2835-audio: select BCM2835_VCHIQ rather then depending on it.

2017-03-01 Thread Michael Zoran
On Wed, 2017-03-01 at 16:51 +0300, Dan Carpenter wrote:
> On Tue, Feb 28, 2017 at 09:18:56PM +0100, Stefan Wahren wrote:
> > 
> > > Michael Zoran  hat am 28. Februar 2017 um
> > > 19:49 geschrieben:
> > > 
> > > 
> > > Change the audio's dependency on BCM2835_VCHIQ to a select.
> > > 
> > > Signed-off-by: Michael Zoran 
> > > ---
> > >  drivers/staging/vc04_services/bcm2835-audio/Kconfig | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > > b/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > > index b2e6d90ef1cb..479c9e3ace11 100644
> > > --- a/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > > +++ b/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > > @@ -1,7 +1,8 @@
> > >  config SND_BCM2835
> > >  tristate "BCM2835 Audio"
> > > -depends on ARCH_BCM2835 && BCM2835_VCHIQ && SND
> > > +depends on ARCH_BCM2835 && SND
> > >  select SND_PCM
> > > + select BCM2835_VCHIQ
> > >  help
> > >    Say Y or M if you want to support BCM2835 built in
> > > audio
> > >  
> > 
> > AFAIK "depends on" is perferred instead of "select", because it's
> > causes less issues. Please explain in the commit messages instead
> > of the cover letter why this patch and patch 3 is necessary.
> 
> There is a place for both depends and select.
> 
> The thing is that users basically don't care about BCM2835_VCHIQ,
> they
> just want audio.  With a depend it shows what they don't care about
> and
> hides what they want which is the opposite of how it should be.
> 
> Michael's reference to Linus's email is too vague (not a URL) so I
> have
> no idea what he's talking about.  Selecting BCM2835_VCHIQ doesn't
> pull
> in very much code, and it's all essential anyway.
> 
> regards,
> dan carpenter
> 

Thanks Dan, I completely agree with what you are saying.  

Longer term, I was thinking that perhaps the core of VCHIQ needs to be
an independent config option itself which is possibly hidden.  Then
when audio or camera is selected(as Dan points out the stuff that
people actually care about), it would also select in the core.

The only complication is that the ioctl interface is useful as well
since it's required in Raspbian for some of the games such as
Minecraft_pi, and for hardware video decoding.

So I was thinking that would be 4 config options under the main menu:
1. VCHIQ Core(Hidden option)
2. VCHIQ API(Selects 1)
3. Audio(Selects 1)
4. Camera(Selects 1)

Linus's post is rather explicit so I'm not going to give a direct
reference or URL, but it's on the DRM archives if people want to find
it.  To sum it up if I understand correctly, someone added a prime
number library(which is something people don't care about) and made
some graphic components depend on it(stuff people see and care about). 
Linus felt that it should work as Dan describes and the prime number
library should get selected by the graphics components.



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


RE: [PATCH 1/1] Drivers: hv: util: on deinit, don't wait the release event, if we shouldn't

2017-03-01 Thread Dexuan Cui
> From: k...@exchange.microsoft.com [mailto:k...@exchange.microsoft.com]
> Sent: Tuesday, February 28, 2017 07:18
> To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org;
> ...
> From: Dexuan Cui 
> 
> If the daemon is NOT running at all, when we disable the util device from
> Hyper-V Manager (or sometimes the host can rescind a util device and then
> re-offer it), we'll hang in util_remove -> hv_kvp_deinit ->
> wait_for_completion(&release_event), because this code path doesn't run:
> hvt_op_release -> ... -> kvp_on_reset -> complete(&release_event).
> 
> Due to this, we even can't reboot the VM properly.
> 
> The patch tracks if the dev file is opened or not, and we only need to
> wait if it's opened.
> 
> Fixes: 5a66fecbf6aa ("Drivers: hv: util: kvp: Fix a rescind processing issue")
> 
> Signed-off-by: Dexuan Cui 
> ...

Please ignore this patch, since Vitaly posted a better fix instead.

Thanks,
-- Dexuan

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


RE: [PATCH] Drivers: hv: util: on deinit, don't wait the release event, if we shouldn't

2017-03-01 Thread Dexuan Cui
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
(c)
> >>> > > int (*on_msg)(void *, int); /* callback on new user 
> >>> > > message */
> >>> >
> >>> > I think we can get away without introducing this new flag, e.g. if we
> >>> > replace release_event with an atomic which will hold the state
> >>> > (open/closed). This will also elimenate possible races above. I can try
> >>> > prototyping a patch if you want me to.
> >>> > --
> >>> >   Vitaly
> >>>
> >>> Thanks for offering the help! Please do. :-)
> >>
> >> BTW, IMO I found another potential issue:
> >> In hvt_op_open -> hvt_reset -> kvp_on_reset(), I think we should call
> >> init_completion() instead of complete()?
> >>
> >
> > To me it looks like we can do better with something different from
> > struct completion, I'll take a look later today.
> 
> Dexuan,
> 
> please take a look at the attached patch. After looking at the code
> again it occured to me that it's going to be easier to move release wait
> to the transport itself. Lightly tested.
> 
>   Vitaly

You made a neat patch, which can fix the bug.

Thank you a lot!

Thanks,
-- Dexuan

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


Re: [PATCH 2/3] staging: bcm2835-audio: select BCM2835_VCHIQ rather then depending on it.

2017-03-01 Thread Dan Carpenter
On Tue, Feb 28, 2017 at 09:18:56PM +0100, Stefan Wahren wrote:
> 
> > Michael Zoran  hat am 28. Februar 2017 um 19:49 
> > geschrieben:
> > 
> > 
> > Change the audio's dependency on BCM2835_VCHIQ to a select.
> > 
> > Signed-off-by: Michael Zoran 
> > ---
> >  drivers/staging/vc04_services/bcm2835-audio/Kconfig | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/vc04_services/bcm2835-audio/Kconfig 
> > b/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > index b2e6d90ef1cb..479c9e3ace11 100644
> > --- a/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > +++ b/drivers/staging/vc04_services/bcm2835-audio/Kconfig
> > @@ -1,7 +1,8 @@
> >  config SND_BCM2835
> >  tristate "BCM2835 Audio"
> > -depends on ARCH_BCM2835 && BCM2835_VCHIQ && SND
> > +depends on ARCH_BCM2835 && SND
> >  select SND_PCM
> > +   select BCM2835_VCHIQ
> >  help
> >Say Y or M if you want to support BCM2835 built in audio
> >  
> 
> AFAIK "depends on" is perferred instead of "select", because it's causes less 
> issues. Please explain in the commit messages instead of the cover letter why 
> this patch and patch 3 is necessary.

There is a place for both depends and select.

The thing is that users basically don't care about BCM2835_VCHIQ, they
just want audio.  With a depend it shows what they don't care about and
hides what they want which is the opposite of how it should be.

Michael's reference to Linus's email is too vague (not a URL) so I have
no idea what he's talking about.  Selecting BCM2835_VCHIQ doesn't pull
in very much code, and it's all essential anyway.

regards,
dan carpenter

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


[staging:staging-testing 203/209] drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h:138:3: warning: the address of '__func__' will always evaluate as 'true'

2017-03-01 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-testing
head:   628b2b91d50c74e2475a11a0db5978d9a36d2026
commit: ab3287407598cb395309b6ec82333037d761130c [203/209] staging: 
vc04_services: bcm2835-camera: Simplify NULL comparisons
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout ab3287407598cb395309b6ec82333037d761130c
# save the attached .config to linux build tree
make.cross ARCH=arm 

All warnings (new ones prefixed by >>):

   In file included from include/media/v4l2-subdev.h:24:0,
from include/media/v4l2-device.h:25,
from 
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:22:
   drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c: In function 
'vidioc_try_fmt_vid_overlay':
>> drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h:138:3: 
>> warning: the address of '__func__' will always evaluate as 'true' [-Waddress]
  !desc ? "" : desc, \
  ^
   include/media/v4l2-common.h:69:44: note: in definition of macro 'v4l2_printk'
 printk(level "%s: " fmt, (dev)->name , ## arg)
   ^~~
>> drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h:135:2: note: 
>> in expansion of macro 'v4l2_dbg'
 v4l2_dbg(level, debug, dev, \
 ^~~~
>> drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:749:2: note: 
>> in expansion of macro 'v4l2_dump_win_format'
 v4l2_dump_win_format(1,
 ^~~~
   drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c: In function 
'vidioc_g_fmt_vid_cap':
   drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h:128:3: 
warning: the address of '__func__' will always evaluate as 'true' [-Waddress]
  !desc ? "" : desc, \
  ^
   include/media/v4l2-common.h:69:44: note: in definition of macro 'v4l2_printk'
 printk(level "%s: " fmt, (dev)->name , ## arg)
   ^~~
   drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h:126:2: note: 
in expansion of macro 'v4l2_dbg'
 v4l2_dbg(level, debug, dev, \
 ^~~~
>> drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:944:2: note: 
>> in expansion of macro 'v4l2_dump_pix_format'
 v4l2_dump_pix_format(1, bcm2835_v4l2_debug, &dev->v4l2_dev, &f->fmt.pix,
 ^~~~
   drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c: In function 
'vidioc_try_fmt_vid_cap':
   drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h:128:3: 
warning: the address of '__func__' will always evaluate as 'true' [-Waddress]
  !desc ? "" : desc, \
  ^
   include/media/v4l2-common.h:69:44: note: in definition of macro 'v4l2_printk'
 printk(level "%s: " fmt, (dev)->name , ## arg)
   ^~~
   drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h:126:2: note: 
in expansion of macro 'v4l2_dbg'
 v4l2_dbg(level, debug, dev, \
 ^~~~
   drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c:997:2: note: 
in expansion of macro 'v4l2_dump_pix_format'
 v4l2_dump_pix_format(1, bcm2835_v4l2_debug, &dev->v4l2_dev, &f->fmt.pix,
 ^~~~

vim +138 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h

   129  (pix_fmt)->width, (pix_fmt)->height, (pix_fmt)->field,  
\
   130  (pix_fmt)->pixelformat, (pix_fmt)->bytesperline,
\
   131  (pix_fmt)->sizeimage, (pix_fmt)->colorspace, 
(pix_fmt)->priv); \
   132  }
   133  #define v4l2_dump_win_format(level, debug, dev, win_fmt, desc)  \
   134  {   \
 > 135  v4l2_dbg(level, debug, dev, \
   136  "%s: w %u h %u l %u t %u  field %u chromakey %06X clip %p " \
   137  "clipcount %u bitmap %p\n", \
 > 138  !desc ? "" : desc,  \
   139  (win_fmt)->w.width, (win_fmt)->w.height, \
   140  (win_fmt)->w.left, (win_fmt)->w.top, \
   141  (win_fmt)->field,   \

---
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


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

2017-03-01 Thread Sumantro
Remove unnecessary whiteshpaces in rtl_wc.

Problems found by checkpatch.pl.

Signed-off-by: Sumantro Mukherjee 
---
Changes since v1:
-Add reason of change
-Add version number to patch
Changes since v2:
-update from name and signed off name
Chnages since v3:
-modified the from name and signed off name
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 8ffb458..78eb871 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -475,12 +475,10 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
return ret;
 }
 
-
 static int _rtl92e_wx_get_scan(struct net_device *dev,
   struct iw_request_info *a,
   union iwreq_data *wrqu, char *b)
 {
-
int ret;
struct r8192_priv *priv = rtllib_priv(dev);
 
@@ -654,7 +652,6 @@ static int _rtl92e_wx_set_wap(struct net_device *dev,
 
 }
 
-
 static int _rtl92e_wx_get_wap(struct net_device *dev,
  struct iw_request_info *info,
  union iwreq_data *wrqu, char *extra)
@@ -664,7 +661,6 @@ static int _rtl92e_wx_get_wap(struct net_device *dev,
return rtllib_wx_get_wap(priv->rtllib, info, wrqu, extra);
 }
 
-
 static int _rtl92e_wx_get_enc(struct net_device *dev,
  struct iw_request_info *info,
  union iwreq_data *wrqu, char *key)
@@ -831,7 +827,6 @@ static int _rtl92e_wx_get_retry(struct net_device *dev,
 {
struct r8192_priv *priv = rtllib_priv(dev);
 
-
wrqu->retry.disabled = 0; /* can't be disabled */
 
if ((wrqu->retry.flags & IW_RETRY_TYPE) ==
@@ -969,7 +964,6 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev,
priv->rtllib->wx_set_enc = 0;
mutex_unlock(&priv->wx_mutex);
return ret;
-
 }
 
 static int _rtl92e_wx_set_auth(struct net_device *dev,
-- 
2.7.4

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


Re: [greybus-dev] [PATCH v5] staging: greybus: loop_backtest: fixed consistent spacing style issue

2017-03-01 Thread Viresh Kumar
On 01-03-17, 02:46, Jonathan Bowie wrote:
> Fixed incosistent spacing around arithmetic operator.
> 
> Signed-off-by: Jonathan Bowie 
> ---
>  v2
>   -fixed subject added changelog
>  v3
>   -CC:ed linux-next incorrectly, added proper summary
>  v4
>   -CC:ed correct mailing list, moved changelog to summary body
>  v5
>   -correctly placed changelog  
> 
>  drivers/staging/greybus/tools/loopback_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

You can still include my

Acked-by: Viresh Kumar 

:)

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


[PATCH] staging: ks7010: Unnecessary parentheses removed and improved coding style.

2017-03-01 Thread Arushi Singhal
Unnecessary parentheses are removed as reported by checkpatch.pl
to make coder nicer and to improve readability.
Also coding style is improved as it's often nicer to read if
 &(foo[0]) is converted to foo like:
 memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_ALEN);
 memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);

Signed-off-by: Arushi Singhal 
---
 drivers/staging/ks7010/ks_hostif.c   | 23 +++
 drivers/staging/ks7010/ks_wlan_net.c | 18 +-
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index ae7cf3ffae8e..946bb784935f 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -239,19 +239,19 @@ int get_ap_information(struct ks_wlan_private *priv, 
struct ap_info_t *ap_info,
*(bp + 1));
ap->ssid.size = SSID_MAX_SIZE;
}
-   memcpy(&(ap->ssid.body[0]), bp + 2, ap->ssid.size);
+   memcpy(ap->ssid.body, bp + 2, ap->ssid.size);
break;
case 1: /* rate */
case 50:/* ext rate */
if ((*(bp + 1) + ap->rate_set.size) <=
RATE_SET_MAX_SIZE) {
-   memcpy(&(ap->rate_set.body[ap->rate_set.size]),
+   memcpy(&ap->rate_set.body[ap->rate_set.size],
   bp + 2, *(bp + 1));
ap->rate_set.size += *(bp + 1);
} else {
DPRINTK(1, "size over :: rate size=%d\n",
(*(bp + 1) + ap->rate_set.size));
-   memcpy(&(ap->rate_set.body[ap->rate_set.size]),
+   memcpy(&ap->rate_set.body[ap->rate_set.size],
   bp + 2,
   RATE_SET_MAX_SIZE - ap->rate_set.size);
ap->rate_set.size +=
@@ -269,7 +269,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct 
ap_info_t *ap_info,
*(bp + 1));
ap->rsn_ie.size = RSN_IE_BODY_MAX;
}
-   memcpy(&(ap->rsn_ie.body[0]), bp + 2, ap->rsn_ie.size);
+   memcpy(ap->rsn_ie.body, bp + 2, ap->rsn_ie.size);
break;
case 221:   /* WPA */
if (!memcmp(bp + 2, "\x00\x50\xf2\x01", 4)) {   /* WPA 
OUI check */
@@ -282,7 +282,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct 
ap_info_t *ap_info,
*(bp + 1));
ap->wpa_ie.size = RSN_IE_BODY_MAX;
}
-   memcpy(&(ap->wpa_ie.body[0]), bp + 2,
+   memcpy(ap->wpa_ie.body, bp + 2,
   ap->wpa_ie.size);
}
break;
@@ -828,13 +828,12 @@ void hostif_scan_indication(struct ks_wlan_private *priv)
if (priv->scan_ind_count != 0) {
for (i = 0; i < priv->aplist.size; i++) {   /* bssid check 
*/
if (!memcmp
-   (&(ap_info->bssid[0]),
-&(priv->aplist.ap[i].bssid[0]), ETH_ALEN)) {
+   (ap_info->bssid,
+priv->aplist.ap[i].bssid, ETH_ALEN)) {
if (ap_info->frame_type ==
FRAME_TYPE_PROBE_RESP)
get_ap_information(priv, ap_info,
-  &(priv->aplist.
-ap[i]));
+  &priv->aplist.ap[i]);
return;
}
}
@@ -2639,7 +2638,7 @@ int hostif_init(struct ks_wlan_private *priv)
 
priv->aplist.size = 0;
for (i = 0; i < LOCAL_APLIST_MAX; i++)
-   memset(&(priv->aplist.ap[i]), 0, sizeof(struct local_ap_t));
+   memset(&priv->aplist.ap[i], 0, sizeof(struct local_ap_t));
priv->infra_status = 0;
priv->current_rate = 4;
priv->connect_status = DISCONNECT_STATUS;
@@ -2662,12 +2661,12 @@ int hostif_init(struct ks_wlan_private *priv)
INIT_WORK(&priv->ks_wlan_wakeup_task, ks_wlan_hw_wakeup_task);
 
/* WPA */
-   memset(&(priv->wpa), 0, sizeof(priv->wpa));
+   memset(&priv->wpa, 0, sizeof(priv->wpa));
priv->wpa.rsn_enabled = 0;
priv->wpa.mic_failure.failure = 0;
priv->wpa.mic_fai

Re: [PATCH v5] staging: greybus: loop_backtest: fixed consistent spacing style issue

2017-03-01 Thread Johan Hovold
On Wed, Mar 01, 2017 at 02:46:30AM -0800, Jonathan Bowie wrote:
> Fixed incosistent spacing around arithmetic operator.
> 
> Signed-off-by: Jonathan Bowie 
> ---
>  v2
>   -fixed subject added changelog
>  v3
>   -CC:ed linux-next incorrectly, added proper summary
>  v4
>   -CC:ed correct mailing list, moved changelog to summary body
>  v5
>   -correctly placed changelog  

All good now! 

Thanks for sticking to it (and nevermind the changelog typo ;) ).

Reviewed-by: Johan Hovold 

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


[PATCH v5] staging: greybus: loop_backtest: fixed consistent spacing style issue

2017-03-01 Thread Jonathan Bowie
Fixed incosistent spacing around arithmetic operator.

Signed-off-by: Jonathan Bowie 
---
 v2
  -fixed subject added changelog
 v3
  -CC:ed linux-next incorrectly, added proper summary
 v4
  -CC:ed correct mailing list, moved changelog to summary body
 v5
  -correctly placed changelog  

 drivers/staging/greybus/tools/loopback_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/tools/loopback_test.c 
b/drivers/staging/greybus/tools/loopback_test.c
index 18d7a3d..d5bb8d2 100644
--- a/drivers/staging/greybus/tools/loopback_test.c
+++ b/drivers/staging/greybus/tools/loopback_test.c
@@ -476,7 +476,7 @@ int format_output(struct loopback_test *t,
r->gbphy_firmware_latency_jitter);
 
} else {
-   len += snprintf(&buf[len], buf_len- len, ",%s,%s,%u,%u,%u",
+   len += snprintf(&buf[len], buf_len - len, ",%s,%s,%u,%u,%u",
t->test_name, dev_name, t->size, t->iteration_max,
r->error);
 
-- 
2.7.4

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


Re: [PATCH v4] staging: greybus: loop_backtest: fixed consistent spacing style issue

2017-03-01 Thread Johan Hovold
On Wed, Mar 01, 2017 at 02:30:02AM -0800, Jonathan Bowie wrote:
> Fixed incosistent spacing around arithmetic operator.
> 
> v2
> -fixed subject, added changelog
> v3
> -CC:ed linux-next incorrectly, added proper summary
> v4
> -CC:ed staging mailing list, moved changelog to summary body

As I mentioned before, the changelog goes below the cut-off line (---)
so that it does not end up in the commit message.

> Signed-off-by: Jonathan Bowie 
> ---

One more try?

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


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

2017-03-01 Thread Vaishali Thakkar

On Wednesday 01 March 2017 03:23 PM, Sumantro wrote:

Remove unnecessary whitespaces in rtl_wc.

Problem found by checkpatch.pl.

Signed-off-by: Sumantro 



You went back to the same state again. :(

Your from and signed-off-by should have this format:

'firstname lastname '


---
Changes since v1:
-Add reason of change
`   -Add version number to patch
-Add full legal name
Changes since v2:
-update from name and signed off name
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 8ffb458..78eb871 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -475,12 +475,10 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
return ret;
 }

-
 static int _rtl92e_wx_get_scan(struct net_device *dev,
   struct iw_request_info *a,
   union iwreq_data *wrqu, char *b)
 {
-
int ret;
struct r8192_priv *priv = rtllib_priv(dev);

@@ -654,7 +652,6 @@ static int _rtl92e_wx_set_wap(struct net_device *dev,

 }

-
 static int _rtl92e_wx_get_wap(struct net_device *dev,
  struct iw_request_info *info,
  union iwreq_data *wrqu, char *extra)
@@ -664,7 +661,6 @@ static int _rtl92e_wx_get_wap(struct net_device *dev,
return rtllib_wx_get_wap(priv->rtllib, info, wrqu, extra);
 }

-
 static int _rtl92e_wx_get_enc(struct net_device *dev,
  struct iw_request_info *info,
  union iwreq_data *wrqu, char *key)
@@ -831,7 +827,6 @@ static int _rtl92e_wx_get_retry(struct net_device *dev,
 {
struct r8192_priv *priv = rtllib_priv(dev);

-
wrqu->retry.disabled = 0; /* can't be disabled */

if ((wrqu->retry.flags & IW_RETRY_TYPE) ==
@@ -969,7 +964,6 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev,
priv->rtllib->wx_set_enc = 0;
mutex_unlock(&priv->wx_mutex);
return ret;
-
 }

 static int _rtl92e_wx_set_auth(struct net_device *dev,



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


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/i2c/gc0310.c:1470:3-8: No need to set .owner 
here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 gc0310.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/i2c/gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/gc0310.c
@@ -1467,7 +1467,6 @@ MODULE_DEVICE_TABLE(acpi, gc0310_acpi_ma
 MODULE_DEVICE_TABLE(i2c, gc0310_id);
 static struct i2c_driver gc0310_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = GC0310_NAME,
.acpi_match_table = ACPI_PTR(gc0310_acpi_match),
},
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/i2c/ov2680.c:1535:3-8: No need to set .owner 
here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 ov2680.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/i2c/ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/ov2680.c
@@ -1532,7 +1532,6 @@ MODULE_DEVICE_TABLE(acpi, ov2680_acpi_ma
 MODULE_DEVICE_TABLE(i2c, ov2680_id);
 static struct i2c_driver ov2680_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = OV2680_NAME,
.acpi_match_table = ACPI_PTR(ov2680_acpi_match),
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/i2c/ap1302.c:1250:3-8: No need to set .owner 
here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 ap1302.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/i2c/ap1302.c
+++ b/drivers/staging/media/atomisp/i2c/ap1302.c
@@ -1247,7 +1247,6 @@ MODULE_DEVICE_TABLE(i2c, ap1302_id);
 
 static struct i2c_driver ap1302_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = AP1302_NAME,
},
.probe = ap1302_probe,
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/i2c/imx/imx.c:2486:3-8: No need to set .owner 
here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 imx.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/i2c/imx/imx.c
+++ b/drivers/staging/media/atomisp/i2c/imx/imx.c
@@ -2483,7 +2483,6 @@ MODULE_DEVICE_TABLE(i2c, imx_ids);
 
 static struct i2c_driver imx_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = IMX_DRIVER,
},
.probe = imx_probe,
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix semicolon.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/pci/atomisp2/./atomisp_v4l2.c:465:2-3: Unneeded 
semicolon
drivers/staging/media/atomisp/pci/atomisp2/./atomisp_v4l2.c:511:2-3: Unneeded 
semicolon


 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 atomisp_v4l2.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/staging/media/atomisp/pci/atomisp2/./atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/./atomisp_v4l2.c
@@ -462,7 +462,7 @@ int atomisp_mrfld_power_down(struct atom
}
/* FIXME: experienced value for delay */
usleep_range(100, 150);
-   };
+   }
 }
 
 
@@ -508,7 +508,7 @@ int atomisp_mrfld_power_up(struct atomis
}
/* FIXME: experienced value for delay */
usleep_range(100, 150);
-   };
+   }
 }
 
 int atomisp_runtime_suspend(struct device *dev)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/i2c/ov2722.c:1352:3-8: No need to set .owner 
here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 ov2722.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/i2c/ov2722.c
+++ b/drivers/staging/media/atomisp/i2c/ov2722.c
@@ -1349,7 +1349,6 @@ MODULE_DEVICE_TABLE(acpi, ov2722_acpi_ma
 
 static struct i2c_driver ov2722_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = OV2722_NAME,
.acpi_match_table = ACPI_PTR(ov2722_acpi_match),
},
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix returnvar.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/pci/atomisp2/./atomisp_ioctl.c:560:5-8: Unneeded 
variable: "ret". Return "0" on line 577


 Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

Please take the patch only if it's a positive warning. Thanks!

 atomisp_ioctl.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/staging/media/atomisp/pci/atomisp2/./atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/./atomisp_ioctl.c
@@ -557,8 +557,6 @@ const struct atomisp_format_bridge *atom
 static int atomisp_querycap(struct file *file, void *fh,
struct v4l2_capability *cap)
 {
-   int ret = 0;
-
memset(cap, 0, sizeof(struct v4l2_capability));
 
WARN_ON(sizeof(DRIVER) > sizeof(cap->driver) ||
@@ -574,7 +572,7 @@ static int atomisp_querycap(struct file
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OUTPUT;
cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
-   return ret;
+   return 0;
 }
 
 /*
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[staging:staging-testing 209/209] drivers/staging/media/atomisp/i2c/gc2235.c:37:41: fatal error: linux/atomisp_gmin_platform.h: No such file or directory

2017-03-01 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-testing
head:   628b2b91d50c74e2475a11a0db5978d9a36d2026
commit: 628b2b91d50c74e2475a11a0db5978d9a36d2026 [209/209] staging/atomisp: Add 
support for the Intel IPU v2
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout 628b2b91d50c74e2475a11a0db5978d9a36d2026
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

>> drivers/staging/media/atomisp/i2c/mt9m114.c:38:41: fatal error: 
>> linux/atomisp_gmin_platform.h: No such file or directory
#include 
^
   compilation terminated.
--
>> drivers/staging/media/atomisp/i2c/gc2235.c:37:41: fatal error: 
>> linux/atomisp_gmin_platform.h: No such file or directory
#include 
^
   compilation terminated.
--
>> drivers/staging/media/atomisp/i2c/ov2722.c:37:41: fatal error: 
>> linux/atomisp_gmin_platform.h: No such file or directory
#include 
^
   compilation terminated.
--
>> drivers/staging/media/atomisp/i2c/ov2680.c:39:41: fatal error: 
>> linux/atomisp_gmin_platform.h: No such file or directory
#include 
^
   compilation terminated.
--
>> drivers/staging/media/atomisp/i2c/gc0310.c:38:41: fatal error: 
>> linux/atomisp_gmin_platform.h: No such file or directory
#include 
^
   compilation terminated.
--
>> drivers/staging/media/atomisp/i2c/libmsrlisthelper.c:23:36: fatal error: 
>> linux/libmsrlisthelper.h: No such file or directory
#include 
   ^
   compilation terminated.
--
>> drivers/staging/media/atomisp/i2c/ap1302.c:21:27: fatal error: 
>> linux/atomisp.h: No such file or directory
#include 
  ^
   compilation terminated.
--
>> drivers/staging/media/atomisp/i2c/lm3554.c:28:26: fatal error: 
>> media/lm3554.h: No such file or directory
#include 
 ^
   compilation terminated.
--
   In file included from 
drivers/staging/media/atomisp/pci/atomisp2/./mmu/sh_mmu_mrfld.c:26:0:
>> drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h:27:27: fatal 
>> error: linux/atomisp.h: No such file or directory
#include 
  ^
   compilation terminated.
--
   In file included from 
drivers/staging/media/atomisp/pci/atomisp2/./mmu/isp_mmu.c:40:0:
>> drivers/staging/media/atomisp/pci/atomisp2/atomisp_internal.h:26:36: fatal 
>> error: linux/atomisp_platform.h: No such file or directory
#include 
   ^
   compilation terminated.
--
   In file included from 
drivers/staging/media/atomisp/pci/atomisp2/./atomisp_acc.c:30:0:
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_acc.h:25:27: fatal 
>> error: linux/atomisp.h: No such file or directory
#include 
  ^
   compilation terminated.
..

coccinelle warnings: (new ones prefixed by >>)

>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_cmd.c:5577:1-3: 
>> WARNING: possible condition with no effect (if == else)
--
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c:758:56-57: 
>> core: first occurrence line 760, second occurrence line 762
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c:740:64-65: 
>> enum_mbus_code: first occurrence line 742, second occurrence line 748
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c:740:64-65: 
>> get_fmt: first occurrence line 743, second occurrence line 749
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c:740:64-65: 
>> get_selection: first occurrence line 744, second occurrence line 751
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c:740:64-65: 
>> link_validate: first occurrence line 746, second occurrence line 753
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c:758:56-57: 
>> pad: first occurrence line 760, second occurrence line 763
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c:740:64-65: 
>> set_fmt: first occurrence line 743, second occurrence line 750
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c:740:64-65: 
>> set_selection: first occurrence line 745, second occurrence line 752
--
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_cmd.c:4436:2-4: ERROR: 
>> test of a variable/field address
--
>> drivers/staging/media/atomisp/pci/atomisp2/./atomisp_cmd.c:1782:2-28: code 
>> aligned with following code on line 1784
--
>> drivers/staging/media/atomisp/i2c/imx/imx.c:458:3-9: preceding lock on line 
>> 453
--
>> drivers/staging/media/atomisp/i2c/ap1302.c:1250:3-8: No need to set .owner 
>> here. The core will do it.
--
>> drivers/staging/media/atomisp/i2c/gc0310.c:1470:3-8: No need to se

[PATCH] staging/atomisp: fix returnvar.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c:161:5-8: Unneeded 
variable: "ret". Return "0" on line 163


 Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

Please take the patch only if it's a positive warning. Thanks!

 atomisp_subdev.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/./atomisp_subdev.c
@@ -158,9 +158,7 @@ uint16_t atomisp_subdev_source_pad(struc
 static long isp_subdev_ioctl(struct v4l2_subdev *sd,
unsigned int cmd, void *arg)
 {
-   int ret = 0;
-
-   return ret;
+   return 0;
 }
 
 /*
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/i2c/mt9m114.c:1946:3-8: No need to set .owner 
here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 mt9m114.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/i2c/mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/mt9m114.c
@@ -1943,7 +1943,6 @@ MODULE_DEVICE_TABLE(acpi, mt9m114_acpi_m
 
 static struct i2c_driver mt9m114_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = "mt9m114",
.acpi_match_table = ACPI_PTR(mt9m114_acpi_match),
},
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix semicolon.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/pci/atomisp2/./atomisp_compat_css20.c:551:3-4: 
Unneeded semicolon


 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 atomisp_compat_css20.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/media/atomisp/pci/atomisp2/./atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/./atomisp_compat_css20.c
@@ -548,7 +548,7 @@ static int __destroy_stream(struct atomi
}
 
usleep_range(100, 200);
-   };
+   }
}
 
stream_env->stream_state = CSS_STREAM_STOPPED;
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/i2c/imx/../ov8858.c:2199:3-8: No need to set 
.owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 ov8858.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/i2c/imx/../ov8858.c
+++ b/drivers/staging/media/atomisp/i2c/imx/../ov8858.c
@@ -2196,7 +2196,6 @@ static struct acpi_device_id ov8858_acpi
 
 static struct i2c_driver ov8858_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = OV8858_NAME,
.acpi_match_table = ACPI_PTR(ov8858_acpi_match),
},
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c:248:3-8: No need 
to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 vlv2_plat_clock.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
+++ b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
@@ -245,7 +245,6 @@ static struct platform_driver vlv2_plat_
.driver = {
.name = "vlv2_plat_clk",
.pm = &vlv2_pm_ops,
-   .owner = THIS_MODULE,
},
 };
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/i2c/gc2235.c:1208:3-8: No need to set .owner 
here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 gc2235.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/i2c/gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/gc2235.c
@@ -1205,7 +1205,6 @@ MODULE_DEVICE_TABLE(acpi, gc2235_acpi_ma
 MODULE_DEVICE_TABLE(i2c, gc2235_id);
 static struct i2c_driver gc2235_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = GC2235_NAME,
.acpi_match_table = ACPI_PTR(gc2235_acpi_match),
},
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/i2c/lm3554.c:986:3-8: No need to set .owner here. 
The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 lm3554.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/i2c/lm3554.c
+++ b/drivers/staging/media/atomisp/i2c/lm3554.c
@@ -983,7 +983,6 @@ MODULE_DEVICE_TABLE(acpi, lm3554_acpi_ma
 
 static struct i2c_driver lm3554_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = LM3554_NAME,
.pm   = &lm3554_pm_ops,
.acpi_match_table = ACPI_PTR(lm3554_acpi_match),
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/atomisp: fix platform_no_drv_owner.cocci warnings

2017-03-01 Thread kbuild test robot
drivers/staging/media/atomisp/i2c/ov5693/ov5693.c:2066:3-8: No need to set 
.owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

CC: Alan Cox 
Signed-off-by: Fengguang Wu 
---

 ov5693.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
+++ b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.c
@@ -2063,7 +2063,6 @@ MODULE_DEVICE_TABLE(acpi, ov5693_acpi_ma
 
 static struct i2c_driver ov5693_driver = {
.driver = {
-   .owner = THIS_MODULE,
.name = OV5693_NAME,
.acpi_match_table = ACPI_PTR(ov5693_acpi_match),
},
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4] staging: greybus: loop_backtest: fixed consistent spacing style issue

2017-03-01 Thread Jonathan Bowie
Fixed incosistent spacing around arithmetic operator.

v2
-fixed subject, added changelog
v3
-CC:ed linux-next incorrectly, added proper summary
v4
-CC:ed staging mailing list, moved changelog to summary body

Signed-off-by: Jonathan Bowie 
---
 drivers/staging/greybus/tools/loopback_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/tools/loopback_test.c 
b/drivers/staging/greybus/tools/loopback_test.c
index 18d7a3d..d5bb8d2 100644
--- a/drivers/staging/greybus/tools/loopback_test.c
+++ b/drivers/staging/greybus/tools/loopback_test.c
@@ -476,7 +476,7 @@ int format_output(struct loopback_test *t,
r->gbphy_firmware_latency_jitter);
 
} else {
-   len += snprintf(&buf[len], buf_len- len, ",%s,%s,%u,%u,%u",
+   len += snprintf(&buf[len], buf_len - len, ",%s,%s,%u,%u,%u",
t->test_name, dev_name, t->size, t->iteration_max,
r->error);
 
-- 
2.7.4

v2 
-fixed summary and commit message
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[staging:staging-testing 209/209] drivers/staging/media/atomisp/i2c/imx/otp_brcc064_e2prom.c:72:3-8: WARNING: invalid free of devm_ allocated data (fwd)

2017-03-01 Thread Julia Lawall
In both of the cited files (only one is shown), buffer is allocated using
devm_kzalloc, so the kfree is not appropriate.

julia

-- Forwarded message --
Date: Wed, 1 Mar 2017 18:12:08 +0800
From: kbuild test robot 
To: kbu...@01.org
Cc: Julia Lawall 
Subject: [staging:staging-testing 209/209]
drivers/staging/media/atomisp/i2c/imx/otp_brcc064_e2prom.c:72:3-8: WARNING:
invalid free of devm_ allocated data


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-testing
head:   628b2b91d50c74e2475a11a0db5978d9a36d2026
commit: 628b2b91d50c74e2475a11a0db5978d9a36d2026 [209/209] staging/atomisp: Add 
support for the Intel IPU v2
:: branch date: 2 hours ago
:: commit date: 2 hours ago

>> drivers/staging/media/atomisp/i2c/imx/otp_brcc064_e2prom.c:72:3-8: WARNING: 
>> invalid free of devm_ allocated data
--
>> drivers/staging/media/atomisp/i2c/imx/otp_e2prom.c:82:3-8: WARNING: invalid 
>> free of devm_ allocated data

git remote add staging 
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
git remote update staging
git checkout 628b2b91d50c74e2475a11a0db5978d9a36d2026
vim +72 drivers/staging/media/atomisp/i2c/imx/otp_brcc064_e2prom.c

628b2b91 Alan Cox 2017-02-17  56u16 addr_buf;
628b2b91 Alan Cox 2017-02-17  57int r;
628b2b91 Alan Cox 2017-02-17  58
628b2b91 Alan Cox 2017-02-17  59msg[0].flags = 0;
628b2b91 Alan Cox 2017-02-17  60msg[0].addr = i2c_addr;
628b2b91 Alan Cox 2017-02-17  61addr_buf = cpu_to_be16(addr & 
0x);
628b2b91 Alan Cox 2017-02-17  62msg[0].len = 2;
628b2b91 Alan Cox 2017-02-17  63msg[0].buf = (u8 *)&addr_buf;
628b2b91 Alan Cox 2017-02-17  64
628b2b91 Alan Cox 2017-02-17  65msg[1].addr = i2c_addr;
628b2b91 Alan Cox 2017-02-17  66msg[1].flags = I2C_M_RD;
628b2b91 Alan Cox 2017-02-17  67msg[1].len = min(max_read_size, 
size - addr);
628b2b91 Alan Cox 2017-02-17  68msg[1].buf = &buffer[addr];
628b2b91 Alan Cox 2017-02-17  69
628b2b91 Alan Cox 2017-02-17  70r = 
i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg));
628b2b91 Alan Cox 2017-02-17  71if (r != ARRAY_SIZE(msg)) {
628b2b91 Alan Cox 2017-02-17 @72kfree(buffer);
628b2b91 Alan Cox 2017-02-17  73dev_err(&client->dev, 
"read failed at 0x%03x\n", addr);
628b2b91 Alan Cox 2017-02-17  74return NULL;
628b2b91 Alan Cox 2017-02-17  75}
628b2b91 Alan Cox 2017-02-17  76}
628b2b91 Alan Cox 2017-02-17  77return buffer;
628b2b91 Alan Cox 2017-02-17  78
628b2b91 Alan Cox 2017-02-17  79  }
628b2b91 Alan Cox 2017-02-17  80

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


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

2017-03-01 Thread Sumantro
Remove unnecessary whitespaces in rtl_wc.

Problem found by checkpatch.pl.

Signed-off-by: Sumantro 
---
Changes since v1:
-Add reason of change
`   -Add version number to patch
-Add full legal name
Changes since v2:
-update from name and signed off name 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 8ffb458..78eb871 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -475,12 +475,10 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
return ret;
 }
 
-
 static int _rtl92e_wx_get_scan(struct net_device *dev,
   struct iw_request_info *a,
   union iwreq_data *wrqu, char *b)
 {
-
int ret;
struct r8192_priv *priv = rtllib_priv(dev);
 
@@ -654,7 +652,6 @@ static int _rtl92e_wx_set_wap(struct net_device *dev,
 
 }
 
-
 static int _rtl92e_wx_get_wap(struct net_device *dev,
  struct iw_request_info *info,
  union iwreq_data *wrqu, char *extra)
@@ -664,7 +661,6 @@ static int _rtl92e_wx_get_wap(struct net_device *dev,
return rtllib_wx_get_wap(priv->rtllib, info, wrqu, extra);
 }
 
-
 static int _rtl92e_wx_get_enc(struct net_device *dev,
  struct iw_request_info *info,
  union iwreq_data *wrqu, char *key)
@@ -831,7 +827,6 @@ static int _rtl92e_wx_get_retry(struct net_device *dev,
 {
struct r8192_priv *priv = rtllib_priv(dev);
 
-
wrqu->retry.disabled = 0; /* can't be disabled */
 
if ((wrqu->retry.flags & IW_RETRY_TYPE) ==
@@ -969,7 +964,6 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev,
priv->rtllib->wx_set_enc = 0;
mutex_unlock(&priv->wx_mutex);
return ret;
-
 }
 
 static int _rtl92e_wx_set_auth(struct net_device *dev,
-- 
2.7.4

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


Re: [PATCH] hv: hide unused label

2017-03-01 Thread Ingo Molnar

* Arnd Bergmann  wrote:

> This new 32-bit warning just showed up:
> 
> arch/x86/hyperv/hv_init.c: In function 'hyperv_init':
> arch/x86/hyperv/hv_init.c:167:1: error: label 'register_msr_cs' defined but 
> not used [-Werror=unused-label]
> 
> The easiest solution is to move the label up into the existing #ifdef that
> has the goto.
> 
> Fixes: dee863b571b0 ("hv: export current Hyper-V clocksource")
> Signed-off-by: Arnd Bergmann 
> ---
>  arch/x86/hyperv/hv_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
> index db64baf0e500..8bef70e7f3cc 100644
> --- a/arch/x86/hyperv/hv_init.c
> +++ b/arch/x86/hyperv/hv_init.c
> @@ -158,13 +158,13 @@ void hyperv_init(void)
>   clocksource_register_hz(&hyperv_cs_tsc, NSEC_PER_SEC/100);
>   return;
>   }
> +register_msr_cs:
>  #endif
>   /*
>* For 32 bit guests just use the MSR based mechanism for reading
>* the partition counter.
>*/
>  
> -register_msr_cs:

Now the warning triggers upstream:

 arch/x86/hyperv/hv_init.c: In function ‘hyperv_init’:
 arch/x86/hyperv/hv_init.c:167:1: warning: label ‘register_msr_cs’ defined but 
not used [-Wunused-label]

Thanks,

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


Re: [PATCH v2] staging: rtl8192e: remove unnecessary whitespace in rtl_wx.c

2017-03-01 Thread Greg KH
On Wed, Mar 01, 2017 at 02:16:38AM +0530, Sumantro wrote:
> Remove unncessary whitespaces in rtl_wc.c.
> 
> Problem found by checkpatch.pl.
> 
> Signed-off-by: Sumantro Mukherjee 

Your "From:" name doesn't match your "Signed-off-by:" name :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel