Re: [PATCH] staging: pi433: fix sparse warning: missing static

2017-07-23 Thread Marcus Wolf
reviewed-by: Marcus Wolf 

The fixes of this patch are fine, but there are already patches out there,
containing these fixes.

Thanks,
Marcus

> David Wittman  hat am 24. Juli 2017 um 00:46 geschrieben:
>
>
> A few local functions in the pi433 module were getting flagged by Sparse
> for missing declarations, so I added static qualifiers to clean up the
> warnings.
>
> Signed-off-by: David Wittman 
> ---
> drivers/staging/pi433/pi433_if.c | 4 ++--
> drivers/staging/pi433/rf69.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/pi433/pi433_if.c
> b/drivers/staging/pi433/pi433_if.c
> index 1bc478a..46461b4 100644
> --- a/drivers/staging/pi433/pi433_if.c
> +++ b/drivers/staging/pi433/pi433_if.c
> @@ -313,7 +313,7 @@ struct pi433_instance {
>
> /*-*/
>
> -int
> +static int
> pi433_receive(void *data)
> {
> struct pi433_device *dev = data;
> @@ -463,7 +463,7 @@ struct pi433_instance {
> return bytes_total;
> }
>
> -int
> +static int
> pi433_tx_thread(void *data)
> {
> struct pi433_device *device = data;
> diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
> index e391ce7..e5eee84 100644
> --- a/drivers/staging/pi433/rf69.c
> +++ b/drivers/staging/pi433/rf69.c
> @@ -433,7 +433,7 @@ int rf69_set_dc_cut_off_frequency_during_afc(struct
> spi_device *spi, enum dccPer
> return rf69_set_dc_cut_off_frequency_intern(spi, REG_AFCBW, dccPercent);
> }
>
> -int rf69_set_bandwidth_intern(struct spi_device *spi, u8 reg, enum mantisse
> mantisse, u8 exponent)
> +static int rf69_set_bandwidth_intern(struct spi_device *spi, u8 reg, enum
> mantisse mantisse, u8 exponent)
> {
> u8 newValue;
>
> --
> 1.9.1
>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH] Staging : unisys : visorbus : visorbus_main: Fixed a brace cdoing style issue

2017-07-23 Thread Kershner, David A
> -Original Message-
> From: Himanshu Jha [mailto:himanshujha199...@gmail.com]
> Subject: [PATCH] Staging : unisys : visorbus : visorbus_main: Fixed a brace
> cdoing style issue
> 
> Fixed coding style issue for function declaration.
> 

This doesn't apply to Greg's branch, fix was already applied. Patch that
fixed it was:

7b9de71b staging: unisys: visorbus: fix improper bracket blocks

Thanks, 
David Kershner

> Signed-off-by: Himanshu Jha 
> ---
>  drivers/staging/unisys/visorbus/visorbus_main.c | 18 --
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c
> b/drivers/staging/unisys/visorbus/visorbus_main.c
> index 1c785dd..c564962 100644
> --- a/drivers/staging/unisys/visorbus/visorbus_main.c
> +++ b/drivers/staging/unisys/visorbus/visorbus_main.c
> @@ -270,7 +270,8 @@ static const struct attribute_group
> *visorbus_channel_groups[] = {
> 
>  static ssize_t partition_handle_show(struct device *dev,
>struct device_attribute *attr,
> -  char *buf) {
> +  char *buf)
> +{
>   struct visor_device *vdev = to_visor_device(dev);
>   u64 handle = visorchannel_get_clientpartition(vdev->visorchannel);
> 
> @@ -280,7 +281,8 @@ static DEVICE_ATTR_RO(partition_handle);
> 
>  static ssize_t partition_guid_show(struct device *dev,
>  struct device_attribute *attr,
> -char *buf) {
> +char *buf)
> +{
>   struct visor_device *vdev = to_visor_device(dev);
> 
>   return sprintf(buf, "{%pUb}\n", >partition_uuid);
> @@ -289,7 +291,8 @@ static DEVICE_ATTR_RO(partition_guid);
> 
>  static ssize_t partition_name_show(struct device *dev,
>  struct device_attribute *attr,
> -char *buf) {
> +char *buf)
> +{
>   struct visor_device *vdev = to_visor_device(dev);
> 
>   return sprintf(buf, "%s\n", vdev->name);
> @@ -298,7 +301,8 @@ static DEVICE_ATTR_RO(partition_name);
> 
>  static ssize_t channel_addr_show(struct device *dev,
>struct device_attribute *attr,
> -  char *buf) {
> +  char *buf)
> +{
>   struct visor_device *vdev = to_visor_device(dev);
>   u64 addr = visorchannel_get_physaddr(vdev->visorchannel);
> 
> @@ -308,7 +312,8 @@ static DEVICE_ATTR_RO(channel_addr);
> 
>  static ssize_t channel_bytes_show(struct device *dev,
> struct device_attribute *attr,
> -   char *buf) {
> +   char *buf)
> +{
>   struct visor_device *vdev = to_visor_device(dev);
>   u64 nbytes = visorchannel_get_nbytes(vdev->visorchannel);
> 
> @@ -318,7 +323,8 @@ static DEVICE_ATTR_RO(channel_bytes);
> 
>  static ssize_t channel_id_show(struct device *dev,
>  struct device_attribute *attr,
> -char *buf) {
> +char *buf)
> +{
>   struct visor_device *vdev = to_visor_device(dev);
>   int len = 0;
> 
> --
> 2.7.4

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


[PATCH] staging: pi433: fix sparse warning: missing static

2017-07-23 Thread David Wittman
A few local functions in the pi433 module were getting flagged by Sparse
for missing declarations, so I added static qualifiers to clean up the
warnings.

Signed-off-by: David Wittman 
---
 drivers/staging/pi433/pi433_if.c | 4 ++--
 drivers/staging/pi433/rf69.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 1bc478a..46461b4 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -313,7 +313,7 @@ struct pi433_instance {
 
 /*-*/
 
-int
+static int
 pi433_receive(void *data)
 {
struct pi433_device *dev = data;
@@ -463,7 +463,7 @@ struct pi433_instance {
return bytes_total;
 }
 
-int
+static int
 pi433_tx_thread(void *data)
 {
struct pi433_device *device = data;
diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index e391ce7..e5eee84 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -433,7 +433,7 @@ int rf69_set_dc_cut_off_frequency_during_afc(struct 
spi_device *spi, enum dccPer
return rf69_set_dc_cut_off_frequency_intern(spi, REG_AFCBW, dccPercent);
 }
 
-int rf69_set_bandwidth_intern(struct spi_device *spi, u8 reg, enum mantisse 
mantisse, u8 exponent)
+static int rf69_set_bandwidth_intern(struct spi_device *spi, u8 reg, enum 
mantisse mantisse, u8 exponent)
 {
u8 newValue;
 
-- 
1.9.1

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


[PATCH] Staging : unisys : visorbus : visorbus_main: Fixed a brace cdoing style issue

2017-07-23 Thread Himanshu Jha
Fixed coding style issue for function declaration.

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

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

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


[PATCH] staging: greybus: fix parenthesis alignments

2017-07-23 Thread Diwakar Sharma

Parenthesis alignment issues reported by checkpatch,
fixed here.

Signed-off-by: Diwakar Sharma 
---
 drivers/staging/greybus/interface.c | 40 ++---
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/greybus/interface.c 
b/drivers/staging/greybus/interface.c
index a4fd516..71e5cc2 100644
--- a/drivers/staging/greybus/interface.c
+++ b/drivers/staging/greybus/interface.c
@@ -47,7 +47,7 @@
 static int gb_interface_refclk_set(struct gb_interface *intf, bool enable);
 
 static int gb_interface_dme_attr_get(struct gb_interface *intf,
-   u16 attr, u32 *val)
+u16 attr, u32 *val)
 {
return gb_svc_dme_peer_get(intf->hd->svc, intf->interface_id,
attr, DME_SELECTOR_INDEX_NULL, val);
@@ -64,7 +64,7 @@ static int gb_interface_read_ara_dme(struct gb_interface 
*intf)
 */
if (intf->ddbl1_manufacturer_id != TOSHIBA_DMID) {
dev_err(>dev, "unknown manufacturer %08x\n",
-   intf->ddbl1_manufacturer_id);
+   intf->ddbl1_manufacturer_id);
return -ENODEV;
}
 
@@ -110,7 +110,7 @@ static int gb_interface_read_dme(struct gb_interface *intf)
return ret;
 
if (intf->ddbl1_manufacturer_id == TOSHIBA_DMID &&
-   intf->ddbl1_product_id == TOSHIBA_ES2_BRIDGE_DPID) {
+   intf->ddbl1_product_id == TOSHIBA_ES2_BRIDGE_DPID) {
intf->quirks |= GB_INTERFACE_QUIRK_NO_GMP_IDS;
intf->quirks |= GB_INTERFACE_QUIRK_NO_INIT_STATUS;
}
@@ -144,7 +144,7 @@ static int gb_interface_route_create(struct gb_interface 
*intf)
ret = gb_svc_intf_device_id(svc, intf_id, device_id);
if (ret) {
dev_err(>dev, "failed to set device id %u: %d\n",
-   device_id, ret);
+   device_id, ret);
goto err_ida_remove;
}
 
@@ -205,21 +205,21 @@ static int gb_interface_legacy_mode_switch(struct 
gb_interface *intf)
 }
 
 void gb_interface_mailbox_event(struct gb_interface *intf, u16 result,
-   u32 mailbox)
+   u32 mailbox)
 {
mutex_lock(>mutex);
 
if (result) {
dev_warn(>dev,
-   "mailbox event with UniPro error: 0x%04x\n",
-   result);
+"mailbox event with UniPro error: 0x%04x\n",
+result);
goto err_disable;
}
 
if (mailbox != GB_SVC_INTF_MAILBOX_GREYBUS) {
dev_warn(>dev,
-   "mailbox event with unexpected value: 0x%08x\n",
-   mailbox);
+"mailbox event with unexpected value: 0x%08x\n",
+mailbox);
goto err_disable;
}
 
@@ -230,7 +230,7 @@ void gb_interface_mailbox_event(struct gb_interface *intf, 
u16 result,
 
if (!intf->mode_switch) {
dev_warn(>dev, "unexpected mailbox event: 0x%08x\n",
-   mailbox);
+mailbox);
goto err_disable;
}
 
@@ -299,7 +299,7 @@ static void gb_interface_mode_switch_work(struct 
work_struct *work)
ret = gb_interface_enable(intf);
if (ret) {
dev_err(>dev, "failed to re-enable interface: 
%d\n",
-   ret);
+   ret);
gb_interface_deactivate(intf);
}
}
@@ -619,7 +619,7 @@ static ssize_t interface_type_show(struct device *dev,
 };
 
 static umode_t interface_unipro_is_visible(struct kobject *kobj,
-   struct attribute *attr, int n)
+  struct attribute *attr, int n)
 {
struct device *dev = container_of(kobj, struct device, kobj);
struct gb_interface *intf = to_gb_interface(dev);
@@ -634,7 +634,7 @@ static umode_t interface_unipro_is_visible(struct kobject 
*kobj,
 }
 
 static umode_t interface_greybus_is_visible(struct kobject *kobj,
-   struct attribute *attr, int n)
+   struct attribute *attr, int n)
 {
struct device *dev = container_of(kobj, struct device, kobj);
struct gb_interface *intf = to_gb_interface(dev);
@@ -648,7 +648,7 @@ static umode_t interface_greybus_is_visible(struct kobject 
*kobj,
 }
 
 static umode_t interface_power_is_visible(struct kobject *kobj,
-   struct attribute *attr, int n)
+ 

[PATCH] staging: imx: fix non-static declarations

2017-07-23 Thread JB Van Puyvelde
Add static keywords to fix this kind of sparse warnings:
warning: symbol 'imx_t_vcm_timing' was not declared. Should it be static?

Signed-off-by: JB Van Puyvelde 
---
 drivers/staging/media/atomisp/i2c/imx/imx.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/imx/imx.c 
b/drivers/staging/media/atomisp/i2c/imx/imx.c
index 408a7b945153..fb32cb2f2dd1 100644
--- a/drivers/staging/media/atomisp/i2c/imx/imx.c
+++ b/drivers/staging/media/atomisp/i2c/imx/imx.c
@@ -1084,7 +1084,7 @@ static int imx_g_bin_factor_y(struct v4l2_subdev *sd, s32 
*val)
return 0;
 }
 
-int imx_vcm_power_up(struct v4l2_subdev *sd)
+static int imx_vcm_power_up(struct v4l2_subdev *sd)
 {
struct imx_device *dev = to_imx_sensor(sd);
if (dev->vcm_driver && dev->vcm_driver->power_up)
@@ -1092,7 +1092,7 @@ int imx_vcm_power_up(struct v4l2_subdev *sd)
return 0;
 }
 
-int imx_vcm_power_down(struct v4l2_subdev *sd)
+static int imx_vcm_power_down(struct v4l2_subdev *sd)
 {
struct imx_device *dev = to_imx_sensor(sd);
if (dev->vcm_driver && dev->vcm_driver->power_down)
@@ -1100,7 +1100,7 @@ int imx_vcm_power_down(struct v4l2_subdev *sd)
return 0;
 }
 
-int imx_vcm_init(struct v4l2_subdev *sd)
+static int imx_vcm_init(struct v4l2_subdev *sd)
 {
struct imx_device *dev = to_imx_sensor(sd);
if (dev->vcm_driver && dev->vcm_driver->init)
@@ -1108,7 +1108,7 @@ int imx_vcm_init(struct v4l2_subdev *sd)
return 0;
 }
 
-int imx_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
+static int imx_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
 {
struct imx_device *dev = to_imx_sensor(sd);
if (dev->vcm_driver && dev->vcm_driver->t_focus_vcm)
@@ -1116,14 +1116,15 @@ int imx_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
return 0;
 }
 
-int imx_t_focus_abs(struct v4l2_subdev *sd, s32 value)
+static int imx_t_focus_abs(struct v4l2_subdev *sd, s32 value)
 {
struct imx_device *dev = to_imx_sensor(sd);
if (dev->vcm_driver && dev->vcm_driver->t_focus_abs)
return dev->vcm_driver->t_focus_abs(sd, value);
return 0;
 }
-int imx_t_focus_rel(struct v4l2_subdev *sd, s32 value)
+
+static int imx_t_focus_rel(struct v4l2_subdev *sd, s32 value)
 {
struct imx_device *dev = to_imx_sensor(sd);
if (dev->vcm_driver && dev->vcm_driver->t_focus_rel)
@@ -1131,7 +1132,7 @@ int imx_t_focus_rel(struct v4l2_subdev *sd, s32 value)
return 0;
 }
 
-int imx_q_focus_status(struct v4l2_subdev *sd, s32 *value)
+static int imx_q_focus_status(struct v4l2_subdev *sd, s32 *value)
 {
struct imx_device *dev = to_imx_sensor(sd);
if (dev->vcm_driver && dev->vcm_driver->q_focus_status)
@@ -1139,7 +1140,7 @@ int imx_q_focus_status(struct v4l2_subdev *sd, s32 *value)
return 0;
 }
 
-int imx_q_focus_abs(struct v4l2_subdev *sd, s32 *value)
+static int imx_q_focus_abs(struct v4l2_subdev *sd, s32 *value)
 {
struct imx_device *dev = to_imx_sensor(sd);
if (dev->vcm_driver && dev->vcm_driver->q_focus_abs)
@@ -1147,7 +1148,7 @@ int imx_q_focus_abs(struct v4l2_subdev *sd, s32 *value)
return 0;
 }
 
-int imx_t_vcm_slew(struct v4l2_subdev *sd, s32 value)
+static int imx_t_vcm_slew(struct v4l2_subdev *sd, s32 value)
 {
struct imx_device *dev = to_imx_sensor(sd);
if (dev->vcm_driver && dev->vcm_driver->t_vcm_slew)
@@ -1155,7 +1156,7 @@ int imx_t_vcm_slew(struct v4l2_subdev *sd, s32 value)
return 0;
 }
 
-int imx_t_vcm_timing(struct v4l2_subdev *sd, s32 value)
+static int imx_t_vcm_timing(struct v4l2_subdev *sd, s32 value)
 {
struct imx_device *dev = to_imx_sensor(sd);
if (dev->vcm_driver && dev->vcm_driver->t_vcm_timing)
@@ -2105,8 +2106,7 @@ imx_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm 
*param)
return 0;
 }
 
-int
-imx_g_frame_interval(struct v4l2_subdev *sd,
+static int imx_g_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_frame_interval *interval)
 {
struct imx_device *dev = to_imx_sensor(sd);
-- 
2.11.0

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


Re: [PATCH] Staging: greybus: Match alignment with open parenthesis.

2017-07-23 Thread Johan Hovold
On Sun, Jul 23, 2017 at 03:10:53PM +0300, Dan Carpenter wrote:
> On Sun, Jul 23, 2017 at 10:47:43AM +0200, Johan Hovold wrote:
> > On Sun, Jul 23, 2017 at 02:09:57PM +0530, Shreeya Patel wrote:
> > > Alignment should match with open parenthesis.
> > > This fixes the coding style issue.
> > 
> > No, it need not. This is a choice left up to the author, even if
> > checkpatch happens to complain about it with the --strict option.
> > 
> 
> This is staging code.  Don't try to fight checkpatch.pl in staging...
> You're just making work for everyone else (me) who already just reviewed
> this patch and I don't want to review it a few more times when the next
> person sends the exact same patch.

You can just ignore any greybus patches if you prefer.

I've considered patching checkpatch to drop --strict for at least this
subsystem, but not sure it's worth it.

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


[PATCH] staging: comedi: ni_mio_common.c: fix coding style issue

2017-07-23 Thread Christopher Mårtensson
>From 3e90ab52ad9b437d7c09cc667161cdb855c0cc7b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christopher=20M=C3=A5rtensson?= 
Date: Sun, 23 Jul 2017 13:05:09 +0200
Subject: [PATCH] staging: comedi: ni_mio_common.c: fix coding style issue

"checkpatch.pl -f ..." gave
ERROR: open brace '{' following function definitions go on the next line

Signed-off-by: Christopher Mårtensson 
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index 2f7bfc1..398347f 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -1962,7 +1962,8 @@ static unsigned int ni_timer_to_ns(const struct 
comedi_device *dev, int timer)
 static void ni_cmd_set_mite_transfer(struct mite_ring *ring,
 struct comedi_subdevice *sdev,
 const struct comedi_cmd *cmd,
-unsigned int max_count) {
+unsigned int max_count)
+{
 #ifdef PCIDMA
unsigned int nbytes = max_count;
 
-- 
2.7.4

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


Re: [PATCH] Staging: greybus: Match alignment with open parenthesis.

2017-07-23 Thread Dan Carpenter
On Sun, Jul 23, 2017 at 10:47:43AM +0200, Johan Hovold wrote:
> On Sun, Jul 23, 2017 at 02:09:57PM +0530, Shreeya Patel wrote:
> > Alignment should match with open parenthesis.
> > This fixes the coding style issue.
> 
> No, it need not. This is a choice left up to the author, even if
> checkpatch happens to complain about it with the --strict option.
> 

This is staging code.  Don't try to fight checkpatch.pl in staging...
You're just making work for everyone else (me) who already just reviewed
this patch and I don't want to review it a few more times when the next
person sends the exact same patch.

regards,
dan carpenter

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


Re: [PATCH] staging: vboxvideo: remove unused variables

2017-07-23 Thread Michael Thayer
Hello,

22.07.2017 20:17, Hans de Goede wrote:
> Hi,
> 
> On 22-07-17 12:55, Paolo Cretaro wrote:
>> Fix compiler warnings:
>> vbox_mode.c:57:15: warning: variable ‘crtc_id’ set but not used
>> vbox_mode.c:581:25: warning: variable ‘vbox_connector’ set but not used
>>
>> Signed-off-by: Paolo Cretaro 
> 
> Patch looks good to me:
> 
> Acked-by: Hans de Goede 

This is more or less copied and pasted from my reply to Colin King's
patch on the 19th, but it applies equally here.

Looks good to me too.  Not had time to actually apply it yet, but as
said, it looks completely sensible.

Regards
Michael

Acked-by: Michael Thayer 

> Regards,
> 
> Hans
> 
> 
>> ---
>>   drivers/staging/vboxvideo/vbox_mode.c | 5 -
>>   1 file changed, 5 deletions(-)
>>
>> diff --git a/drivers/staging/vboxvideo/vbox_mode.c
>> b/drivers/staging/vboxvideo/vbox_mode.c
>> index f2b85f3256fa..a7eea70a3804 100644
>> --- a/drivers/staging/vboxvideo/vbox_mode.c
>> +++ b/drivers/staging/vboxvideo/vbox_mode.c
>> @@ -54,14 +54,12 @@ static void vbox_do_modeset(struct drm_crtc *crtc,
>>   struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
>>   struct vbox_private *vbox;
>>   int width, height, bpp, pitch;
>> -unsigned int crtc_id;
>>   u16 flags;
>>   s32 x_offset, y_offset;
>> vbox = crtc->dev->dev_private;
>>   width = mode->hdisplay ? mode->hdisplay : 640;
>>   height = mode->vdisplay ? mode->vdisplay : 480;
>> -crtc_id = vbox_crtc->crtc_id;
>>   bpp = crtc->enabled ? CRTC_FB(crtc)->format->cpp[0] * 8 : 32;
>>   pitch = crtc->enabled ? CRTC_FB(crtc)->pitches[0] : width * bpp
>> / 8;
>>   x_offset = vbox->single_framebuffer ? crtc->x : vbox_crtc->x_hint;
>> @@ -578,9 +576,6 @@ static int vbox_mode_valid(struct drm_connector
>> *connector,
>> static void vbox_connector_destroy(struct drm_connector *connector)
>>   {
>> -struct vbox_connector *vbox_connector;
>> -
>> -vbox_connector = to_vbox_connector(connector);
>>   drm_connector_unregister(connector);
>>   drm_connector_cleanup(connector);
>>   kfree(connector);
>>

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

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

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


Re: [PATCH] Staging: greybus: Match alignment with open parenthesis.

2017-07-23 Thread Johan Hovold
On Sun, Jul 23, 2017 at 02:09:57PM +0530, Shreeya Patel wrote:
> Alignment should match with open parenthesis.
> This fixes the coding style issue.

No, it need not. This is a choice left up to the author, even if
checkpatch happens to complain about it with the --strict option.

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


[PATCH] Staging: greybus: Match alignment with open parenthesis.

2017-07-23 Thread Shreeya Patel
Alignment should match with open parenthesis.
This fixes the coding style issue.

Signed-off-by: Shreeya Patel 
---
 drivers/staging/greybus/tools/loopback_test.c | 35 ---
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/greybus/tools/loopback_test.c 
b/drivers/staging/greybus/tools/loopback_test.c
index 32a4369..a29e091a 100644
--- a/drivers/staging/greybus/tools/loopback_test.c
+++ b/drivers/staging/greybus/tools/loopback_test.c
@@ -420,10 +420,10 @@ void log_csv_error(int len, int err)
 }
 
 int format_output(struct loopback_test *t,
-   struct loopback_results *r,
-   const char *dev_name,
-   char *buf, int buf_len,
-   struct tm *tm)
+ struct loopback_results *r,
+ const char *dev_name,
+ char *buf, int buf_len,
+ struct tm *tm)
 {
int len = 0;
 
@@ -535,7 +535,7 @@ static int log_results(struct loopback_test *t)
*/
if (t->file_output && !t->porcelain) {
snprintf(file_name, sizeof(file_name), "%s_%d_%d.csv",
-   t->test_name, t->size, t->iteration_max);
+t->test_name, t->size, t->iteration_max);
 
fd = open(file_name, O_WRONLY | O_CREAT | O_APPEND, 0644);
if (fd < 0) {
@@ -549,8 +549,8 @@ static int log_results(struct loopback_test *t)
continue;
 
len = format_output(t, >devices[i].results,
-   t->devices[i].name,
-   data, sizeof(data), );
+   t->devices[i].name,
+   data, sizeof(data), );
if (t->file_output && !t->porcelain) {
ret = write(fd, data, len);
if (ret == -1)
@@ -562,7 +562,7 @@ static int log_results(struct loopback_test *t)
 
if (t->aggregate_output) {
len = format_output(t, >aggregate_results, "aggregate",
-   data, sizeof(data), );
+   data, sizeof(data), );
if (t->file_output && !t->porcelain) {
ret = write(fd, data, len);
if (ret == -1)
@@ -623,14 +623,13 @@ int find_loopback_devices(struct loopback_test *t)
snprintf(d->name, MAX_STR_LEN, "gb_loopback%u", dev_id);
 
snprintf(d->sysfs_entry, MAX_SYSFS_PATH, "%s%s/",
-   t->sysfs_prefix, d->name);
+t->sysfs_prefix, d->name);
 
snprintf(d->debugfs_entry, MAX_SYSFS_PATH, "%sraw_latency_%s",
-   t->debugfs_prefix, d->name);
+t->debugfs_prefix, d->name);
 
if (t->debug)
-   printf("add %s %s\n", d->sysfs_entry,
-   d->debugfs_entry);
+   printf("add %s %s\n", d->sysfs_entry, d->debugfs_entry);
}
 
ret = 0;
@@ -802,16 +801,14 @@ static void prepare_devices(struct loopback_test *t)
t->iteration_max);
 
if (t->use_async) {
+   write_sysfs_val(t->devices[i].sysfs_entry, "async", 1);
write_sysfs_val(t->devices[i].sysfs_entry,
-   "async", 1);
+   "timeout", t->async_timeout);
write_sysfs_val(t->devices[i].sysfs_entry,
-   "timeout", t->async_timeout);
-   write_sysfs_val(t->devices[i].sysfs_entry,
-   "outstanding_operations_max",
-   t->async_outstanding_operations);
+   "outstanding_operations_max",
+   t->async_outstanding_operations);
} else
-   write_sysfs_val(t->devices[i].sysfs_entry,
-   "async", 0);
+   write_sysfs_val(t->devices[i].sysfs_entry, "async", 0);
}
 }
 
-- 
2.7.4

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


[PATCH] staging: net: wireless: fix badzero.cocci warnings

2017-07-23 Thread kbuild test robot
drivers/staging/esp8089/esp_mac80211.c:596:33-34: WARNING comparing pointer to 0

 Compare pointer-typed values to NULL rather than 0

Semantic patch information:
 This makes an effort to choose between !x and x == NULL.  !x is used
 if it has previously been used with the function used to initialize x.
 This relies on type information.  More type information can be obtained
 using the option -all_includes and the option -I to specify an
 include path.

Generated by: scripts/coccinelle/null/badzero.cocci

Fixes: 5ebdb57b0b15 ("staging: net: wireless: add ESP8089 WiFi driver")
CC: Quentin Schulz 
Signed-off-by: Fengguang Wu 
---

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

--- a/drivers/staging/esp8089/esp_mac80211.c
+++ b/drivers/staging/esp8089/esp_mac80211.c
@@ -593,7 +593,7 @@ static void hw_scan_timeout_report(struc
if (test_and_clear_bit(ESP_WL_FLAG_STOP_TXQ, >wl.flags))
sip_trigger_txq_process(epub->sip);
/*check if normally complete or aborted like timeout/hw error */
-   aborted = (epub->wl.scan_req != 0);
+   aborted = (epub->wl.scan_req != NULL);
 
if (aborted)
epub->wl.scan_req = NULL;
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: net: wireless: add ESP8089 WiFi driver

2017-07-23 Thread kbuild test robot
Hi Quentin,

[auto build test WARNING on next-20170719]
[cannot apply to staging/staging-testing linus/master linux/master v4.13-rc1 
v4.12 v4.12-rc7 v4.13-rc1]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Quentin-Schulz/add-ESP8089-WiFi-chip-driver/20170723-143744
config: blackfin-allyesconfig (attached as .config)
compiler: bfin-uclinux-gcc (GCC) 6.2.0
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=blackfin 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/staging//esp8089/esp_sip.c: In function 'sip_txq_process':
>> drivers/staging//esp8089/esp_sip.c:797:32: warning: 'offset' may be used 
>> uninitialized in this function [-Wmaybe-uninitialized]
 memcpy(sip->tx_aggr_write_ptr + offset, skb->data, skb->len);
~~~^~~~
   drivers/staging//esp8089/esp_sip.c:700:14: note: 'offset' was declared here
 u32 tx_len, offset;
 ^~
   drivers/staging//esp8089/esp_sip.c: In function 'sip_poll_resetting_event':
>> drivers/staging//esp8089/esp_sip.c:1662:5: warning: 'ret' may be used 
>> uninitialized in this function [-Wmaybe-uninitialized]
 if (!ret) {
^
--
   drivers/staging//esp8089/esp_mac80211.c: In function 'esp_op_set_key':
>> drivers/staging//esp8089/esp_mac80211.c:529:6: warning: 'index' may be used 
>> uninitialized in this function [-Wmaybe-uninitialized]
  map[index].flag = 0;
 ^

vim +/offset +797 drivers/staging//esp8089/esp_sip.c

   691  
   692  /* setup sip header and tx info, copy pkt into aggr buf */
   693  static int sip_pack_pkt(struct esp_sip *sip, struct sk_buff *skb, int 
*pm_state)
   694  {
   695  struct ieee80211_tx_info *itx_info;
   696  struct sip_hdr *shdr;
   697  struct ieee80211_hdr *wh;
   698  struct esp_vif *evif;
   699  struct esp_node *node;
   700  u32 tx_len, offset;
   701  bool is_data = true;
   702  u8 sta_index;
   703  int alg;
   704  
   705  itx_info = IEEE80211_SKB_CB(skb);
   706  if (itx_info->flags == 0x) {
   707  shdr = (struct sip_hdr *)skb->data;
   708  is_data = false;
   709  tx_len = skb->len;
   710  } else {
   711  wh = (struct ieee80211_hdr *)skb->data;
   712  evif = (struct esp_vif 
*)itx_info->control.vif->drv_priv;
   713  /* update sip header */
   714  shdr = (struct sip_hdr *)sip->tx_aggr_write_ptr;
   715  
   716  shdr->fc[0] = 0;
   717  shdr->fc[1] = 0;
   718  
   719  if (itx_info->flags & IEEE80211_TX_CTL_AMPDU)
   720  SIP_HDR_SET_TYPE(shdr->fc[0], SIP_DATA_AMPDU);
   721  else
   722  SIP_HDR_SET_TYPE(shdr->fc[0], SIP_DATA);
   723  
   724  if (!evif->epub) {
   725  sip_tx_status_report(sip, skb, itx_info, false);
   726  atomic_dec(>tx_data_pkt_queued);
   727  return -EINVAL;
   728  }
   729  
   730  /* make room for encrypted pkt */
   731  if (itx_info->control.hw_key) {
   732  alg = 
esp_cipher2alg(itx_info->control.hw_key->cipher);
   733  if (unlikely(alg == -1)) {
   734  sip_tx_status_report(sip, skb, 
itx_info, false);
   735  atomic_dec(>tx_data_pkt_queued);
   736  return -1;
   737  }
   738  
   739  shdr->d_enc_flag = alg + 1;
   740  shdr->d_hw_kid = 
itx_info->control.hw_key->hw_key_idx |
   741  (evif->index << 7);
   742  } else {
   743  shdr->d_enc_flag = 0;
   744  shdr->d_hw_kid = evif->index << 7 | evif->index;
   745  }
   746  
   747  /* update sip tx info */
   748  node = esp_get_node_by_addr(sip->epub, wh->addr1);
   749  if (node)
   750  sta_index = node->index;
   751  else
   752  sta_index = ESP_PUB_MAX_STA + 1;
   753  
   754