Re: [RESEND PATCH v2] staging:speakup: Fix alignment with parenthesis.

2017-03-23 Thread Greg Kroah-Hartman
On Thu, Mar 23, 2017 at 07:15:38PM +0530, Arushi Singhal wrote:
> Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".
> 
> Signed-off-by: Arushi Singhal 



I can't take patches sent in html format :(

please fix your email client.

thanks,

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


Re: [PATCH] staging: wilc1000: use kernel define byte order macros

2017-03-23 Thread Robert Perry Hooker
Well, yes, all data is 'endian' one way or another, right? I guess the byte 
order of the tx/rx_buffers is host-endian
(which could be big), or _maybe_ network-endian...

Regards,
Perry

On Thu, 2017-03-23 at 11:33 +0300, Dan Carpenter wrote:
> On Wed, Mar 22, 2017 at 07:53:28PM -0600, Robert Perry Hooker wrote:
> > I don't think buff is an ieee80211_hdr struct. I think it's the rx_buffer 
> > allocated at wilc_wlan.c:1417.
> > 
> 
> The rx_buffer is going to end up filled with endian data, right?
> 
> regards,
> dan carpenter
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: Replace a bit shift by a use of BIT.

2017-03-23 Thread Dilger, Andreas
On Mar 22, 2017, at 06:12, Dilger, Andreas  wrote:
> 
> On Mar 21, 2017, at 22:39, Arushi Singhal  
> wrote:
>> 
>> This patch replaces bit shifting on 1 with the BIT(x) macro.
>> This was done with coccinelle:
[snip]
>> diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c 
>> b/drivers/staging/lustre/lnet/lnet/net_fault.c
>> index 18183cbb9859..e83761a77d22 100644
>> --- a/drivers/staging/lustre/lnet/lnet/net_fault.c
>> +++ b/drivers/staging/lustre/lnet/lnet/net_fault.c
>> @@ -997,10 +997,10 @@ lnet_fault_ctl(int opc, struct libcfs_ioctl_data *data)
>> int
>> lnet_fault_init(void)
>> {
>> -BUILD_BUG_ON(LNET_PUT_BIT != 1 << LNET_MSG_PUT);
>> -BUILD_BUG_ON(LNET_ACK_BIT != 1 << LNET_MSG_ACK);
>> -BUILD_BUG_ON(LNET_GET_BIT != 1 << LNET_MSG_GET);
>> -BUILD_BUG_ON(LNET_REPLY_BIT != 1 << LNET_MSG_REPLY);
>> +BUILD_BUG_ON(LNET_PUT_BIT != BIT(LNET_MSG_PUT));
>> +BUILD_BUG_ON(LNET_ACK_BIT != BIT(LNET_MSG_ACK));
>> +BUILD_BUG_ON(LNET_GET_BIT != BIT(LNET_MSG_GET));
>> +BUILD_BUG_ON(LNET_REPLY_BIT != BIT(LNET_MSG_REPLY));
> 
> This looks reasonable at first glance, though on further thought it seems 
> kind of
> pointless since this is really:
> 
> #defined LET_PUT_BIT BIT(LNET_MSG_PUT)
> 
>   BUILD_BUG_ON(BIT(LNET_MSG_PUT) != BIT(LNET_MSG_PUT))
> 
> so it is just checking that the macro's value is the same when called two 
> times.
> I'd suggest just getting rid of these BUILD_BUG_ON() checks completely .

Arushi, it would be great if you could submit a patch to remove the above
BUILD_BUG_ON() lines completely.  I don't think they have any value anymore.

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation







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


Re: [PATCH v2] staging: lustre: Replace a bit shift by a use of BIT.

2017-03-23 Thread Dilger, Andreas
On Mar 22, 2017, at 09:53, Arushi Singhal  
wrote:
> 
> This patch replaces bit shifting on 1 with the BIT(x) macro.
> This was done with coccinelle:
> @@
> constant c;
> @@
> 
> -1 << c
> +BIT(c)
> 
> Signed-off-by: Arushi Singhal 

Reviewed-by: Andreas Dilger 

> ---
> changes in v2
> - remove the unnecessary parenthesis.
> - removethe wrong changes.
> 
> drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 8 
> drivers/staging/lustre/lnet/lnet/lib-ptl.c | 2 +-
> drivers/staging/lustre/lustre/llite/lproc_llite.c  | 2 +-
> 3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c 
> b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
> index eaa4399e6a2e..2b93ceaa2844 100644
> --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
> +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
> @@ -1906,14 +1906,14 @@ ksocknal_connect(struct ksock_route *route)
>   if (retry_later) /* needs reschedule */
>   break;
> 
> - if (wanted & (1 << SOCKLND_CONN_ANY)) {
> + if (wanted & BIT(SOCKLND_CONN_ANY)) {
>   type = SOCKLND_CONN_ANY;
> - } else if (wanted & (1 << SOCKLND_CONN_CONTROL)) {
> + } else if (wanted & BIT(SOCKLND_CONN_CONTROL)) {
>   type = SOCKLND_CONN_CONTROL;
> - } else if (wanted & (1 << SOCKLND_CONN_BULK_IN)) {
> + } else if (wanted & BIT(SOCKLND_CONN_BULK_IN)) {
>   type = SOCKLND_CONN_BULK_IN;
>   } else {
> - LASSERT(wanted & (1 << SOCKLND_CONN_BULK_OUT));
> + LASSERT(wanted & BIT(SOCKLND_CONN_BULK_OUT));
>   type = SOCKLND_CONN_BULK_OUT;
>   }
> 
> diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c 
> b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
> index 63cce0c4a065..2724ab94 100644
> --- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
> +++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
> @@ -334,7 +334,7 @@ lnet_mt_test_exhausted(struct lnet_match_table *mtable, 
> int pos)
>   bmap = >mt_exhausted[pos >> LNET_MT_BITS_U64];
>   pos &= (1 << LNET_MT_BITS_U64) - 1;
> 
> - return (*bmap & (1ULL << pos));
> + return (*bmap & BIT(pos));
> }
> 
> static void
> diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c 
> b/drivers/staging/lustre/lustre/llite/lproc_llite.c
> index 40f1fcf8b5c0..c742cba60199 100644
> --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
> +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
> @@ -1308,7 +1308,7 @@ static void ll_display_extents_info(struct 
> ll_rw_extents_info *io_extents,
>  r, pct(r, read_tot), pct(read_cum, read_tot),
>  w, pct(w, write_tot), pct(write_cum, write_tot));
>   start = end;
> - if (start == 1 << 10) {
> + if (start == 1024) {
>   start = 1;
>   units += 10;
>   unitp++;
> -- 
> 2.11.0
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation







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


[PATCH 2/2 v5] pci-hyperv: lock pci bus on device eject

2017-03-23 Thread Long Li
From: Long Li 

A PCI_EJECT message can arrive at the same time we are calling
pci_scan_child_bus in the workqueue for the previous PCI_BUS_RELATIONS
message or in create_root_hv_pci_bus(), in this case we could potentially
modify the bus from multiple places.

Properly lock the bus access.

Thanks Dexuan Cui  for pointing out the race condition
in create_root_hv_pci_bus().

Signed-off-by: Long Li 
Reported-by: Xiaofeng Wang 
Acked-by: K. Y. Srinivasan 
---
 drivers/pci/host/pci-hyperv.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 39fafda..a1b3c19 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1209,9 +1209,11 @@ static int create_root_hv_pci_bus(struct 
hv_pcibus_device *hbus)
hbus->pci_bus->msi = >msi_chip;
hbus->pci_bus->msi->dev = >hdev->device;
 
+   pci_lock_rescan_remove();
pci_scan_child_bus(hbus->pci_bus);
pci_bus_assign_resources(hbus->pci_bus);
pci_bus_add_devices(hbus->pci_bus);
+   pci_unlock_rescan_remove();
hbus->state = hv_pcibus_installed;
return 0;
 }
@@ -1612,8 +1614,10 @@ static void hv_eject_device_work(struct work_struct 
*work)
pdev = pci_get_domain_bus_and_slot(hpdev->hbus->sysdata.domain, 0,
   wslot);
if (pdev) {
+   pci_lock_rescan_remove();
pci_stop_and_remove_bus_device(pdev);
pci_dev_put(pdev);
+   pci_unlock_rescan_remove();
}
 
spin_lock_irqsave(>hbus->device_list_lock, flags);
-- 
2.7.4

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


[PATCH 1/2 v5] pci-hyperv: properly handle pci bus remove

2017-03-23 Thread Long Li
From: Long Li 

hv_pci_devices_present is called in hv_pci_remove when we remove a PCI
device from host (e.g. by disabling SRIOV on a device). In hv_pci_remove,
the bus is already removed before the call, so we don't need to rescan the
bus in the workqueue scheduled from hv_pci_devices_present.

By introducing status hv_pcibus_removed, we can avoid this situation.

Signed-off-by: Long Li 
Reported-by: Xiaofeng Wang 
Acked-by: K. Y. Srinivasan 
---
 drivers/pci/host/pci-hyperv.c | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index ada9856..39fafda 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -350,6 +350,7 @@ enum hv_pcibus_state {
hv_pcibus_init = 0,
hv_pcibus_probed,
hv_pcibus_installed,
+   hv_pcibus_removed,
hv_pcibus_maximum
 };
 
@@ -1504,13 +1505,24 @@ static void pci_devices_present_work(struct work_struct 
*work)
put_pcichild(hpdev, hv_pcidev_ref_initial);
}
 
-   /* Tell the core to rescan bus because there may have been changes. */
-   if (hbus->state == hv_pcibus_installed) {
+   switch(hbus->state) {
+   case hv_pcibus_installed:
+   /*
+   * Tell the core to rescan bus
+   * because there may have been changes.
+   */
pci_lock_rescan_remove();
pci_scan_child_bus(hbus->pci_bus);
pci_unlock_rescan_remove();
-   } else {
+   break;
+
+   case hv_pcibus_init:
+   case hv_pcibus_probed:
survey_child_resources(hbus);
+   break;
+
+   default:
+   break;
}
 
up(>enum_sem);
@@ -2185,6 +2197,7 @@ static int hv_pci_probe(struct hv_device *hdev,
hbus = kzalloc(sizeof(*hbus), GFP_KERNEL);
if (!hbus)
return -ENOMEM;
+   hbus->state = hv_pcibus_init;
 
/*
 * The PCI bus "domain" is what is called "segment" in ACPI and
@@ -2348,6 +2361,7 @@ static int hv_pci_remove(struct hv_device *hdev)
pci_stop_root_bus(hbus->pci_bus);
pci_remove_root_bus(hbus->pci_bus);
pci_unlock_rescan_remove();
+   hbus->state = hv_pcibus_removed;
}
 
hv_pci_bus_exit(hdev);
-- 
2.7.4

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


Re: [PATCH] drivers/staging/dgnc: Updating dev_dbg function

2017-03-23 Thread Greg Kroah-Hartman
On Wed, Mar 22, 2017 at 01:17:57PM +0530, Pushkar Jambhlekar wrote:
> Making use of __func__ instead of using function name directly in dev_dbg.
> 
> Signed-off-by: Pushkar Jambhlekar 
> ---
>  drivers/staging/dgnc/dgnc_tty.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
> index f7e754e..b0c88b8 100644
> --- a/drivers/staging/dgnc/dgnc_tty.c
> +++ b/drivers/staging/dgnc/dgnc_tty.c
> @@ -1858,13 +1858,13 @@ static void dgnc_tty_send_xchar(struct tty_struct 
> *tty, char c)
>   if (!bd || bd->magic != DGNC_BOARD_MAGIC)
>   return;
>  
> - dev_dbg(tty->dev, "dgnc_tty_send_xchar start\n");
> + dev_dbg(tty->dev, "%s start\n", __func__);

As I stated on the mailing list a few days ago, these lines need to just
be deleted entirely, as we have ftrace to help with this type of thing.

thanks,

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


[PATCH] staging: most: Adds parentheses around macros with complex values

2017-03-23 Thread Mark Stenglein
Fixes three instances of the following checklist error:
- ERROR: Macros with complex values should be enclosed
  in parentheses

Simply adds parentheses around the macros to fix the problem.

Signed-off-by: Mark Stenglein 
---
 drivers/staging/most/mostcore/core.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index 191404bc5906..13e65f149d68 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -341,8 +341,8 @@ static ssize_t show_channel_starving(struct most_c_obj *c,
return snprintf(buf, PAGE_SIZE, "%d\n", c->is_starving);
 }
 
-#define create_show_channel_attribute(val) \
-   static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
+#define(create_show_channel_attribute(val)  \
+   static MOST_CHNL_ATTR(val, 0444, show_##val, NULL))
 
 create_show_channel_attribute(available_directions);
 create_show_channel_attribute(available_datatypes);
@@ -493,8 +493,8 @@ static ssize_t store_set_packets_per_xact(struct most_c_obj 
*c,
return count;
 }
 
-#define create_channel_attribute(value) \
-   static MOST_CHNL_ATTR(value, 0644, show_##value, store_##value)
+#define(create_channel_attribute(value) \
+   static MOST_CHNL_ATTR(value, 0644, show_##value, store_##value))
 
 create_channel_attribute(set_buffer_size);
 create_channel_attribute(set_number_of_buffers);
@@ -687,8 +687,8 @@ static ssize_t show_interface(struct most_inst_obj 
*instance_obj,
return snprintf(buf, PAGE_SIZE, "unknown\n");
 }
 
-#define create_inst_attribute(value) \
-   static MOST_INST_ATTR(value, 0444, show_##value, NULL)
+#define(create_inst_attribute(value) \
+   static MOST_INST_ATTR(value, 0444, show_##value, NULL))
 
 create_inst_attribute(description);
 create_inst_attribute(interface);
-- 
2.12.1


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


[bug report] Staging: media: Unmap and release region obtained by ioremap_nocache

2017-03-23 Thread Dan Carpenter
Hello Arvind Yadav,

This is a semi-automatic email about new static checker warnings.

The patch 4b4eda001704: "Staging: media: Unmap and release region 
obtained by ioremap_nocache" from Mar 17, 2017, leads to the 
following Smatch complaint:

drivers/staging/media/davinci_vpfe/dm365_ipipe.c:1846 vpfe_ipipe_init()
 error: we previously assumed 'res' could be null (see line 1809)

drivers/staging/media/davinci_vpfe/dm365_ipipe.c
  1808  res = platform_get_resource(pdev, IORESOURCE_MEM, 6);
  1809  if (!res)
  1810  goto error_unmap;

This used to be a direct return.

  1811  ipipe->isp5_base_addr = ioremap_nocache(res->start, res_len);
  1812  if (!ipipe->isp5_base_addr)
  1813  goto error_unmap;
  1814  
  1815  v4l2_subdev_init(sd, _v4l2_ops);
  1816  sd->internal_ops = _v4l2_internal_ops;
  1817  strlcpy(sd->name, "DAVINCI IPIPE", sizeof(sd->name));
  1818  sd->grp_id = 1 << 16;   /* group ID for davinci subdevs */
  1819  v4l2_set_subdevdata(sd, ipipe);
  1820  sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
  1821  
  1822  pads[IPIPE_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
  1823  pads[IPIPE_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
  1824  
  1825  ipipe->input = IPIPE_INPUT_NONE;
  1826  ipipe->output = IPIPE_OUTPUT_NONE;
  1827  
  1828  me->ops = _media_ops;
  1829  v4l2_ctrl_handler_init(>ctrls, 2);
  1830  v4l2_ctrl_new_std(>ctrls, _ctrl_ops,
  1831V4L2_CID_BRIGHTNESS, 0,
  1832IPIPE_BRIGHT_HIGH, 1, 16);
  1833  v4l2_ctrl_new_std(>ctrls, _ctrl_ops,
  1834V4L2_CID_CONTRAST, 0,
  1835IPIPE_CONTRAST_HIGH, 1, 16);
  1836  
  1837  
  1838  v4l2_ctrl_handler_setup(>ctrls);
  1839  sd->ctrl_handler = >ctrls;
  1840  
  1841  return media_entity_pads_init(me, IPIPE_PADS_NUM, pads);
  1842  
  1843  error_unmap:
  1844  iounmap(ipipe->base_addr);
  1845  error_release:
  1846  release_mem_region(res->start, res_len);
   ^^
This will Oops.

  1847  return -ENOMEM;
  1848  }

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


[PATCH] drivers/staging/dgnc: Removing manual function tracing using dev_dbg

2017-03-23 Thread Pushkar Jambhlekar
Current implementation manually traces function using 'dev_dbg'. This way is 
not needed because of ftrace, making these calls redundant.

Signed-off-by: Pushkar Jambhlekar 
---
 drivers/staging/dgnc/dgnc_tty.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index f7e754e..cae0410 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1858,13 +1858,9 @@ static void dgnc_tty_send_xchar(struct tty_struct *tty, 
char c)
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return;
 
-   dev_dbg(tty->dev, "dgnc_tty_send_xchar start\n");
-
spin_lock_irqsave(>ch_lock, flags);
bd->bd_ops->send_immediate_char(ch, c);
spin_unlock_irqrestore(>ch_lock, flags);
-
-   dev_dbg(tty->dev, "dgnc_tty_send_xchar finish\n");
 }
 
 /* Return modem signals to ld. */
-- 
2.7.4

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


Re: [PATCH v2] staging: iio: Replace a bit shift by a use of BIT.

2017-03-23 Thread Dan Carpenter
On Wed, Mar 22, 2017 at 10:12:34PM +0530, Arushi Singhal wrote:
>  /* Capacitive Channel Setup Register Bit Designations (AD7746_REG_CAP_SETUP) 
> */
> -#define AD7746_CAPSETUP_CAPEN(1 << 7)
> -#define AD7746_CAPSETUP_CIN2 (1 << 6) /* AD7746 only */
> -#define AD7746_CAPSETUP_CAPDIFF  (1 << 5)
> -#define AD7746_CAPSETUP_CACHOP   (1 << 0)
> +#define AD7746_CAPSETUP_CAPEN(BIT(7))
> +#define AD7746_CAPSETUP_CIN2 (BIT(6)) /* AD7746 only */
> +#define AD7746_CAPSETUP_CAPDIFF  (BIT(5))
> +#define AD7746_CAPSETUP_CACHOP   (BIT(0))

Extra parens.

regards,
dan carpenter

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


Re: [PATCH] staging: vt6656: removed coding style errors

2017-03-23 Thread Greg KH
On Wed, Mar 22, 2017 at 09:39:24PM +0530, Prasant Jalan wrote:
> The patch replaces spaces with tabs as required by kernel coding
> standards.
> 
> Signed-off-by: Prasant Jalan 
> ---
>  drivers/staging/vt6656/rxtx.c | 40 ++--
>  1 file changed, 22 insertions(+), 18 deletions(-)

As this seems to be identical to the previous patch you sent, and I
don't see a difference in the changelog comments, I'm dropping it from
my queue.  Please note that all pending patches from you have been
dropped, please resend all of them that still apply.

thanks,

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


Re: [PATCH v8] staging: adis16060: Remove iio_dev mlock and refactor code

2017-03-23 Thread Jonathan Cameron


On 22 March 2017 19:22:20 GMT+00:00, Jonathan Cameron  wrote:
>On 22/03/17 16:20, simran singhal wrote:
>> The IIO subsystem is redefining iio_dev->mlock to be used by
>> the IIO core only for protecting device operating mode changes.
>> ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes.
>> 
>> In this driver, mlock was being used to protect hardware state
>changes.
>> 
>> In the driver, buf_lock protects both the adis16060_spi_write() and
>> adis16060_spi_read() functions and both are always called in
>> pair. First write, then read. Refactor the code to have
>> one single function adis16060_spi_write_than_read() and remove
>> the use of mlock as adis16060_read_raw() does not require an
>> iio_dev->mlock for reads.
>I'll slightly modify this description.  The key thing is
>that after the above change to have a unified read then write
>there is no longer any need for mlock to protect these
>read, update, write cycles.
>> 
>> Signed-off-by: simran singhal 
>Applied to the togreg branch of iio.git and pushed out as testing
>for the autobuilders to play with it.
>
>I slightly modified the title as well. It's useful to be a little
>more specific than staging, so I added iio: after that.

Another example of how the tests that 0day is doing are way better than my 
tired eyes at the end of a day...
>
>Thanks,
>
>Jonathan
>> ---
>> 
>>  v8:
>>-change subject
>>-change commit message
>>  v7:
>>-Change subject
>>-Remove lock from read_raw instead from
>> function adis16060_spi_write_than_read().
>>  v6:
>>-Change commit message
>>-Remove nested lock
>>  v5:
>>-Rename val in adis16060_spi_write_than_read() to conf.
>>-Rename val2 in adis16060_spi_write_than_read() to val.
>>-Corrected Checkpatch issues.
>>-Removed goto from adis16060_read_raw().
>>  v4:
>>-Refactored code
>>-change commit subject
>>-change commit message
>>  v3:
>>-Removed new lock to reuse the existing lock
>>  v2:
>>-Fixed compilation error
>> 
>>  drivers/staging/iio/gyro/adis16060_core.c | 33
>---
>>  1 file changed, 8 insertions(+), 25 deletions(-)
>> 
>> diff --git a/drivers/staging/iio/gyro/adis16060_core.c
>b/drivers/staging/iio/gyro/adis16060_core.c
>> index c9d46e7..e96fce5 100644
>> --- a/drivers/staging/iio/gyro/adis16060_core.c
>> +++ b/drivers/staging/iio/gyro/adis16060_core.c
>> @@ -40,25 +40,18 @@ struct adis16060_state {
>>  
>>  static struct iio_dev *adis16060_iio_dev;
>>  
>> -static int adis16060_spi_write(struct iio_dev *indio_dev, u8 val)
>> +static int adis16060_spi_write_than_read(struct iio_dev *indio_dev,
>> + u8 conf, u16 *val)
>>  {
>>  int ret;
>>  struct adis16060_state *st = iio_priv(indio_dev);
>>  
>>  mutex_lock(>buf_lock);
>> -st->buf[2] = val; /* The last 8 bits clocked in are latched */
>> +st->buf[2] = conf; /* The last 8 bits clocked in are latched */
>>  ret = spi_write(st->us_w, st->buf, 3);
>> -mutex_unlock(>buf_lock);
>> -
>> -return ret;
>> -}
>> -
>> -static int adis16060_spi_read(struct iio_dev *indio_dev, u16 *val)
>> -{
>> -int ret;
>> -struct adis16060_state *st = iio_priv(indio_dev);
>>  
>> -mutex_lock(>buf_lock);
>> +if (ret < 0)
Not unlocking buf_lock in this path.  I will fix up later

Jonathan
>> +return ret;
>>  
>>  ret = spi_read(st->us_r, st->buf, 3);
>>  
>> @@ -86,17 +79,11 @@ static int adis16060_read_raw(struct iio_dev
>*indio_dev,
>>  
>>  switch (mask) {
>>  case IIO_CHAN_INFO_RAW:
>> -/* Take the iio_dev status lock */
>> -mutex_lock(_dev->mlock);
>> -ret = adis16060_spi_write(indio_dev, chan->address);
>> +ret = adis16060_spi_write_than_read(indio_dev,
>> +chan->address, );
>>  if (ret < 0)
>> -goto out_unlock;
>> +return ret;
>>  
>> -ret = adis16060_spi_read(indio_dev, );
>> -if (ret < 0)
>> -goto out_unlock;
>> -
>> -mutex_unlock(_dev->mlock);
>>  *val = tval;
>>  return IIO_VAL_INT;
>>  case IIO_CHAN_INFO_OFFSET:
>> @@ -110,10 +97,6 @@ static int adis16060_read_raw(struct iio_dev
>*indio_dev,
>>  }
>>  
>>  return -EINVAL;
>> -
>> -out_unlock:
>> -mutex_unlock(_dev->mlock);
>> -return ret;
>>  }
>>  
>>  static const struct iio_info adis16060_info = {
>> 
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majord...@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
___
devel mailing list
de...@linuxdriverproject.org

Re: [PATCH] staging: wilc1000: use kernel define byte order macros

2017-03-23 Thread Dan Carpenter
On Wed, Mar 22, 2017 at 07:53:28PM -0600, Robert Perry Hooker wrote:
> I don't think buff is an ieee80211_hdr struct. I think it's the rx_buffer 
> allocated at wilc_wlan.c:1417.
> 

The rx_buffer is going to end up filled with endian data, right?

regards,
dan carpenter

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


Re: [PATCH] staging: vt6656: removed coding style errors

2017-03-23 Thread Greg KH
On Thu, Mar 23, 2017 at 01:55:31PM +0530, Prasant Jalan wrote:
> On Thu, Mar 23, 2017 at 1:02 PM, Greg KH  wrote:
> >
> > On Wed, Mar 22, 2017 at 09:39:24PM +0530, Prasant Jalan wrote:
> > > The patch replaces spaces with tabs as required by kernel coding
> > > standards.
> > >
> > > Signed-off-by: Prasant Jalan 
> > > ---
> > >  drivers/staging/vt6656/rxtx.c | 40 
> > > ++--
> > >  1 file changed, 22 insertions(+), 18 deletions(-)
> >
> > As this seems to be identical to the previous patch you sent, and I
> > don't see a difference in the changelog comments, I'm dropping it from
> > my queue.  Please note that all pending patches from you have been
> > dropped, please resend all of them that still apply.
> >
> 
> Hi Greg,
> 
> I'm sorry that I sent a bad patch again and thanks so much for your comments.
> 
> Should I be sending the patch with more verbose commit message?

That's not what I asked for at all, please go read my prior emails to
you :(

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


Re: [PATCH] staging: most: Adds parentheses around macros with complex values

2017-03-23 Thread Greg KH
On Thu, Mar 23, 2017 at 04:38:38AM -0400, Mark Stenglein wrote:
> Fixes three instances of the following checklist error:
> - ERROR: Macros with complex values should be enclosed
>   in parentheses
> 
> Simply adds parentheses around the macros to fix the problem.
> 
> Signed-off-by: Mark Stenglein 
> ---
>  drivers/staging/most/mostcore/core.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/most/mostcore/core.c 
> b/drivers/staging/most/mostcore/core.c
> index 191404bc5906..13e65f149d68 100644
> --- a/drivers/staging/most/mostcore/core.c
> +++ b/drivers/staging/most/mostcore/core.c
> @@ -341,8 +341,8 @@ static ssize_t show_channel_starving(struct most_c_obj *c,
>   return snprintf(buf, PAGE_SIZE, "%d\n", c->is_starving);
>  }
>  
> -#define create_show_channel_attribute(val) \
> - static MOST_CHNL_ATTR(val, 0444, show_##val, NULL)
> +#define(create_show_channel_attribute(val)  \
> + static MOST_CHNL_ATTR(val, 0444, show_##val, NULL))

I don't think this does what you think it does.  Did you test build
this???

Please learn C before working on kernel code, the kernel is not a place
to learn it.

thanks,

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


[PATCH v9] staging: iio: adis16060: Remove iio_dev mlock and refactor code

2017-03-23 Thread simran singhal
The IIO subsystem is redefining iio_dev->mlock to be used by
the IIO core only for protecting device operating mode changes.
ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes.

In this driver, mlock was being used to protect hardware state changes.

In the driver, buf_lock protects both the adis16060_spi_write() and
adis16060_spi_read() functions and both are always called in pair.
First write, then read. Refactor the code to have one single function
adis16060_spi_write_then_read() protected by the buf_lock. This removes
the need for additional locking via mlock, so this locking is removed.

Signed-off-by: simran singhal 
---

 v9:
   -Change the name of function from adis16060_spi_write_than_read()
to adis16060_spi_write_then_read(). change "than" to "then" as
its time depended.
   -Add mutex_unlock
 
 drivers/staging/iio/gyro/adis16060_core.c | 35 +--
 1 file changed, 10 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/iio/gyro/adis16060_core.c 
b/drivers/staging/iio/gyro/adis16060_core.c
index c9d46e7..9675245 100644
--- a/drivers/staging/iio/gyro/adis16060_core.c
+++ b/drivers/staging/iio/gyro/adis16060_core.c
@@ -40,25 +40,20 @@ struct adis16060_state {
 
 static struct iio_dev *adis16060_iio_dev;
 
-static int adis16060_spi_write(struct iio_dev *indio_dev, u8 val)
+static int adis16060_spi_write_then_read(struct iio_dev *indio_dev,
+u8 conf, u16 *val)
 {
int ret;
struct adis16060_state *st = iio_priv(indio_dev);
 
mutex_lock(>buf_lock);
-   st->buf[2] = val; /* The last 8 bits clocked in are latched */
+   st->buf[2] = conf; /* The last 8 bits clocked in are latched */
ret = spi_write(st->us_w, st->buf, 3);
-   mutex_unlock(>buf_lock);
-
-   return ret;
-}
-
-static int adis16060_spi_read(struct iio_dev *indio_dev, u16 *val)
-{
-   int ret;
-   struct adis16060_state *st = iio_priv(indio_dev);
 
-   mutex_lock(>buf_lock);
+   if (ret < 0) {
+   mutex_unlock(>buf_lock);
+   return ret;
+   }
 
ret = spi_read(st->us_r, st->buf, 3);
 
@@ -86,17 +81,11 @@ static int adis16060_read_raw(struct iio_dev *indio_dev,
 
switch (mask) {
case IIO_CHAN_INFO_RAW:
-   /* Take the iio_dev status lock */
-   mutex_lock(_dev->mlock);
-   ret = adis16060_spi_write(indio_dev, chan->address);
+   ret = adis16060_spi_write_then_read(indio_dev,
+   chan->address, );
if (ret < 0)
-   goto out_unlock;
+   return ret;
 
-   ret = adis16060_spi_read(indio_dev, );
-   if (ret < 0)
-   goto out_unlock;
-
-   mutex_unlock(_dev->mlock);
*val = tval;
return IIO_VAL_INT;
case IIO_CHAN_INFO_OFFSET:
@@ -110,10 +99,6 @@ static int adis16060_read_raw(struct iio_dev *indio_dev,
}
 
return -EINVAL;
-
-out_unlock:
-   mutex_unlock(_dev->mlock);
-   return ret;
 }
 
 static const struct iio_info adis16060_info = {
-- 
2.7.4

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


Re: [PATCH] staging: vt6656: removed coding style errors

2017-03-23 Thread Prasant Jalan
On Thu, Mar 23, 2017 at 1:02 PM, Greg KH  wrote:
>
> On Wed, Mar 22, 2017 at 09:39:24PM +0530, Prasant Jalan wrote:
> > The patch replaces spaces with tabs as required by kernel coding
> > standards.
> >
> > Signed-off-by: Prasant Jalan 
> > ---
> >  drivers/staging/vt6656/rxtx.c | 40 ++--
> >  1 file changed, 22 insertions(+), 18 deletions(-)
>
> As this seems to be identical to the previous patch you sent, and I
> don't see a difference in the changelog comments, I'm dropping it from
> my queue.  Please note that all pending patches from you have been
> dropped, please resend all of them that still apply.
>

Hi Greg,

I'm sorry that I sent a bad patch again and thanks so much for your comments.

Should I be sending the patch with more verbose commit message?


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


[PATCH] drivers/staging/wilc1000: Fixing dev_err and removing dev_dbg calls for tracing

2017-03-23 Thread Pushkar Jambhlekar
dev_err: replacing function name with '%s' and __func__
dev_dbg: Removing calls which are used for tracing a function.

Signed-off-by: Pushkar Jambhlekar 
---
 drivers/staging/wilc1000/wilc_sdio.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_sdio.c 
b/drivers/staging/wilc1000/wilc_sdio.c
index ad4eb0f..20dbc21 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -74,7 +74,7 @@ static int wilc_sdio_cmd52(struct wilc *wilc, struct 
sdio_cmd52 *cmd)
sdio_release_host(func);
 
if (ret)
-   dev_err(>dev, "wilc_sdio_cmd52..failed, err(%d)\n", ret);
+   dev_err(>dev, "%s..failed, err(%d)\n", __func__, ret);
return ret;
 }
 
@@ -103,7 +103,7 @@ static int wilc_sdio_cmd53(struct wilc *wilc, struct 
sdio_cmd53 *cmd)
sdio_release_host(func);
 
if (ret)
-   dev_err(>dev, "wilc_sdio_cmd53..failed, err(%d)\n", ret);
+   dev_err(>dev, "%s..failed, err(%d)\n", __func__, ret);
 
return ret;
 }
@@ -243,15 +243,11 @@ static void wilc_sdio_disable_interrupt(struct wilc *dev)
struct sdio_func *func = container_of(dev->dev, struct sdio_func, dev);
int ret;
 
-   dev_dbg(>dev, "wilc_sdio_disable_interrupt IN\n");
-
sdio_claim_host(func);
ret = sdio_release_irq(func);
if (ret < 0)
dev_err(>dev, "can't release sdio_irq, err(%d)\n", ret);
sdio_release_host(func);
-
-   dev_info(>dev, "wilc_sdio_disable_interrupt OUT\n");
 }
 
 /
-- 
2.7.4

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


[PATCH] drivers/staging/media: atomisp: Removing redundant information from dev_err

2017-03-23 Thread Pushkar Jambhlekar
Removing hardcoded function name as code is already using __func__

Signed-off-by: Pushkar Jambhlekar 
---
 drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c 
b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
index d1a609d2..a51a27b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
@@ -64,7 +64,7 @@ struct hmm_buffer_object *__bo_alloc(struct kmem_cache 
*bo_cache)
 
bo = kmem_cache_alloc(bo_cache, GFP_KERNEL);
if (!bo)
-   dev_err(atomisp_dev, "%s: __bo_alloc failed!\n", __func__);
+   dev_err(atomisp_dev, "%s: failed!\n", __func__);
 
return bo;
 }
-- 
2.7.4

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


Re: [PATCH v3 2/2] staging: iio: ade7753: Replace mlock with driver private lock

2017-03-23 Thread SIMRAN SINGHAL
On Thu, Mar 23, 2017 at 1:55 AM, Jonathan Cameron  wrote:
> On 21/03/17 18:03, simran singhal wrote:
>> The IIO subsystem is redefining iio_dev->mlock to be used by
>> the IIO core only for protecting device operating mode changes.
>> ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes.
>>
>> In this driver, mlock was being used to protect hardware state
>> changes.  Replace it with a lock in the devices global data.
>>
>> Signed-off-by: simran singhal 
> Mutex is not initialized...

Mutex is already initialized in ade7753_probe().

>> ---
>>  drivers/staging/iio/meter/ade7753.c | 6 --
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/iio/meter/ade7753.c 
>> b/drivers/staging/iio/meter/ade7753.c
>> index b71fbd3..9674e05 100644
>> --- a/drivers/staging/iio/meter/ade7753.c
>> +++ b/drivers/staging/iio/meter/ade7753.c
>> @@ -80,11 +80,13 @@
>>   * @us: actual spi_device
>>   * @tx: transmit buffer
>>   * @rx: receive buffer
>> + * @lock:   protect sensor state
>>   * @buf_lock:   mutex to protect tx and rx
>>   **/
>>  struct ade7753_state {
>>   struct spi_device   *us;
>>   struct mutexbuf_lock;
>> + struct mutexlock;  /* protect sensor state */
>>   u8  tx[ADE7753_MAX_TX] cacheline_aligned;
>>   u8  rx[ADE7753_MAX_RX];
>>  };
>> @@ -484,7 +486,7 @@ static ssize_t ade7753_write_frequency(struct device 
>> *dev,
>>   if (!val)
>>   return -EINVAL;
>>
>> - mutex_lock(_dev->mlock);
>> + mutex_lock(>lock);
>>
>>   t = 27900 / val;
>>   if (t > 0)
>> @@ -505,7 +507,7 @@ static ssize_t ade7753_write_frequency(struct device 
>> *dev,
>>   ret = ade7753_spi_write_reg_16(dev, ADE7753_MODE, reg);
>>
>>  out:
>> - mutex_unlock(_dev->mlock);
>> + mutex_unlock(>lock);
>>
>>   return ret ? ret : len;
>>  }
>>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v2] HV: properly delay KVP packets when negotiation is in progress

2017-03-23 Thread Long Li


> -Original Message-
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Thursday, March 23, 2017 9:04 AM
> To: Long Li 
> Cc: KY Srinivasan ; Haiyang Zhang
> ; Stephen Hemminger
> ; de...@linuxdriverproject.org; linux-
> ker...@vger.kernel.org; sta...@vger.kernel.org
> Subject: Re: [PATCH v2] HV: properly delay KVP packets when negotiation is
> in progress
> 
> Long Li  writes:
> 
> > The host may send multiple negotiation packets (due to timeout) before
> > the KVP user-mode daemon is connected. We need to defer processing
> > those packets until the daemon is negotiated and connected. It's okay
> > for guest to respond to all negotiation packets.
> >
> > In addition, the host may send multiple staged KVP requests as soon as
> > negotiation is done. We need to properly process those packets using
> > one tasklet for exclusive access to ring buffer.
> >
> > This patch is based on the work of Nick Meier
> > 
> >
> > The patch v2 has incorporated suggestion from Vitaly Kuznetsov
> > .
> >
> > Signed-off-by: Long Li 
> > ---
> >  drivers/hv/hv_kvp.c | 12 +++-
> >  1 file changed, 7 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index
> > de26371..845b70b 100644
> > --- a/drivers/hv/hv_kvp.c
> > +++ b/drivers/hv/hv_kvp.c
> > @@ -113,7 +113,7 @@ static void kvp_poll_wrapper(void *channel)  {
> > /* Transaction is finished, reset the state here to avoid races. */
> > kvp_transaction.state = HVUTIL_READY;
> > -   hv_kvp_onchannelcallback(channel);
> > +   tasklet_schedule(&((struct vmbus_channel*)channel)-
> >callback_event);
> >  }
> 
> There is one more function in the code which calls
> hv_kvp_onchannelcallback():
> 
> static void kvp_host_handshake_func(struct work_struct *dummy) {
>   hv_poll_channel(kvp_transaction.recv_channel,
> hv_kvp_onchannelcallback); }
> 
> we can't replace hv_kvp_onchannelcallback with kvp_poll_wrapper here as
> we don't want to reset kvp_transaction.state but it seems this should also
> get updated, e.g. hv_poll_channel() here can be replaced with the direct
> 
>  tasklet_schedule(&((struct vmbus_channel*)channel)->callback_event);
> 
> call. This will ensure hv_kvp_onchannelcallback() calls are always serialized.

Thank you. I will send v3.

> 
> >
> >  static void kvp_register_done(void)
> > @@ -628,16 +628,17 @@ void hv_kvp_onchannelcallback(void *context)
> >  NEGO_IN_PROGRESS,
> >  NEGO_FINISHED} host_negotiatied =
> NEGO_NOT_STARTED;
> >
> > -   if (host_negotiatied == NEGO_NOT_STARTED &&
> > -   kvp_transaction.state < HVUTIL_READY) {
> > +   if (kvp_transaction.state < HVUTIL_READY) {
> > /*
> >  * If userspace daemon is not connected and host is asking
> >  * us to negotiate we need to delay to not lose messages.
> >  * This is important for Failover IP setting.
> >  */
> > -   host_negotiatied = NEGO_IN_PROGRESS;
> > -   schedule_delayed_work(_host_handshake_work,
> > +   if (host_negotiatied == NEGO_NOT_STARTED) {
> > +   host_negotiatied = NEGO_IN_PROGRESS;
> > +
>   schedule_delayed_work(_host_handshake_work,
> >   HV_UTIL_NEGO_TIMEOUT * HZ);
> > +   }
> > return;
> > }
> > if (kvp_transaction.state > HVUTIL_READY) @@ -705,6 +706,7 @@
> void
> > hv_kvp_onchannelcallback(void *context)
> >VM_PKT_DATA_INBAND, 0);
> >
> > host_negotiatied = NEGO_FINISHED;
> > +   hv_poll_channel(kvp_transaction.recv_channel,
> kvp_poll_wrapper);
> > }
> >
> >  }
> 
> --
>   Vitaly
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 2/2] staging: iio: ade7753: Replace mlock with driver private lock

2017-03-23 Thread Jonathan Cameron


On 23 March 2017 18:12:33 GMT+00:00, SIMRAN SINGHAL  
wrote:
>On Thu, Mar 23, 2017 at 1:55 AM, Jonathan Cameron 
>wrote:
>> On 21/03/17 18:03, simran singhal wrote:
>>> The IIO subsystem is redefining iio_dev->mlock to be used by
>>> the IIO core only for protecting device operating mode changes.
>>> ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes.
>>>
>>> In this driver, mlock was being used to protect hardware state
>>> changes.  Replace it with a lock in the devices global data.
>>>
>>> Signed-off-by: simran singhal 
>> Mutex is not initialized...
>
>Mutex is already initialized in ade7753_probe().
Given you introduce a new mutex it seems unlikely that one is. You have to 
initialise each mutex.
>
>>> ---
>>>  drivers/staging/iio/meter/ade7753.c | 6 --
>>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/staging/iio/meter/ade7753.c
>b/drivers/staging/iio/meter/ade7753.c
>>> index b71fbd3..9674e05 100644
>>> --- a/drivers/staging/iio/meter/ade7753.c
>>> +++ b/drivers/staging/iio/meter/ade7753.c
>>> @@ -80,11 +80,13 @@
>>>   * @us: actual spi_device
>>>   * @tx: transmit buffer
>>>   * @rx: receive buffer
>>> + * @lock:   protect sensor state
>>>   * @buf_lock:   mutex to protect tx and rx
>>>   **/
>>>  struct ade7753_state {
>>>   struct spi_device   *us;
>>>   struct mutexbuf_lock;
>>> + struct mutexlock;  /* protect sensor state */
>>>   u8  tx[ADE7753_MAX_TX] cacheline_aligned;
>>>   u8  rx[ADE7753_MAX_RX];
>>>  };
>>> @@ -484,7 +486,7 @@ static ssize_t ade7753_write_frequency(struct
>device *dev,
>>>   if (!val)
>>>   return -EINVAL;
>>>
>>> - mutex_lock(_dev->mlock);
>>> + mutex_lock(>lock);
>>>
>>>   t = 27900 / val;
>>>   if (t > 0)
>>> @@ -505,7 +507,7 @@ static ssize_t ade7753_write_frequency(struct
>device *dev,
>>>   ret = ade7753_spi_write_reg_16(dev, ADE7753_MODE, reg);
>>>
>>>  out:
>>> - mutex_unlock(_dev->mlock);
>>> + mutex_unlock(>lock);
>>>
>>>   return ret ? ret : len;
>>>  }
>>>
>>

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 09/11] staging: speakup: Simplify the NULL comparisons

2017-03-23 Thread Greg KH
On Tue, Mar 21, 2017 at 05:12:33PM +0530, Arushi Singhal wrote:
> Fixed coding style for null comparisons in speakup driver to be more
> consistant with the rest of the kernel coding style.
> Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'.
> 
> Signed-off-by: Arushi Singhal 
> ---
>  drivers/staging/speakup/fakekey.c |  2 +-
>  drivers/staging/speakup/main.c| 32 
>  2 files changed, 17 insertions(+), 17 deletions(-)

You used this same subject line in this series, not good :(

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


Re: [PATCH] staging: ad7746: Moved contents of the header to the source file.

2017-03-23 Thread Lars-Peter Clausen
On 03/23/2017 12:36 PM, Arushi Singhal wrote:
> Moved the contents of the header(ad7746.h) into the source file
> ad7746.c with the exception of the platform data struct which is
> supposed to be used from somewhere else other than the driver.
> 
> Signed-off-by: Arushi Singhal 
> ---
>  drivers/staging/iio/cdc/ad7746.c | 5 +
>  drivers/staging/iio/cdc/ad7746.h | 5 -
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/iio/cdc/ad7746.c 
> b/drivers/staging/iio/cdc/ad7746.c
> index 2d8397b11b19..033a41fd9bee 100644
> --- a/drivers/staging/iio/cdc/ad7746.c
> +++ b/drivers/staging/iio/cdc/ad7746.c
> @@ -21,6 +21,11 @@
>  
>  #include "ad7746.h"
>  
> +#define AD7466_EXCLVL_0 0 /* +-VDD/8 */
> +#define AD7466_EXCLVL_1 1 /* +-VDD/4 */
> +#define AD7466_EXCLVL_2 2 /* +-VDD * 3/8 */
> +#define AD7466_EXCLVL_3 3 /* +-VDD/2 */
> +
>  /*
>   * AD7746 Register Definition
>   */
> diff --git a/drivers/staging/iio/cdc/ad7746.h 
> b/drivers/staging/iio/cdc/ad7746.h
> index ea8572d1df02..2fbcee88fda6 100644
> --- a/drivers/staging/iio/cdc/ad7746.h
> +++ b/drivers/staging/iio/cdc/ad7746.h
> @@ -13,11 +13,6 @@
>   * TODO: struct ad7746_platform_data needs to go into include/linux/iio
>   */
>  
> -#define AD7466_EXCLVL_0  0 /* +-VDD/8 */
> -#define AD7466_EXCLVL_1  1 /* +-VDD/4 */
> -#define AD7466_EXCLVL_2  2 /* +-VDD * 3/8 */
> -#define AD7466_EXCLVL_3  3 /* +-VDD/2 */
> -

I believe those are settings for the exclvl field in the platform data
struct. Hence this has to stay here.

>  struct ad7746_platform_data {
>   unsigned char exclvl;   /*Excitation Voltage Level */
>   bool exca_en;   /* enables EXCA pin as the excitation output */
> 

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


Re: [PATCH staging/speakup v3 3/3] use speakup_allocate as per required context

2017-03-23 Thread Greg KH
On Tue, Mar 21, 2017 at 12:40:24PM +0530, Pranay Kr. Srivastava wrote:
> speakup_allocate used GFP_ATOMIC for allocations
> even while during initialization due to it's use
> in notifier call.
> 
> Pass GFP_ flags as well to speakup_allocate depending
> on the context it is called in.
> 
> Signed-off-by: Pranay Kr. Srivastava 
> ---
>  drivers/staging/speakup/main.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

This patch didn't apply to my staging-testing branch, but the 2 others
did, odd.  Can you rebase it and resend?

thanks,

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


Re: [PATCH 02/11] staging: speakup: Remove multiple assignments

2017-03-23 Thread Greg KH
On Tue, Mar 21, 2017 at 05:12:26PM +0530, Arushi Singhal wrote:
> This patch fixes the checkpatch.pl warning "multiple assignments
> should be avoided."
> 
> Signed-off-by: Arushi Singhal 
> ---
>  drivers/staging/speakup/main.c | 18 --
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index f71206878363..f8fccc8bf6b2 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -270,9 +270,12 @@ static unsigned char get_attributes(struct vc_data *vc, 
> u16 *pos)
>  
>  static void speakup_date(struct vc_data *vc)
>  {
> - spk_x = spk_cx = vc->vc_x;
> - spk_y = spk_cy = vc->vc_y;
> - spk_pos = spk_cp = vc->vc_pos;
> + spk_x = vc->vc_x;
> + spk_cx = spk_x;
> + spk_y = vc->vc_y;
> + spk_cy = spk_y;
> + spk_pos = vc->vc_pos;
> + spk_cp = spk_pos;

Ick, this is harder to read now, don't you think?

not good.

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


Re: [PATCH] drivers/staging/dgnc: Removing manual function tracing using dev_dbg

2017-03-23 Thread Greg Kroah-Hartman
On Thu, Mar 23, 2017 at 02:20:53PM +0530, Pushkar Jambhlekar wrote:
> Current implementation manually traces function using 'dev_dbg'. This way is 
> not needed because of ftrace, making these calls redundant.


Always wrap your changelog lines properly.

Also, someone else sent this same patch in right before you did, sorry.

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


Re: [PATCH] staging:fbtft/fbtft-io: Fix incorrect type in assignment

2017-03-23 Thread Greg Kroah-Hartman
On Thu, Mar 23, 2017 at 03:08:38PM +0800, Zhengyi Shen wrote:
> Fix endian sparse warnings of incorrect type in assignment.
> This patch changes type to the appropriate endian specific versions.
> 
> 
> Signed-off-by: Zhengyi Shen 
> ---
>  drivers/staging/fbtft/fbtft-io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft-io.c 
> b/drivers/staging/fbtft/fbtft-io.c
> index d868405..ffb9a3b 100644
> --- a/drivers/staging/fbtft/fbtft-io.c
> +++ b/drivers/staging/fbtft/fbtft-io.c
> @@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void 
> *buf, size_t len)
>   src++;
>   }
>   tmp |= ((*src & 0x0100) ? 1 : 0);
> - *(u64 *)dst = cpu_to_be64(tmp);
> + *(__be64 *)dst = cpu_to_be64(tmp);

Really?  I need an ack from a maintainer of this code before I'll take
this mess...

thanks,

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


Re: [PATCH v2] staging: radio-bcm2048: fixed bare use of unsigned int

2017-03-23 Thread Greg Kroah-Hartman
On Wed, Mar 22, 2017 at 01:33:39PM +1100, Eddie Youseph wrote:
> Fixed checkpatch WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
> 
> Signed-off-by: Eddie Youseph 
> ---
> Changes in v2:
>   - Added changelog

Did you actually build this change?

Please do so...

thanks,

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


Re: [PATCH] staging: media: atomisp: use kvmalloc and kvfree

2017-03-23 Thread Greg Kroah-Hartman
On Thu, Mar 23, 2017 at 09:12:39PM +0800, Geliang Tang wrote:
> Use kvmalloc() and kvfree() instead of open-coding.

These functions are not in Linus's tree, so I can't apply this patch
without breaking things :(

thanks,

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


[PATCH] staging: rtl8192e: Fix embedded function names with __func__

2017-03-23 Thread suniel . spartan
From: Suniel Mahesh 

Prefer and make it generic by using %s and __func__ to print
functions name instead of embedding functions name in print statements

Signed-off-by: Suniel Mahesh 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index aa4b015..9281116 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -35,7 +35,7 @@ static void _rtl92e_hw_sleep(struct net_device *dev)
if (priv->RFChangeInProgress) {
spin_unlock_irqrestore(>rf_ps_lock, flags);
RT_TRACE(COMP_DBG,
-"_rtl92e_hw_sleep(): RF Change in progress!\n");
+"%s(): RF Change in progress!\n", __func__);
return;
}
spin_unlock_irqrestore(>rf_ps_lock, flags);
@@ -62,7 +62,7 @@ void rtl92e_hw_wakeup(struct net_device *dev)
if (priv->RFChangeInProgress) {
spin_unlock_irqrestore(>rf_ps_lock, flags);
RT_TRACE(COMP_DBG,
-"rtl92e_hw_wakeup(): RF Change in progress!\n");
+"%s(): RF Change in progress!\n", __func__);
schedule_delayed_work(>rtllib->hw_wakeup_wq,
  msecs_to_jiffies(10));
return;
@@ -121,15 +121,15 @@ static void _rtl92e_ps_update_rf_state(struct net_device 
*dev)
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
&(priv->rtllib->PowerSaveControl);
 
-   RT_TRACE(COMP_PS, "_rtl92e_ps_update_rf_state() ->\n");
+   RT_TRACE(COMP_PS, "%s() ->\n", __func__);
pPSC->bSwRfProcessing = true;
 
-   RT_TRACE(COMP_PS, "_rtl92e_ps_update_rf_state(): Set RF to %s.\n",
+   RT_TRACE(COMP_PS, "%s(): Set RF to %s.\n", __func__,
 pPSC->eInactivePowerState == eRfOff ? "OFF" : "ON");
rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS);
 
pPSC->bSwRfProcessing = false;
-   RT_TRACE(COMP_PS, "_rtl92e_ps_update_rf_state() <-\n");
+   RT_TRACE(COMP_PS, "%s() <-\n", __func__);
 }
 
 void rtl92e_ips_enter(struct net_device *dev)
@@ -144,7 +144,7 @@ void rtl92e_ips_enter(struct net_device *dev)
if (rtState == eRfOn && !pPSC->bSwRfProcessing &&
(priv->rtllib->state != RTLLIB_LINKED) &&
(priv->rtllib->iw_mode != IW_MODE_MASTER)) {
-   RT_TRACE(COMP_PS, "rtl92e_ips_enter(): Turn off RF.\n");
+   RT_TRACE(COMP_PS, "%s(): Turn off RF.\n", __func__);
pPSC->eInactivePowerState = eRfOff;
priv->isRFOff = true;
priv->bInPowerSaveMode = true;
@@ -164,7 +164,7 @@ void rtl92e_ips_leave(struct net_device *dev)
rtState = priv->rtllib->eRFPowerState;
if (rtState != eRfOn  && !pPSC->bSwRfProcessing &&
priv->rtllib->RfOffReason <= RF_CHANGE_BY_IPS) {
-   RT_TRACE(COMP_PS, "rtl92e_ips_leave(): Turn on RF.\n");
+   RT_TRACE(COMP_PS, "%s(): Turn on RF.\n", __func__);
pPSC->eInactivePowerState = eRfOn;
priv->bInPowerSaveMode = false;
_rtl92e_ps_update_rf_state(dev);
@@ -247,7 +247,7 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
&(priv->rtllib->PowerSaveControl);
 
-   RT_TRACE(COMP_PS, "rtl92e_leisure_ps_enter()...\n");
+   RT_TRACE(COMP_PS, "%s()...\n", __func__);
RT_TRACE(COMP_PS,
 "pPSC->bLeisurePs = %d, ieee->ps = %d,pPSC->LpsIdleCount is 
%d,RT_CHECK_FOR_HANG_PERIOD is %d\n",
 pPSC->bLeisurePs, priv->rtllib->ps, pPSC->LpsIdleCount,
@@ -265,7 +265,7 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
if (priv->rtllib->ps == RTLLIB_PS_DISABLED) {
 
RT_TRACE(COMP_LPS,
-"rtl92e_leisure_ps_enter(): Enter 
802.11 power save mode...\n");
+"%s(): Enter 802.11 power save 
mode...\n", __func__);
 
if (!pPSC->bFwCtrlLPS) {
if (priv->rtllib->SetFwCmdHandler)
@@ -287,14 +287,14 @@ void rtl92e_leisure_ps_leave(struct net_device *dev)
&(priv->rtllib->PowerSaveControl);
 
 
-   RT_TRACE(COMP_PS, "rtl92e_leisure_ps_leave()...\n");
+   RT_TRACE(COMP_PS, "%s()...\n", __func__);
RT_TRACE(COMP_PS, "pPSC->bLeisurePs = %d, 

Re: [PATCH] staging: tsl2x7x: Moved contents of the header to the source file.

2017-03-23 Thread Lars-Peter Clausen
On 03/23/2017 12:53 PM, Arushi Singhal wrote:
> Moved the contents of the header(tsl2x7x.h) into the source file
> tsl2x7x_core.c with the exception of the platform data struct which is
> supposed to be used from somewhere else other than the driver.

The platform_data struct uses the other structs though.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 11/11] staging: speakup: Fix alignment with parenthesis.

2017-03-23 Thread Greg KH
On Tue, Mar 21, 2017 at 05:12:35PM +0530, Arushi Singhal wrote:
> This patch fixes the warnings reported by checkpatch.pl
> for please use a blank line after function/struct/union/enum
> declarations.

That's not what this patch does at all!

Please be more careful.

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


[PATCH v2] staging:speakup: Fix alignment with parenthesis.

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

Signed-off-by: Arushi Singhal 
---
changes in v2
 - change the commit message.

 drivers/staging/speakup/speakup_apollo.c | 2 +-
 drivers/staging/speakup/speakup_decext.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/speakup/speakup_apollo.c 
b/drivers/staging/speakup/speakup_apollo.c
index 9cfdbbfb9742..6ad83dc642c4 100644
--- a/drivers/staging/speakup/speakup_apollo.c
+++ b/drivers/staging/speakup/speakup_apollo.c
@@ -173,7 +173,7 @@ static void do_catch_up(struct spk_synth *synth)
if (!synth->io_ops->synth_out(synth, ch)) {
outb(UART_MCR_DTR, speakup_info.port_tts + UART_MCR);
outb(UART_MCR_DTR | UART_MCR_RTS,
-   speakup_info.port_tts + UART_MCR);
+speakup_info.port_tts + UART_MCR);
schedule_timeout(msecs_to_jiffies(full_time_val));
continue;
}
diff --git a/drivers/staging/speakup/speakup_decext.c 
b/drivers/staging/speakup/speakup_decext.c
index 929a28d618dc..c564bf8e1531 100644
--- a/drivers/staging/speakup/speakup_decext.c
+++ b/drivers/staging/speakup/speakup_decext.c
@@ -206,11 +206,11 @@ static void do_catch_up(struct spk_synth *synth)
if (!in_escape)
synth->io_ops->synth_out(synth, 
PROCSPEECH);
spin_lock_irqsave(_info.spinlock,
-   flags);
+ flags);
jiffy_delta_val = jiffy_delta->u.n.value;
delay_time_val = delay_time->u.n.value;
spin_unlock_irqrestore(_info.spinlock,
-   flags);
+  flags);
schedule_timeout(msecs_to_jiffies
 (delay_time_val));
jiff_max = jiffies + jiffy_delta_val;
-- 
2.11.0

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


[PATCH] staging: media: atomisp: fix build error

2017-03-23 Thread Geliang Tang
Fix the following build error:

  CC  drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.o
drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c:52:2:
 error: excess elements in array initializer [-Werror]
  "i", /* ion */
  ^~~
drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c:52:2:
 note: (near initialization for ‘hmm_bo_type_strings’)
cc1: all warnings being treated as errors
scripts/Makefile.build:294: recipe for target
'drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.o' failed

Signed-off-by: Geliang Tang 
---
 drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c 
b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
index a362b49..e78f02f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
@@ -49,7 +49,9 @@ const char *hmm_bo_type_strings[HMM_BO_LAST] = {
"p", /* private */
"s", /* shared */
"u", /* user */
+#ifdef CONFIG_ION
"i", /* ion */
+#endif
 };
 
 static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
-- 
2.9.3

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


[PATCH] staging: media: atomisp: use kvmalloc and kvfree

2017-03-23 Thread Geliang Tang
Use kvmalloc() and kvfree() instead of open-coding.

Signed-off-by: Geliang Tang 
---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 94bc793..c7b9320 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -90,10 +90,7 @@ union host {
 void *atomisp_kernel_malloc(size_t bytes)
 {
/* vmalloc() is preferable if allocating more than 1 page */
-   if (bytes > PAGE_SIZE)
-   return vmalloc(bytes);
-
-   return kmalloc(bytes, GFP_KERNEL);
+   return kvmalloc(bytes, GFP_KERNEL);
 }
 
 /*
@@ -118,10 +115,7 @@ void *atomisp_kernel_zalloc(size_t bytes, bool zero_mem)
 void atomisp_kernel_free(void *ptr)
 {
/* Verify if buffer was allocated by vmalloc() or kmalloc() */
-   if (is_vmalloc_addr(ptr))
-   vfree(ptr);
-   else
-   kfree(ptr);
+   kvfree(ptr);
 }
 
 /*
-- 
2.9.3

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


Re: [PATCH 05/11] staging: speakup: Remove multiple assignments

2017-03-23 Thread Greg KH
On Tue, Mar 21, 2017 at 05:12:29PM +0530, Arushi Singhal wrote:
> This patch fixes the checkpatch.pl warning "multiple assignments
> should be avoided."
> 
> Signed-off-by: Arushi Singhal 
> ---
>  drivers/staging/speakup/main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index 21e76b031449..c10445624e92 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -2106,7 +2106,8 @@ speakup_key(struct vc_data *vc, int shift_state, int 
> keycode, u_short keysym,
>   spk_keydown = 0;
>   goto out;
>   }
> - value = spk_lastkey = pad_chars[value];
> + value = pad_chars[value];
> + spk_lastkey = value;

Also harder to read now :(

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


Re: [Outreachy kernel] [RESEND PATCH v2] staging:speakup: Fix alignment with parenthesis.

2017-03-23 Thread Julia Lawall
It should be staging: speakup:, not staging:speakup:

On Thu, 23 Mar 2017, Arushi Singhal wrote:

> Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".

It would really be better to say what the patch does, not just say what
error message you have fixed.

julia

> Signed-off-by: Arushi Singhal 
> ---
> changes in v2
>  - change the commit message.
>
>  drivers/staging/speakup/speakup_apollo.c | 2 +-
>  drivers/staging/speakup/speakup_decext.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/speakup/speakup_apollo.c
> b/drivers/staging/speakup/speakup_apollo.c
> index 9cfdbbfb9742..6ad83dc642c4 100644
> --- a/drivers/staging/speakup/speakup_apollo.c
> +++ b/drivers/staging/speakup/speakup_apollo.c
> @@ -173,7 +173,7 @@ static void do_catch_up(struct spk_synth *synth)
>                 if (!synth->io_ops->synth_out(synth, ch)) {
>                         outb(UART_MCR_DTR, speakup_info.port_tts +
> UART_MCR);
>                         outb(UART_MCR_DTR | UART_MCR_RTS,
> -                                       speakup_info.port_tts + UART_MCR);
> +                            speakup_info.port_tts + UART_MCR);
>                         schedule_timeout(msecs_to_jiffies(full_time_val));
>                         continue;
>                 }
> diff --git a/drivers/staging/speakup/speakup_decext.c
> b/drivers/staging/speakup/speakup_decext.c
> index 929a28d618dc..c564bf8e1531 100644
> --- a/drivers/staging/speakup/speakup_decext.c
> +++ b/drivers/staging/speakup/speakup_decext.c
> @@ -206,11 +206,11 @@ static void do_catch_up(struct spk_synth *synth)
>                                 if (!in_escape)
>                                         synth->io_ops->synth_out(synth,
> PROCSPEECH);
>                                 spin_lock_irqsave(_info.spinlock,
> -                                                       flags);
> +                                                 flags);
>                                 jiffy_delta_val = jiffy_delta->u.n.value;
>                                 delay_time_val = delay_time->u.n.value;
>                                
> spin_unlock_irqrestore(_info.spinlock,
> -                                                       flags);
> +                                                      flags);
>                                 schedule_timeout(msecs_to_jiffies
>                                                  (delay_time_val));
>                                 jiff_max = jiffies + jiffy_delta_val;
> --
> 2.11.0
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web 
> visithttps://groups.google.com/d/msgid/outreachy-kernel/CA%2BXqjF9fNHFEUopsZH5rf
> iuha-Pv0WA%2B8oACvT_cNxwiSX-rjg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
>___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ad7746: Moved contents of the header to the source file.

2017-03-23 Thread Arushi Singhal
Moved the contents of the header(ad7746.h) into the source file
ad7746.c with the exception of the platform data struct which is
supposed to be used from somewhere else other than the driver.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/iio/cdc/ad7746.c | 5 +
 drivers/staging/iio/cdc/ad7746.h | 5 -
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c
index 2d8397b11b19..033a41fd9bee 100644
--- a/drivers/staging/iio/cdc/ad7746.c
+++ b/drivers/staging/iio/cdc/ad7746.c
@@ -21,6 +21,11 @@
 
 #include "ad7746.h"
 
+#define AD7466_EXCLVL_0 0 /* +-VDD/8 */
+#define AD7466_EXCLVL_1 1 /* +-VDD/4 */
+#define AD7466_EXCLVL_2 2 /* +-VDD * 3/8 */
+#define AD7466_EXCLVL_3 3 /* +-VDD/2 */
+
 /*
  * AD7746 Register Definition
  */
diff --git a/drivers/staging/iio/cdc/ad7746.h b/drivers/staging/iio/cdc/ad7746.h
index ea8572d1df02..2fbcee88fda6 100644
--- a/drivers/staging/iio/cdc/ad7746.h
+++ b/drivers/staging/iio/cdc/ad7746.h
@@ -13,11 +13,6 @@
  * TODO: struct ad7746_platform_data needs to go into include/linux/iio
  */
 
-#define AD7466_EXCLVL_00 /* +-VDD/8 */
-#define AD7466_EXCLVL_11 /* +-VDD/4 */
-#define AD7466_EXCLVL_22 /* +-VDD * 3/8 */
-#define AD7466_EXCLVL_33 /* +-VDD/2 */
-
 struct ad7746_platform_data {
unsigned char exclvl;   /*Excitation Voltage Level */
bool exca_en;   /* enables EXCA pin as the excitation output */
-- 
2.11.0

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


[PATCH] staging: tsl2x7x: Moved contents of the header to the source file.

2017-03-23 Thread Arushi Singhal
Moved the contents of the header(tsl2x7x.h) into the source file
tsl2x7x_core.c with the exception of the platform data struct which is
supposed to be used from somewhere else other than the driver.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/iio/light/tsl2x7x.h  | 57 ---
 drivers/staging/iio/light/tsl2x7x_core.c | 58 
 2 files changed, 58 insertions(+), 57 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.h 
b/drivers/staging/iio/light/tsl2x7x.h
index ecae92211216..7b71003ddb33 100644
--- a/drivers/staging/iio/light/tsl2x7x.h
+++ b/drivers/staging/iio/light/tsl2x7x.h
@@ -23,63 +23,6 @@
 #define __TSL2X7X_H
 #include 
 
-/* Max number of segments allowable in LUX table */
-#define TSL2X7X_MAX_LUX_TABLE_SIZE 9
-#define MAX_DEFAULT_TABLE_BYTES (sizeof(int) * TSL2X7X_MAX_LUX_TABLE_SIZE)
-
-struct iio_dev;
-
-struct tsl2x7x_lux {
-   unsigned int ratio;
-   unsigned int ch0;
-   unsigned int ch1;
-};
-
-/**
- * struct tsl2x7x_default_settings - power on defaults unless
- *   overridden by platform data.
- *  @als_time:  ALS Integration time - multiple of 50mS
- *  @als_gain:  Index into the ALS gain table.
- *  @als_gain_trim: default gain trim to account for
- *  aperture effects.
- *  @wait_time: Time between PRX and ALS cycles
- *  in 2.7 periods
- *  @prx_time:  5.2ms prox integration time -
- *  decrease in 2.7ms periods
- *  @prx_gain:  Proximity gain index
- *  @prox_config:   Prox configuration filters.
- *  @als_cal_target:Known external ALS reading for
- *  calibration.
- *  @interrupts_en: Enable/Disable - 0x00 = none, 0x10 = als,
- *   0x20 = prx,  0x30 = bth
- *  @persistence:   H/W Filters, Number of 'out of limits'
- *  ADC readings PRX/ALS.
- *  @als_thresh_low:CH0 'low' count to trigger interrupt.
- *  @als_thresh_high:   CH0 'high' count to trigger interrupt.
- *  @prox_thres_low:Low threshold proximity detection.
- *  @prox_thres_high:   High threshold proximity detection
- *  @prox_pulse_count:  Number if proximity emitter pulses
- *  @prox_max_samples_cal:  Used for prox cal.
- */
-struct tsl2x7x_settings {
-   int als_time;
-   int als_gain;
-   int als_gain_trim;
-   int wait_time;
-   int prx_time;
-   int prox_gain;
-   int prox_config;
-   int als_cal_target;
-   u8  interrupts_en;
-   u8  persistence;
-   int als_thresh_low;
-   int als_thresh_high;
-   int prox_thres_low;
-   int prox_thres_high;
-   int prox_pulse_count;
-   int prox_max_samples_cal;
-};
-
 /**
  * struct tsl2X7X_platform_data - Platform callback, glass and defaults
  * @platform_power:Suspend/resume platform callback
diff --git a/drivers/staging/iio/light/tsl2x7x_core.c 
b/drivers/staging/iio/light/tsl2x7x_core.c
index ea15bc1c300c..21cbf7e95c4e 100644
--- a/drivers/staging/iio/light/tsl2x7x_core.c
+++ b/drivers/staging/iio/light/tsl2x7x_core.c
@@ -32,6 +32,64 @@
 #include 
 #include "tsl2x7x.h"
 
+/* Max number of segments allowable in LUX table */
+#define TSL2X7X_MAX_LUX_TABLE_SIZE  9
+#define MAX_DEFAULT_TABLE_BYTES (sizeof(int) * TSL2X7X_MAX_LUX_TABLE_SIZE)
+
+struct iio_dev;
+
+struct tsl2x7x_lux {
+   unsigned int ratio;
+   unsigned int ch0;
+   unsigned int ch1;
+};
+
+/**
+ * struct tsl2x7x_default_settings - power on defaults unless
+ *   overridden by platform data.
+ *  @als_time:  ALS Integration time - multiple of 50mS
+ *  @als_gain:  Index into the ALS gain table.
+ *  @als_gain_trim: default gain trim to account for
+ *  aperture effects.
+ *  @wait_time: Time between PRX and ALS cycles
+ *  in 2.7 periods
+ *  @prx_time:  5.2ms prox integration time -
+ *  decrease in 2.7ms periods
+ *  @prx_gain:  Proximity gain index
+ *  @prox_config:   Prox configuration filters.
+ *  @als_cal_target:Known external ALS reading for
+ *  calibration.
+ *  @interrupts_en: Enable/Disable - 0x00 = none, 0x10 = als,
+ *   0x20 = prx,  0x30 = bth
+ *  @persistence:   H/W Filters, Number of 'out of limits'
+ *  ADC readings PRX/ALS.
+ *  @als_thresh_low:CH0 'low' count to trigger interrupt.
+ *  @als_thresh_high:   CH0 'high' count to trigger interrupt.
+ *  @prox_thres_low:Low threshold proximity detection.
+ *  @prox_thres_high:   High threshold 

Re: [PATCH v2] HV: properly delay KVP packets when negotiation is in progress

2017-03-23 Thread Vitaly Kuznetsov
Long Li  writes:

> The host may send multiple negotiation packets (due to timeout) before 
> the KVP user-mode daemon is connected. We need to defer processing  
> those packets until the daemon is negotiated and connected. It's okay
> for guest to respond to all negotiation packets.
>
> In addition, the host may send multiple staged KVP requests as soon as
> negotiation is done. We need to properly process those packets using 
> one tasklet for exclusive access to ring buffer.
>
> This patch is based on the work of Nick Meier 
> 
>
> The patch v2 has incorporated suggestion from Vitaly Kuznetsov 
> .
>
> Signed-off-by: Long Li 
> ---
>  drivers/hv/hv_kvp.c | 12 +++-
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
> index de26371..845b70b 100644
> --- a/drivers/hv/hv_kvp.c
> +++ b/drivers/hv/hv_kvp.c
> @@ -113,7 +113,7 @@ static void kvp_poll_wrapper(void *channel)
>  {
>   /* Transaction is finished, reset the state here to avoid races. */
>   kvp_transaction.state = HVUTIL_READY;
> - hv_kvp_onchannelcallback(channel);
> + tasklet_schedule(&((struct vmbus_channel*)channel)->callback_event);
>  }

There is one more function in the code which calls
hv_kvp_onchannelcallback():

static void kvp_host_handshake_func(struct work_struct *dummy)
{
hv_poll_channel(kvp_transaction.recv_channel, hv_kvp_onchannelcallback);
}

we can't replace hv_kvp_onchannelcallback with kvp_poll_wrapper here as
we don't want to reset kvp_transaction.state but it seems this should
also get updated, e.g. hv_poll_channel() here can be replaced with the 
direct 

 tasklet_schedule(&((struct vmbus_channel*)channel)->callback_event);

call. This will ensure hv_kvp_onchannelcallback() calls are always
serialized.

>
>  static void kvp_register_done(void)
> @@ -628,16 +628,17 @@ void hv_kvp_onchannelcallback(void *context)
>NEGO_IN_PROGRESS,
>NEGO_FINISHED} host_negotiatied = NEGO_NOT_STARTED;
>
> - if (host_negotiatied == NEGO_NOT_STARTED &&
> - kvp_transaction.state < HVUTIL_READY) {
> + if (kvp_transaction.state < HVUTIL_READY) {
>   /*
>* If userspace daemon is not connected and host is asking
>* us to negotiate we need to delay to not lose messages.
>* This is important for Failover IP setting.
>*/
> - host_negotiatied = NEGO_IN_PROGRESS;
> - schedule_delayed_work(_host_handshake_work,
> + if (host_negotiatied == NEGO_NOT_STARTED) {
> + host_negotiatied = NEGO_IN_PROGRESS;
> + schedule_delayed_work(_host_handshake_work,
> HV_UTIL_NEGO_TIMEOUT * HZ);
> + }
>   return;
>   }
>   if (kvp_transaction.state > HVUTIL_READY)
> @@ -705,6 +706,7 @@ void hv_kvp_onchannelcallback(void *context)
>  VM_PKT_DATA_INBAND, 0);
>
>   host_negotiatied = NEGO_FINISHED;
> + hv_poll_channel(kvp_transaction.recv_channel, kvp_poll_wrapper);
>   }
>
>  }

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


Re: [PATCH] staging: media: atomisp: fix build error

2017-03-23 Thread Alan Cox
On Thu, 2017-03-23 at 21:12 +0800, Geliang Tang wrote:
> Fix the following build error:
> 
>   CC  drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.o
> drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c:52:2:
>  error: excess elements in array initializer [-Werror]
>   "i", /* ion */
>   ^~~

NAK

I've sent a patch to sort this out properly we shouldn't be using
string arrays for single char values to start with...

Alan

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


Re: [Outreachy kernel] [PATCH v4] staging: iio: ade7753: Replace mlock with driver private lock

2017-03-23 Thread Alison Schofield
On Fri, Mar 24, 2017 at 12:05:20AM +0530, simran singhal wrote:
> The IIO subsystem is redefining iio_dev->mlock to be used by
> the IIO core only for protecting device operating mode changes.
> ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes.
> 
> In this driver, mlock was being used to protect hardware state
> changes.  Replace it with a lock in the devices global data.

Hi Simran,

Please post all revision histories below the --- not just the most
recent.

Does this lock enforce the needed "atomicity" in the write_frequency
function? I read Jonathans comment on a previous revision about
"ensuring the spi bus frequency and sampling frequency of the device
are changed in an atomic fashion"

Is it possible for another spi bus transaction (read or write) to
occur between the read and write in write_frequency?  

alisons
> 
> Signed-off-by: simran singhal 
> ---
> 
>  v4:
>-Add mutex_init
> 
>  drivers/staging/iio/meter/ade7753.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7753.c 
> b/drivers/staging/iio/meter/ade7753.c
> index b71fbd3..30aebaf 100644
> --- a/drivers/staging/iio/meter/ade7753.c
> +++ b/drivers/staging/iio/meter/ade7753.c
> @@ -80,11 +80,13 @@
>   * @us: actual spi_device
>   * @tx: transmit buffer
>   * @rx: receive buffer
> + * @lock:   protect sensor state
>   * @buf_lock:   mutex to protect tx and rx
>   **/
>  struct ade7753_state {
>   struct spi_device   *us;
>   struct mutexbuf_lock;
> + struct mutexlock;  /* protect sensor state */
>   u8  tx[ADE7753_MAX_TX] cacheline_aligned;
>   u8  rx[ADE7753_MAX_RX];
>  };
> @@ -484,7 +486,7 @@ static ssize_t ade7753_write_frequency(struct device *dev,
>   if (!val)
>   return -EINVAL;
>  
> - mutex_lock(_dev->mlock);
> + mutex_lock(>lock);
>  
>   t = 27900 / val;
>   if (t > 0)
> @@ -505,7 +507,7 @@ static ssize_t ade7753_write_frequency(struct device *dev,
>   ret = ade7753_spi_write_reg_16(dev, ADE7753_MODE, reg);
>  
>  out:
> - mutex_unlock(_dev->mlock);
> + mutex_unlock(>lock);
>  
>   return ret ? ret : len;
>  }
> @@ -581,6 +583,7 @@ static int ade7753_probe(struct spi_device *spi)
>   st = iio_priv(indio_dev);
>   st->us = spi;
>   mutex_init(>buf_lock);
> + mutex_init(>lock);
>  
>   indio_dev->name = spi->dev.driver->name;
>   indio_dev->dev.parent = >dev;
> -- 
> 2.7.4
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/20170323183520.GA9871%40singhal-Inspiron-5558.
> For more options, visit https://groups.google.com/d/optout.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[Please ignore this is a test] pci-hyperv: properly handle pci bus remove

2017-03-23 Thread Long Li
From: Long Li 

hv_pci_devices_present is called in hv_pci_remove when we remove a PCI 
device from host (e.g. by disabling SRIOV on a device). In hv_pci_remove,
the bus is already removed before the call, so we don't need to rescan the 
bus in the workqueue scheduled from hv_pci_devices_present. 

By introducing status hv_pcibus_removed, we can avoid this situation.

Signed-off-by: Long Li 
---
 drivers/pci/host/pci-hyperv.c | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index ada9856..8a92244 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -350,6 +350,7 @@ enum hv_pcibus_state {
hv_pcibus_init = 0,
hv_pcibus_probed,
hv_pcibus_installed,
+   hv_pcibus_removed,
hv_pcibus_maximum
 };
 
@@ -1504,12 +1505,19 @@ static void pci_devices_present_work(struct work_struct 
*work)
put_pcichild(hpdev, hv_pcidev_ref_initial);
}
 
-   /* Tell the core to rescan bus because there may have been changes. */
-   if (hbus->state == hv_pcibus_installed) {
+   switch(hbus->state) {
+   case hv_pcibus_installed:
+   /*
+   * Tell the core to rescan bus
+   * because there may have been changes.
+   */
pci_lock_rescan_remove();
pci_scan_child_bus(hbus->pci_bus);
pci_unlock_rescan_remove();
-   } else {
+   break;
+
+   case hv_pcibus_init:
+   case hv_pcibus_probed:
survey_child_resources(hbus);
}
 
@@ -2185,6 +2193,7 @@ static int hv_pci_probe(struct hv_device *hdev,
hbus = kzalloc(sizeof(*hbus), GFP_KERNEL);
if (!hbus)
return -ENOMEM;
+   hbus->state = hv_pcibus_init;
 
/*
 * The PCI bus "domain" is what is called "segment" in ACPI and
@@ -2348,6 +2357,7 @@ static int hv_pci_remove(struct hv_device *hdev)
pci_stop_root_bus(hbus->pci_bus);
pci_remove_root_bus(hbus->pci_bus);
pci_unlock_rescan_remove();
+   hbus->state = hv_pcibus_removed;
}
 
hv_pci_bus_exit(hdev);
-- 
2.7.4

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


[PATCH v4] staging: iio: ade7753: Replace mlock with driver private lock

2017-03-23 Thread simran singhal
The IIO subsystem is redefining iio_dev->mlock to be used by
the IIO core only for protecting device operating mode changes.
ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes.

In this driver, mlock was being used to protect hardware state
changes.  Replace it with a lock in the devices global data.

Signed-off-by: simran singhal 
---

 v4:
   -Add mutex_init

 drivers/staging/iio/meter/ade7753.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7753.c 
b/drivers/staging/iio/meter/ade7753.c
index b71fbd3..30aebaf 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -80,11 +80,13 @@
  * @us: actual spi_device
  * @tx: transmit buffer
  * @rx: receive buffer
+ * @lock:   protect sensor state
  * @buf_lock:   mutex to protect tx and rx
  **/
 struct ade7753_state {
struct spi_device   *us;
struct mutexbuf_lock;
+   struct mutexlock;  /* protect sensor state */
u8  tx[ADE7753_MAX_TX] cacheline_aligned;
u8  rx[ADE7753_MAX_RX];
 };
@@ -484,7 +486,7 @@ static ssize_t ade7753_write_frequency(struct device *dev,
if (!val)
return -EINVAL;
 
-   mutex_lock(_dev->mlock);
+   mutex_lock(>lock);
 
t = 27900 / val;
if (t > 0)
@@ -505,7 +507,7 @@ static ssize_t ade7753_write_frequency(struct device *dev,
ret = ade7753_spi_write_reg_16(dev, ADE7753_MODE, reg);
 
 out:
-   mutex_unlock(_dev->mlock);
+   mutex_unlock(>lock);
 
return ret ? ret : len;
 }
@@ -581,6 +583,7 @@ static int ade7753_probe(struct spi_device *spi)
st = iio_priv(indio_dev);
st->us = spi;
mutex_init(>buf_lock);
+   mutex_init(>lock);
 
indio_dev->name = spi->dev.driver->name;
indio_dev->dev.parent = >dev;
-- 
2.7.4

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


[PATCH] staging: iio: accel: remove unneeded braces around single statements

2017-03-23 Thread Mark Stenglein
Fixes three checkpatch warnings due to braces used when single
statements are sufficient.

Signed-off-by: Mark Stenglein 
---
 drivers/staging/iio/accel/adis16209.c | 3 +--
 drivers/staging/iio/accel/adis16240.c | 6 ++
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/iio/accel/adis16209.c 
b/drivers/staging/iio/accel/adis16209.c
index 52fa2e0511be..8485c024e3f5 100644
--- a/drivers/staging/iio/accel/adis16209.c
+++ b/drivers/staging/iio/accel/adis16209.c
@@ -255,9 +255,8 @@ static int adis16209_read_raw(struct iio_dev *indio_dev,
}
addr = adis16209_addresses[chan->scan_index][0];
ret = adis_read_reg_16(st, addr, );
-   if (ret) {
+   if (ret)
return ret;
-   }
val16 &= (1 << bits) - 1;
val16 = (s16)(val16 << (16 - bits)) >> (16 - bits);
*val = val16;
diff --git a/drivers/staging/iio/accel/adis16240.c 
b/drivers/staging/iio/accel/adis16240.c
index 6e3c95c9c3f6..109cd94b5ac3 100644
--- a/drivers/staging/iio/accel/adis16240.c
+++ b/drivers/staging/iio/accel/adis16240.c
@@ -290,9 +290,8 @@ static int adis16240_read_raw(struct iio_dev *indio_dev,
bits = 10;
addr = adis16240_addresses[chan->scan_index][0];
ret = adis_read_reg_16(st, addr, );
-   if (ret) {
+   if (ret)
return ret;
-   }
val16 &= (1 << bits) - 1;
val16 = (s16)(val16 << (16 - bits)) >> (16 - bits);
*val = val16;
@@ -301,9 +300,8 @@ static int adis16240_read_raw(struct iio_dev *indio_dev,
bits = 10;
addr = adis16240_addresses[chan->scan_index][1];
ret = adis_read_reg_16(st, addr, );
-   if (ret) {
+   if (ret)
return ret;
-   }
val16 &= (1 << bits) - 1;
val16 = (s16)(val16 << (16 - bits)) >> (16 - bits);
*val = val16;
-- 
2.12.1


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


Re: [PATCH 0/3] staging: media: Replace a bit shift.

2017-03-23 Thread Chris Moore

Hi,

Le 22/03/2017 à 05:26, Arushi Singhal a écrit :

Replace a bit shift by a use of BIT in media driver.

Arushi Singhal (3):
   staging: media: Replace a bit shift by a use of BIT.
   staging: media: davinci_vpfe: Replace a bit shift by a use of BIT.
   staging: media: omap4iss: Replace a bit shift by a use of BIT.

  .../media/atomisp/pci/atomisp2/atomisp_cmd.c   | 12 +-
  .../atomisp/pci/atomisp2/atomisp_compat_css20.c|  6 ++---
  .../media/atomisp/pci/atomisp2/atomisp_drvfs.c |  6 ++---
  .../media/atomisp/pci/atomisp2/atomisp_v4l2.c  | 18 +++
  .../media/atomisp/pci/atomisp2/hmm/hmm_bo.c|  2 +-
  drivers/staging/media/davinci_vpfe/dm365_ipipe.c   |  2 +-
  drivers/staging/media/davinci_vpfe/dm365_ipipeif.c |  2 +-
  drivers/staging/media/davinci_vpfe/dm365_isif.c| 26 +++---
  drivers/staging/media/davinci_vpfe/dm365_resizer.c |  6 ++---
  drivers/staging/media/omap4iss/iss_csi2.c  |  2 +-
  drivers/staging/media/omap4iss/iss_ipipe.c |  2 +-
  drivers/staging/media/omap4iss/iss_ipipeif.c   |  2 +-
  drivers/staging/media/omap4iss/iss_resizer.c   |  2 +-
  13 files changed, 44 insertions(+), 44 deletions(-)



Most of these replacements add redundant parentheses around the BIT macro.
IMHO this makes the code less readable.
So I suggest (BIT(c)) -> BIT(c).

Cheers,
Chris

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


[PATCH] staging:fbtft/fbtft-io: Fix incorrect type in assignment

2017-03-23 Thread Zhengyi Shen
Fix endian sparse warnings of incorrect type in assignment.
This patch changes type to the appropriate endian specific versions.


Signed-off-by: Zhengyi Shen 
---
 drivers/staging/fbtft/fbtft-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c
index d868405..ffb9a3b 100644
--- a/drivers/staging/fbtft/fbtft-io.c
+++ b/drivers/staging/fbtft/fbtft-io.c
@@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void 
*buf, size_t len)
src++;
}
tmp |= ((*src & 0x0100) ? 1 : 0);
-   *(u64 *)dst = cpu_to_be64(tmp);
+   *(__be64 *)dst = cpu_to_be64(tmp);
dst += 8;
*dst++ = (u8)(*src++ & 0x00FF);
added++;
-- 
2.7.4

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