[PATCH] X86/UAPI: Use __u64 instead of u64 in hyperv.h

2018-02-19 Thread KarimAllah Ahmed
... since u64 has a hidden header dependency that was not there before
using it (i.e. it breaks our VMM build). Also, __u64 is the right way to
expose the data type through UAPI.

Fixes: 93286261 ("x86/hyperv: Reenlightenment notifications support")
Signed-off-by: KarimAllah Ahmed 
Cc: K. Y. Srinivasan 
Cc: Haiyang Zhang 
Cc: Stephen Hemminger 
Cc: Thomas Gleixner 
Cc: Ingo Molnar 
Cc: H. Peter Anvin 
Cc: x...@kernel.org
Cc: de...@linuxdriverproject.org
Cc: linux-ker...@vger.kernel.org
---
 arch/x86/include/uapi/asm/hyperv.h | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/x86/include/uapi/asm/hyperv.h 
b/arch/x86/include/uapi/asm/hyperv.h
index 197c2e6..0994143 100644
--- a/arch/x86/include/uapi/asm/hyperv.h
+++ b/arch/x86/include/uapi/asm/hyperv.h
@@ -241,24 +241,24 @@
 #define HV_X64_MSR_REENLIGHTENMENT_CONTROL 0x4106
 
 struct hv_reenlightenment_control {
-   u64 vector:8;
-   u64 reserved1:8;
-   u64 enabled:1;
-   u64 reserved2:15;
-   u64 target_vp:32;
+   __u64 vector:8;
+   __u64 reserved1:8;
+   __u64 enabled:1;
+   __u64 reserved2:15;
+   __u64 target_vp:32;
 };
 
 #define HV_X64_MSR_TSC_EMULATION_CONTROL   0x4107
 #define HV_X64_MSR_TSC_EMULATION_STATUS0x4108
 
 struct hv_tsc_emulation_control {
-   u64 enabled:1;
-   u64 reserved:63;
+   __u64 enabled:1;
+   __u64 reserved:63;
 };
 
 struct hv_tsc_emulation_status {
-   u64 inprogress:1;
-   u64 reserved:63;
+   __u64 inprogress:1;
+   __u64 reserved:63;
 };
 
 #define HV_X64_MSR_HYPERCALL_ENABLE0x0001
-- 
2.7.4

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


Re: [PATCH v2] staging:iio:meter: Add name to function definition arguments

2018-02-19 Thread Dan Carpenter
> On Mon, Feb 19, 2018 at 01:28:32PM -0300, rodrigosiqueira wrote:
^^^
This looks good, but you need to fix your from email header.

regards,
dan carpenter


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


[PATCH v2] Staging: bcm2048: Fix function argument alignment in radio-bcm2048.c.

2018-02-19 Thread Quytelda Kahja
Fix a coding style problem.

Signed-off-by: Quytelda Kahja 
---
This is the patch without the unnecessary fixes for line length.

 drivers/staging/media/bcm2048/radio-bcm2048.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 06d1920150da..f38a4f2acdde 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -1864,7 +1864,7 @@ static int bcm2048_probe(struct bcm2048_device *bdev)
goto unlock;
 
err = bcm2048_set_fm_search_rssi_threshold(bdev,
-   BCM2048_DEFAULT_RSSI_THRESHOLD);
+  
BCM2048_DEFAULT_RSSI_THRESHOLD);
if (err < 0)
goto unlock;
 
@@ -1942,9 +1942,9 @@ static irqreturn_t bcm2048_handler(int irq, void *dev)
  */
 #define property_write(prop, type, mask, check)
\
 static ssize_t bcm2048_##prop##_write(struct device *dev,  \
-   struct device_attribute *attr,  \
-   const char *buf,\
-   size_t count)   \
+ struct device_attribute *attr,\
+ const char *buf,  \
+ size_t count) \
 {  \
struct bcm2048_device *bdev = dev_get_drvdata(dev); \
type value; \
@@ -1966,8 +1966,8 @@ static ssize_t bcm2048_##prop##_write(struct device *dev, 
\
 
 #define property_read(prop, mask)  \
 static ssize_t bcm2048_##prop##_read(struct device *dev,   \
-   struct device_attribute *attr,  \
-   char *buf)  \
+struct device_attribute *attr, \
+char *buf) \
 {  \
struct bcm2048_device *bdev = dev_get_drvdata(dev); \
int value;  \
@@ -1985,8 +1985,8 @@ static ssize_t bcm2048_##prop##_read(struct device *dev,  
\
 
 #define property_signed_read(prop, size, mask) \
 static ssize_t bcm2048_##prop##_read(struct device *dev,   \
-   struct device_attribute *attr,  \
-   char *buf)  \
+struct device_attribute *attr, \
+char *buf) \
 {  \
struct bcm2048_device *bdev = dev_get_drvdata(dev); \
size value; \
@@ -2005,8 +2005,8 @@ property_read(prop, mask) 
\
 
 #define property_str_read(prop, size)  \
 static ssize_t bcm2048_##prop##_read(struct device *dev,   \
-   struct device_attribute *attr,  \
-   char *buf)  \
+struct device_attribute *attr, \
+char *buf) \
 {  \
struct bcm2048_device *bdev = dev_get_drvdata(dev); \
int count;  \
@@ -2175,7 +2175,7 @@ static int bcm2048_fops_release(struct file *file)
 }
 
 static __poll_t bcm2048_fops_poll(struct file *file,
- struct poll_table_struct *pts)
+ struct poll_table_struct *pts)
 {
struct bcm2048_device *bdev = video_drvdata(file);
__poll_t retval = 0;
-- 
2.16.2

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


[PATCH v2 3/3] Staging: ks7010: hostif: Convert the ps_confirm_wait_inc() macro to a real function.

2018-02-19 Thread Quytelda Kahja
Convert the unsafe macro into an inline function.

Signed-off-by: Quytelda Kahja 
---
 drivers/staging/ks7010/ks_hostif.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index f554477fe6bc..74a08417bd0b 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1308,11 +1308,11 @@ int hostif_data_request(struct ks_wlan_private *priv, 
struct sk_buff *skb)
return ret;
 }
 
-#define ps_confirm_wait_inc(priv)   \
-   do { \
-   if (atomic_read(>psstatus.status) > PS_ACTIVE_SET) \
-   atomic_inc(>psstatus.confirm_wait);\
-   } while (0)
+static inline void ps_confirm_wait_inc(struct ks_wlan_private *priv)
+{
+   if (atomic_read(>psstatus.status) > PS_ACTIVE_SET)
+   atomic_inc(>psstatus.confirm_wait);
+}
 
 static
 void hostif_mib_get_request(struct ks_wlan_private *priv,
-- 
2.16.2

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


[PATCH v2 2/3] Staging: ks7010: hostif: Convert SME queue macros to real functions.

2018-02-19 Thread Quytelda Kahja
Convert the unsafe macros into inline functions.

Signed-off-by: Quytelda Kahja 
---
 drivers/staging/ks7010/ks_hostif.c | 23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 975dbbb3abd0..f554477fe6bc 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -21,13 +21,22 @@
 /* Include Wireless Extension definition and check version */
 #include /* New driver API */
 
-/* macro */
-#define inc_smeqhead(priv) \
-   (priv->sme_i.qhead = (priv->sme_i.qhead + 1) % SME_EVENT_BUFF_SIZE)
-#define inc_smeqtail(priv) \
-   (priv->sme_i.qtail = (priv->sme_i.qtail + 1) % SME_EVENT_BUFF_SIZE)
-#define cnt_smeqbody(priv) \
-   (((priv->sme_i.qtail + SME_EVENT_BUFF_SIZE) - (priv->sme_i.qhead)) % 
SME_EVENT_BUFF_SIZE)
+static inline void inc_smeqhead(struct ks_wlan_private *priv)
+{
+   priv->sme_i.qhead = (priv->sme_i.qhead + 1) % SME_EVENT_BUFF_SIZE;
+}
+
+static inline void inc_smeqtail(struct ks_wlan_private *priv)
+{
+   priv->sme_i.qtail = (priv->sme_i.qtail + 1) % SME_EVENT_BUFF_SIZE;
+}
+
+static inline unsigned int cnt_smeqbody(struct ks_wlan_private *priv)
+{
+   unsigned int sme_cnt = priv->sme_i.qtail - priv->sme_i.qhead;
+
+   return (sme_cnt + SME_EVENT_BUFF_SIZE) % SME_EVENT_BUFF_SIZE;
+}
 
 #define KS_WLAN_MEM_FLAG (GFP_ATOMIC)
 
-- 
2.16.2

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


[PATCH v2 1/3] Staging: ks7010: sdio: Convert RX/TX queue macros into real functions.

2018-02-19 Thread Quytelda Kahja
Convert the unsafe macros into inline functions.

Signed-off-by: Quytelda Kahja 
---
 drivers/staging/ks7010/ks7010_sdio.c | 46 ++--
 1 file changed, 33 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 8cfdff198334..7de78d1758b8 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -32,19 +32,39 @@ static const struct sdio_device_id ks7010_sdio_ids[] = {
 };
 MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
 
-#define inc_txqhead(priv) \
-   (priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE)
-#define inc_txqtail(priv) \
-   (priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE)
-#define cnt_txqbody(priv) \
-   (((priv->tx_dev.qtail + TX_DEVICE_BUFF_SIZE) - (priv->tx_dev.qhead)) % 
TX_DEVICE_BUFF_SIZE)
-
-#define inc_rxqhead(priv) \
-   (priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE)
-#define inc_rxqtail(priv) \
-   (priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE)
-#define cnt_rxqbody(priv) \
-   (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % 
RX_DEVICE_BUFF_SIZE)
+static inline void inc_txqhead(struct ks_wlan_private *priv)
+{
+   priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE;
+}
+
+static inline void inc_txqtail(struct ks_wlan_private *priv)
+{
+   priv->tx_dev.qtail = (priv->tx_dev.qtail + 1) % TX_DEVICE_BUFF_SIZE;
+}
+
+static inline unsigned int cnt_txqbody(struct ks_wlan_private *priv)
+{
+   unsigned int tx_cnt = priv->tx_dev.qtail - priv->tx_dev.qhead;
+
+   return (tx_cnt + TX_DEVICE_BUFF_SIZE) % TX_DEVICE_BUFF_SIZE;
+}
+
+static inline void inc_rxqhead(struct ks_wlan_private *priv)
+{
+   priv->rx_dev.qhead = (priv->rx_dev.qhead + 1) % RX_DEVICE_BUFF_SIZE;
+}
+
+static inline void inc_rxqtail(struct ks_wlan_private *priv)
+{
+   priv->rx_dev.qtail = (priv->rx_dev.qtail + 1) % RX_DEVICE_BUFF_SIZE;
+}
+
+static inline unsigned int cnt_rxqbody(struct ks_wlan_private *priv)
+{
+   unsigned int rx_cnt = priv->rx_dev.qtail - priv->rx_dev.qhead;
+
+   return (rx_cnt + RX_DEVICE_BUFF_SIZE) % RX_DEVICE_BUFF_SIZE;
+}
 
 /* Read single byte from device address into byte (CMD52) */
 static int ks7010_sdio_readb(struct ks_wlan_private *priv, unsigned int 
address,
-- 
2.16.2

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


RE: BANK-IN SLIP

2018-02-19 Thread Monica Cher

Dear Sir/Ma,

Kindly find attached bank-in slip for your kind perusal.

Please kindly follow the instruction to open the secured payment slip as 
we ensure the recipient to be the right person to do the needful 
confirmation and get back to me asap!


Payment made for invoice:

1. Inv. 1009408 - $ 6,222.00
2. Inv. 1009409 - $ 10,000.00

Thanks and Regards.
Account Dept.

Fax: 60-85-348977
Muhammad Rusydi
Project Engineer
JEFF GROUPS LTD.
www.jeffgroups.com

INV. 1009408.pdf
Description: Adobe PDF document
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: BANK-IN SLIP

2018-02-19 Thread Monica Cher

Dear Sir/Ma,

Kindly find attached bank-in slip for your kind perusal.

Please kindly follow the instruction to open the secured payment slip as 
we ensure the recipient to be the right person to do the needful 
confirmation and get back to me asap!


Payment made for invoice:

1. Inv. 1009408 - $ 6,222.00
2. Inv. 1009409 - $ 10,000.00

Thanks and Regards.
Account Dept.

Fax: 60-85-348977
Muhammad Rusydi
Project Engineer
JEFF GROUPS LTD.
www.jeffgroups.com

INV. 1009408.pdf
Description: Adobe PDF document
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: BANK-IN SLIP

2018-02-19 Thread Monica Cher

Dear Sir/Ma,

Kindly find attached bank-in slip for your kind perusal.

Please kindly follow the instruction to open the secured payment slip as 
we ensure the recipient to be the right person to do the needful 
confirmation and get back to me asap!


Payment made for invoice:

1. Inv. 1009408 - $ 6,222.00
2. Inv. 1009409 - $ 10,000.00

Thanks and Regards.
Account Dept.

Fax: 60-85-348977
Muhammad Rusydi
Project Engineer
JEFF GROUPS LTD.
www.jeffgroups.com

INV. 1009408.pdf
Description: Adobe PDF document
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] selftests: ion: Add simple test with the vgem driver

2018-02-19 Thread Daniel Vetter
On Mon, Feb 19, 2018 at 10:18:21AM -0800, Laura Abbott wrote:
> On 02/19/2018 07:31 AM, Daniel Vetter wrote:
> > On Thu, Feb 15, 2018 at 05:24:45PM -0800, Laura Abbott wrote:
> > > Ion is designed to be a framework used by other clients who perform
> > > operations on the buffer. Use the DRM vgem client as a simple consumer.
> > > In conjunction with the dma-buf sync ioctls, this tests the full 
> > > attach/map
> > > path for the system heap.
> > > 
> > > Signed-off-by: Laura Abbott 
> > > ---
> > >   tools/testing/selftests/android/ion/Makefile  |   3 +-
> > >   tools/testing/selftests/android/ion/config|   1 +
> > >   tools/testing/selftests/android/ion/ionmap_test.c | 136 
> > > ++
> > >   3 files changed, 139 insertions(+), 1 deletion(-)
> > >   create mode 100644 tools/testing/selftests/android/ion/ionmap_test.c
> > > 
> > > diff --git a/tools/testing/selftests/android/ion/Makefile 
> > > b/tools/testing/selftests/android/ion/Makefile
> > > index 96e0c448b39d..d23b6d537d8b 100644
> > > --- a/tools/testing/selftests/android/ion/Makefile
> > > +++ b/tools/testing/selftests/android/ion/Makefile
> > > @@ -2,7 +2,7 @@
> > >   INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/
> > >   CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g
> > > -TEST_GEN_FILES := ionapp_export ionapp_import
> > > +TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test
> > >   all: $(TEST_GEN_FILES)
> > > @@ -14,3 +14,4 @@ include ../../lib.mk
> > >   $(OUTPUT)/ionapp_export: ionapp_export.c ipcsocket.c ionutils.c
> > >   $(OUTPUT)/ionapp_import: ionapp_import.c ipcsocket.c ionutils.c
> > > +$(OUTPUT)/ionmap_test: ionmap_test.c ionutils.c
> > > diff --git a/tools/testing/selftests/android/ion/config 
> > > b/tools/testing/selftests/android/ion/config
> > > index 19db6ca9aa2b..b4ad748a9dd9 100644
> > > --- a/tools/testing/selftests/android/ion/config
> > > +++ b/tools/testing/selftests/android/ion/config
> > > @@ -2,3 +2,4 @@ CONFIG_ANDROID=y
> > >   CONFIG_STAGING=y
> > >   CONFIG_ION=y
> > >   CONFIG_ION_SYSTEM_HEAP=y
> > > +CONFIG_DRM_VGEM=y
> > > diff --git a/tools/testing/selftests/android/ion/ionmap_test.c 
> > > b/tools/testing/selftests/android/ion/ionmap_test.c
> > > new file mode 100644
> > > index ..dab36b06b37d
> > > --- /dev/null
> > > +++ b/tools/testing/selftests/android/ion/ionmap_test.c
> > > @@ -0,0 +1,136 @@
> > > +#include 
> > > +#include 
> > > +#include 
> > > +#include 
> > > +#include 
> > > +#include 
> > > +
> > > +#include 
> > > +#include 
> > > +#include 
> > > +
> > > +#include 
> > > +
> > > +#include 
> > > +
> > > +#include "ion.h"
> > > +#include "ionutils.h"
> > > +
> > > +int check_vgem(int fd)
> > > +{
> > > + drm_version_t version = { 0 };
> > > + char name[5];
> > > + int ret;
> > > +
> > > + version.name_len = 4;
> > > + version.name = name;
> > > +
> > > + ret = ioctl(fd, DRM_IOCTL_VERSION, );
> > > + if (ret)
> > > + return 1;
> > > +
> > > + return strcmp(name, "vgem");
> > > +}
> > > +
> > > +int open_vgem(void)
> > > +{
> > > + int i, fd;
> > > + const char *drmstr = "/dev/dri/card";
> > > +
> > > + fd = -1;
> > > + for (i = 0; i < 16; i++) {
> > > + char name[80];
> > > +
> > > + sprintf(name, "%s%u", drmstr, i);
> > > +
> > > + fd = open(name, O_RDWR);
> > > + if (fd < 0)
> > > + continue;
> > > +
> > > + if (check_vgem(fd)) {
> > > + close(fd);
> > > + continue;
> > > + } else {
> > > + break;
> > > + }
> > > +
> > > + }
> > > + return fd;
> > > +}
> > > +
> > > +int import_vgem_fd(int vgem_fd, int dma_buf_fd, uint32_t *handle)
> > > +{
> > > + struct drm_prime_handle import_handle = { 0 };
> > > + int ret;
> > > +
> > > + import_handle.fd = dma_buf_fd;
> > > + import_handle.flags = 0;
> > > + import_handle.handle = 0;
> > > +
> > > + ret = ioctl(vgem_fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, _handle);
> > > + if (ret == 0)
> > > + *handle = import_handle.handle;
> > > + return ret;
> > > +}
> > > +
> > > +void close_handle(int vgem_fd, uint32_t handle)
> > > +{
> > > + struct drm_gem_close close = { 0 };
> > > +
> > > + close.handle = handle;
> > > + ioctl(vgem_fd, DRM_IOCTL_GEM_CLOSE, );
> > > +}
> > > +
> > > +int main()
> > > +{
> > > + int ret, vgem_fd;
> > > + struct ion_buffer_info info;
> > > + uint32_t handle = 0;
> > > + struct dma_buf_sync sync = { 0 };
> > > +
> > > + info.heap_type = ION_HEAP_TYPE_SYSTEM;
> > > + info.heap_size = 4096;
> > > + info.flag_type = ION_FLAG_CACHED;
> > > +
> > > + ret = ion_export_buffer_fd();
> > > + if (ret < 0) {
> > > + printf("ion buffer alloc failed\n");
> > > + return -1;
> > > + }
> > > +
> > > + vgem_fd = open_vgem();
> > > + if (vgem_fd < 0) {
> > > + ret = vgem_fd;
> > > + printf("Failed to open vgem\n");
> > > + goto out_ion;
> > > + }
> > > +
> > > + ret = import_vgem_fd(vgem_fd, 

Re: [PATCH 2/2] selftests: ion: Add simple test with the vgem driver

2018-02-19 Thread Laura Abbott

On 02/19/2018 07:31 AM, Daniel Vetter wrote:

On Thu, Feb 15, 2018 at 05:24:45PM -0800, Laura Abbott wrote:

Ion is designed to be a framework used by other clients who perform
operations on the buffer. Use the DRM vgem client as a simple consumer.
In conjunction with the dma-buf sync ioctls, this tests the full attach/map
path for the system heap.

Signed-off-by: Laura Abbott 
---
  tools/testing/selftests/android/ion/Makefile  |   3 +-
  tools/testing/selftests/android/ion/config|   1 +
  tools/testing/selftests/android/ion/ionmap_test.c | 136 ++
  3 files changed, 139 insertions(+), 1 deletion(-)
  create mode 100644 tools/testing/selftests/android/ion/ionmap_test.c

diff --git a/tools/testing/selftests/android/ion/Makefile 
b/tools/testing/selftests/android/ion/Makefile
index 96e0c448b39d..d23b6d537d8b 100644
--- a/tools/testing/selftests/android/ion/Makefile
+++ b/tools/testing/selftests/android/ion/Makefile
@@ -2,7 +2,7 @@
  INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/
  CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g
  
-TEST_GEN_FILES := ionapp_export ionapp_import

+TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test
  
  all: $(TEST_GEN_FILES)
  
@@ -14,3 +14,4 @@ include ../../lib.mk
  
  $(OUTPUT)/ionapp_export: ionapp_export.c ipcsocket.c ionutils.c

  $(OUTPUT)/ionapp_import: ionapp_import.c ipcsocket.c ionutils.c
+$(OUTPUT)/ionmap_test: ionmap_test.c ionutils.c
diff --git a/tools/testing/selftests/android/ion/config 
b/tools/testing/selftests/android/ion/config
index 19db6ca9aa2b..b4ad748a9dd9 100644
--- a/tools/testing/selftests/android/ion/config
+++ b/tools/testing/selftests/android/ion/config
@@ -2,3 +2,4 @@ CONFIG_ANDROID=y
  CONFIG_STAGING=y
  CONFIG_ION=y
  CONFIG_ION_SYSTEM_HEAP=y
+CONFIG_DRM_VGEM=y
diff --git a/tools/testing/selftests/android/ion/ionmap_test.c 
b/tools/testing/selftests/android/ion/ionmap_test.c
new file mode 100644
index ..dab36b06b37d
--- /dev/null
+++ b/tools/testing/selftests/android/ion/ionmap_test.c
@@ -0,0 +1,136 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include "ion.h"
+#include "ionutils.h"
+
+int check_vgem(int fd)
+{
+   drm_version_t version = { 0 };
+   char name[5];
+   int ret;
+
+   version.name_len = 4;
+   version.name = name;
+
+   ret = ioctl(fd, DRM_IOCTL_VERSION, );
+   if (ret)
+   return 1;
+
+   return strcmp(name, "vgem");
+}
+
+int open_vgem(void)
+{
+   int i, fd;
+   const char *drmstr = "/dev/dri/card";
+
+   fd = -1;
+   for (i = 0; i < 16; i++) {
+   char name[80];
+
+   sprintf(name, "%s%u", drmstr, i);
+
+   fd = open(name, O_RDWR);
+   if (fd < 0)
+   continue;
+
+   if (check_vgem(fd)) {
+   close(fd);
+   continue;
+   } else {
+   break;
+   }
+
+   }
+   return fd;
+}
+
+int import_vgem_fd(int vgem_fd, int dma_buf_fd, uint32_t *handle)
+{
+   struct drm_prime_handle import_handle = { 0 };
+   int ret;
+
+   import_handle.fd = dma_buf_fd;
+   import_handle.flags = 0;
+   import_handle.handle = 0;
+
+   ret = ioctl(vgem_fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, _handle);
+   if (ret == 0)
+   *handle = import_handle.handle;
+   return ret;
+}
+
+void close_handle(int vgem_fd, uint32_t handle)
+{
+   struct drm_gem_close close = { 0 };
+
+   close.handle = handle;
+   ioctl(vgem_fd, DRM_IOCTL_GEM_CLOSE, );
+}
+
+int main()
+{
+   int ret, vgem_fd;
+   struct ion_buffer_info info;
+   uint32_t handle = 0;
+   struct dma_buf_sync sync = { 0 };
+
+   info.heap_type = ION_HEAP_TYPE_SYSTEM;
+   info.heap_size = 4096;
+   info.flag_type = ION_FLAG_CACHED;
+
+   ret = ion_export_buffer_fd();
+   if (ret < 0) {
+   printf("ion buffer alloc failed\n");
+   return -1;
+   }
+
+   vgem_fd = open_vgem();
+   if (vgem_fd < 0) {
+   ret = vgem_fd;
+   printf("Failed to open vgem\n");
+   goto out_ion;
+   }
+
+   ret = import_vgem_fd(vgem_fd, info.buffd, );
+
+   if (ret < 0) {
+   printf("Failed to import buffer\n");
+   goto out_vgem;
+   }
+
+   sync.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
+   ret = ioctl(info.buffd, DMA_BUF_IOCTL_SYNC, );
+   if (ret)
+   printf("sync start failed %d\n", errno);
+
+   memset(info.buffer, 0xff, 4096);
+
+   sync.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
+   ret = ioctl(info.buffd, DMA_BUF_IOCTL_SYNC, );
+   if (ret)
+   printf("sync end failed %d\n", errno);


At least in drm we require that userspace auto-restarts all ioctls when
they get interrupt. 

Re: [PATCH 3/4] Staging: ks7010: hostif: Fix multiple use of arguments in rate and event masking macros.

2018-02-19 Thread Greg KH
On Fri, Feb 16, 2018 at 06:25:02PM -0800, Quytelda Kahja wrote:
> Use GCC extensions to prevent macro arguments from accidentally being 
> evaluated
> multiple times when the macro is called.
> 
> Signed-off-by: Quytelda Kahja 
> ---
>  drivers/staging/ks7010/ks_hostif.h | 74 
> +-
>  1 file changed, 50 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks_hostif.h 
> b/drivers/staging/ks7010/ks_hostif.h
> index 5bae8d468e23..750ac86cee77 100644
> --- a/drivers/staging/ks7010/ks_hostif.h
> +++ b/drivers/staging/ks7010/ks_hostif.h
> @@ -599,19 +599,39 @@ struct hostif_mic_failure_confirm_t {
>  #define TX_RATE_48M  (uint8_t)(480 / 5)
>  #define TX_RATE_54M  (uint8_t)(540 / 5)
>  
> -#define IS_11B_RATE(A) (((A & RATE_MASK) == TX_RATE_1M) || ((A & RATE_MASK) 
> == TX_RATE_2M) || \
> - ((A & RATE_MASK) == TX_RATE_5M) || ((A & RATE_MASK) == 
> TX_RATE_11M))
> -
> -#define IS_OFDM_RATE(A) (((A & RATE_MASK) == TX_RATE_6M) || ((A & RATE_MASK) 
> == TX_RATE_12M) || \
> -  ((A & RATE_MASK) == TX_RATE_24M) || ((A & RATE_MASK) 
> == TX_RATE_9M) || \
> -  ((A & RATE_MASK) == TX_RATE_18M) || ((A & RATE_MASK) 
> == TX_RATE_36M) || \
> -  ((A & RATE_MASK) == TX_RATE_48M) || ((A & RATE_MASK) 
> == TX_RATE_54M))
> -
> -#define IS_11BG_RATE(A) (IS_11B_RATE(A) || IS_OFDM_RATE(A))
> -
> -#define IS_OFDM_EXT_RATE(A) (((A & RATE_MASK) == TX_RATE_9M) || ((A & 
> RATE_MASK) == TX_RATE_18M) || \
> -  ((A & RATE_MASK) == TX_RATE_36M) || ((A & 
> RATE_MASK) == TX_RATE_48M) || \
> -  ((A & RATE_MASK) == TX_RATE_54M))
> +#define IS_11B_RATE(A)   
> \
> + ({  \
> + typeof(A) A_ = (A); \
> + ((A_ & RATE_MASK) == TX_RATE_1M) || \
> + ((A_ & RATE_MASK) == TX_RATE_2M) || \
> + ((A_ & RATE_MASK) == TX_RATE_5M) || \
> + ((A_ & RATE_MASK) == TX_RATE_11M); })
> +

Again, please just make these real functions, if they are actually used.

thanks,

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


Re: [PATCH] staging: imx-media-vdic: fix inconsistent IS_ERR and PTR_ERR

2018-02-19 Thread Gustavo A. R. Silva

Hi Philipp,

On 02/19/2018 08:23 AM, Philipp Zabel wrote:

Hi Gustavo,

On Wed, 2018-02-14 at 14:57 -0600, Gustavo A. R. Silva wrote:

Hi all,

I was just wondering about the status of this patch.


It is en route as commit dcd71a9292b1 ("staging: imx-media-vdic: fix
inconsistent IS_ERR and PTR_ERR") in Hans' for-v4.17a branch:
   git://linuxtv.org/hverkuil/media_tree.git for-v4.17a



Awesome.

Thanks for the info.
--
Gustavo
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/4] Staging: ks7010: hostif: Fix multiple use of arguments in SME queue macros.

2018-02-19 Thread Greg KH
On Fri, Feb 16, 2018 at 06:25:01PM -0800, Quytelda Kahja wrote:
> Use GCC extensions to prevent macro arguments from accidentally being 
> evaluated
> multiple times when the macro is called.
> 
> Signed-off-by: Quytelda Kahja 
> ---
>  drivers/staging/ks7010/ks_hostif.c | 19 +--
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks_hostif.c 
> b/drivers/staging/ks7010/ks_hostif.c
> index 975dbbb3abd0..30c9592b3a00 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -22,12 +22,19 @@
>  #include   /* New driver API */
>  
>  /* macro */
> -#define inc_smeqhead(priv) \
> - (priv->sme_i.qhead = (priv->sme_i.qhead + 1) % SME_EVENT_BUFF_SIZE)
> -#define inc_smeqtail(priv) \
> - (priv->sme_i.qtail = (priv->sme_i.qtail + 1) % SME_EVENT_BUFF_SIZE)
> -#define cnt_smeqbody(priv) \
> - (((priv->sme_i.qtail + SME_EVENT_BUFF_SIZE) - (priv->sme_i.qhead)) % 
> SME_EVENT_BUFF_SIZE)
> +#define inc_smeqhead(priv)   \
> + ({ typeof(priv) priv_ = (priv); \
> + unsigned int next_qhead = priv_->sme_i.qhead + 1;   \
> + priv_->sme_i.qhead = next_qhead % SME_EVENT_BUFF_SIZE; })

No need, just make these real functions please.

thanks,

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


Re: [PATCH] Staging: gdm724x: LTE: Fix trailing open parenthesis code style issue.

2018-02-19 Thread Greg KH
On Fri, Feb 16, 2018 at 01:40:08PM -0800, Quytelda Kahja wrote:
> Fix a coding style problem causing warnings from checkpatch.pl.
> 
> Signed-off-by: Quytelda Kahja 
> ---
>  drivers/staging/gdm724x/gdm_lte.c | 50 
> ++-
>  1 file changed, 28 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/staging/gdm724x/gdm_lte.c 
> b/drivers/staging/gdm724x/gdm_lte.c
> index 0527b0d1c1d0..ff3fed9c4a81 100644
> --- a/drivers/staging/gdm724x/gdm_lte.c
> +++ b/drivers/staging/gdm724x/gdm_lte.c
> @@ -204,9 +204,12 @@ static __sum16 icmp6_checksum(struct ipv6hdr *ipv6, u16 
> *ptr, int len)
>   pseudo_header.ph.ph_nxt = ipv6->nexthdr;
>  
>   w = (u16 *)_header;
> - for (i = 0; i < ARRAY_SIZE(pseudo_header.pa); i++)
> - sum = csum_add(sum, csum_unfold(
> - (__force __sum16)pseudo_header.pa[i]));
> + for (i = 0; i < ARRAY_SIZE(pseudo_header.pa); i++) {
> + __wsum tmp_sum;
> +
> + tmp_sum = csum_unfold((__force __sum16)pseudo_header.pa[i]);
> + sum = csum_add(sum, tmp_sum);
> + }
>  
>   w = ptr;
>   while (len > 1) {
> @@ -510,18 +513,18 @@ static int gdm_lte_event_send(struct net_device *dev, 
> char *buf, int len)
>  {
>   struct nic *nic = netdev_priv(dev);
>   struct hci_packet *hci = (struct hci_packet *)buf;
> + struct gdm_endian *phy_endian;
>   int idx;
> + u16 cpu;
>   int ret;
>  
>   ret = sscanf(dev->name, "lte%d", );
>   if (ret != 1)
>   return -EINVAL;
>  
> - return netlink_send(lte_event.sock, idx, 0, buf,
> - gdm_dev16_to_cpu(
> - nic->phy_dev->get_endian(
> - nic->phy_dev->priv_dev), hci->len)
> - + HCI_HEADER_SIZE);
> + phy_endian = nic->phy_dev->get_endian(nic->phy_dev->priv_dev);
> + cpu = gdm_dev16_to_cpu(phy_endian, hci->len);
> + return netlink_send(lte_event.sock, idx, 0, buf, cpu + HCI_HEADER_SIZE);
>  }
>  
>  static void gdm_lte_event_rcv(struct net_device *dev, u16 type,
> @@ -728,17 +731,21 @@ static void gdm_lte_pdn_table(struct net_device *dev, 
> char *buf, int len)
>  {
>   struct nic *nic = netdev_priv(dev);
>   struct hci_pdn_table_ind *pdn_table = (struct hci_pdn_table_ind *)buf;
> + struct gdm_endian *dft_endian;
> + struct gdm_endian *nic_endian;
>  
>   if (pdn_table->activate) {
>   nic->pdn_table.activate = pdn_table->activate;
> - nic->pdn_table.dft_eps_id = gdm_dev32_to_cpu(
> - nic->phy_dev->get_endian(
> - nic->phy_dev->priv_dev),
> - pdn_table->dft_eps_id);
> - nic->pdn_table.nic_type = gdm_dev32_to_cpu(
> - nic->phy_dev->get_endian(
> - nic->phy_dev->priv_dev),
> - pdn_table->nic_type);
> +
> + dft_endian = nic->phy_dev->get_endian(nic->phy_dev->priv_dev);
> + nic_endian = nic->phy_dev->get_endian(nic->phy_dev->priv_dev);

These are the same values :(

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


Re: [PATCH] Staging: xgifb: fix lines should not end with open parenthesis in vb_setmode.c

2018-02-19 Thread Greg KH
On Sat, Feb 17, 2018 at 12:12:36AM +0530, Yash Omer wrote:
> This patch fixes up line should not end with open parenthesis found by 
> checkpatch.pl script.
> 
> Signed-off-by: Yash Omer 
> ---
>  drivers/staging/xgifb/vb_setmode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/xgifb/vb_setmode.c 
> b/drivers/staging/xgifb/vb_setmode.c
> index 1fa0dc66406e..1d6ac724fd61 100644
> --- a/drivers/staging/xgifb/vb_setmode.c
> +++ b/drivers/staging/xgifb/vb_setmode.c
> @@ -1228,8 +1228,8 @@ static void const *XGI_GetLcdPtr(struct 
> XGI330_LCDDataTablStruct const *table,
>   return table[i].DATAPTR;
>  }
>  
> -static struct SiS_TVData const *XGI_GetTVPtr(
> - unsigned short ModeIdIndex,
> +static struct SiS_TVData const *XGI_GetTVPtr
> +(unsigned short ModeIdIndex,

Ick, that's horrid looking now, don't you think?

Please don't change things to make them look worse :)

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


[PATCH v2] staging:iio:meter: Add name to function definition arguments

2018-02-19 Thread rodrigosiqueira
This patch fixes the checkpatch.pl warning:

drivers/staging/iio/meter/ade7854.h:157: WARNING: function definition
argument 'struct device *' should also have an identifier name...

This commit adds arguments names to the signature declared in the
ade7854_state struct. For consistency reason, It also renames all
arguments in function definitions.

Signed-off-by: Rodrigo Siqueira 
---
Changes in v2:
  - Make the commit message clearer.
  - Use the same arguments name across signatures and definitions.

 drivers/staging/iio/meter/ade7754.c |  6 +++---
 drivers/staging/iio/meter/ade7854-i2c.c | 28 ++--
 drivers/staging/iio/meter/ade7854-spi.c | 28 ++--
 drivers/staging/iio/meter/ade7854.h | 28 ++--
 4 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7754.c 
b/drivers/staging/iio/meter/ade7754.c
index 3a1e342d75fb..9aa067736715 100644
--- a/drivers/staging/iio/meter/ade7754.c
+++ b/drivers/staging/iio/meter/ade7754.c
@@ -132,7 +132,7 @@ static int ade7754_spi_write_reg_8(struct device *dev, u8 
reg_address, u8 val)
 }
 
 static int ade7754_spi_write_reg_16(struct device *dev,
-   u8 reg_address, u16 value)
+   u8 reg_address, u16 val)
 {
int ret;
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
@@ -140,8 +140,8 @@ static int ade7754_spi_write_reg_16(struct device *dev,
 
mutex_lock(>buf_lock);
st->tx[0] = ADE7754_WRITE_REG(reg_address);
-   st->tx[1] = (value >> 8) & 0xFF;
-   st->tx[2] = value & 0xFF;
+   st->tx[1] = (val >> 8) & 0xFF;
+   st->tx[2] = val & 0xFF;
ret = spi_write(st->us, st->tx, 3);
mutex_unlock(>buf_lock);
 
diff --git a/drivers/staging/iio/meter/ade7854-i2c.c 
b/drivers/staging/iio/meter/ade7854-i2c.c
index 8106f8cceeab..317e4f0d8176 100644
--- a/drivers/staging/iio/meter/ade7854-i2c.c
+++ b/drivers/staging/iio/meter/ade7854-i2c.c
@@ -17,7 +17,7 @@
 
 static int ade7854_i2c_write_reg_8(struct device *dev,
   u16 reg_address,
-  u8 value)
+  u8 val)
 {
int ret;
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
@@ -26,7 +26,7 @@ static int ade7854_i2c_write_reg_8(struct device *dev,
mutex_lock(>buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
-   st->tx[2] = value;
+   st->tx[2] = val;
 
ret = i2c_master_send(st->i2c, st->tx, 3);
mutex_unlock(>buf_lock);
@@ -36,7 +36,7 @@ static int ade7854_i2c_write_reg_8(struct device *dev,
 
 static int ade7854_i2c_write_reg_16(struct device *dev,
u16 reg_address,
-   u16 value)
+   u16 val)
 {
int ret;
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
@@ -45,8 +45,8 @@ static int ade7854_i2c_write_reg_16(struct device *dev,
mutex_lock(>buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
-   st->tx[2] = (value >> 8) & 0xFF;
-   st->tx[3] = value & 0xFF;
+   st->tx[2] = (val >> 8) & 0xFF;
+   st->tx[3] = val & 0xFF;
 
ret = i2c_master_send(st->i2c, st->tx, 4);
mutex_unlock(>buf_lock);
@@ -56,7 +56,7 @@ static int ade7854_i2c_write_reg_16(struct device *dev,
 
 static int ade7854_i2c_write_reg_24(struct device *dev,
u16 reg_address,
-   u32 value)
+   u32 val)
 {
int ret;
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
@@ -65,9 +65,9 @@ static int ade7854_i2c_write_reg_24(struct device *dev,
mutex_lock(>buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
-   st->tx[2] = (value >> 16) & 0xFF;
-   st->tx[3] = (value >> 8) & 0xFF;
-   st->tx[4] = value & 0xFF;
+   st->tx[2] = (val >> 16) & 0xFF;
+   st->tx[3] = (val >> 8) & 0xFF;
+   st->tx[4] = val & 0xFF;
 
ret = i2c_master_send(st->i2c, st->tx, 5);
mutex_unlock(>buf_lock);
@@ -77,7 +77,7 @@ static int ade7854_i2c_write_reg_24(struct device *dev,
 
 static int ade7854_i2c_write_reg_32(struct device *dev,
u16 reg_address,
-   u32 value)
+   u32 val)
 {
int ret;
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
@@ -86,10 +86,10 @@ static int ade7854_i2c_write_reg_32(struct device *dev,
mutex_lock(>buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
-   st->tx[2] = (value >> 24) & 0xFF;
-   st->tx[3] = (value >> 16) & 0xFF;
-   st->tx[4] = (value >> 8) & 0xFF;
- 

Re: [PATCH 2/2] selftests: ion: Add simple test with the vgem driver

2018-02-19 Thread Daniel Vetter
On Thu, Feb 15, 2018 at 05:24:45PM -0800, Laura Abbott wrote:
> Ion is designed to be a framework used by other clients who perform
> operations on the buffer. Use the DRM vgem client as a simple consumer.
> In conjunction with the dma-buf sync ioctls, this tests the full attach/map
> path for the system heap.
> 
> Signed-off-by: Laura Abbott 
> ---
>  tools/testing/selftests/android/ion/Makefile  |   3 +-
>  tools/testing/selftests/android/ion/config|   1 +
>  tools/testing/selftests/android/ion/ionmap_test.c | 136 
> ++
>  3 files changed, 139 insertions(+), 1 deletion(-)
>  create mode 100644 tools/testing/selftests/android/ion/ionmap_test.c
> 
> diff --git a/tools/testing/selftests/android/ion/Makefile 
> b/tools/testing/selftests/android/ion/Makefile
> index 96e0c448b39d..d23b6d537d8b 100644
> --- a/tools/testing/selftests/android/ion/Makefile
> +++ b/tools/testing/selftests/android/ion/Makefile
> @@ -2,7 +2,7 @@
>  INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/
>  CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g
>  
> -TEST_GEN_FILES := ionapp_export ionapp_import
> +TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test
>  
>  all: $(TEST_GEN_FILES)
>  
> @@ -14,3 +14,4 @@ include ../../lib.mk
>  
>  $(OUTPUT)/ionapp_export: ionapp_export.c ipcsocket.c ionutils.c
>  $(OUTPUT)/ionapp_import: ionapp_import.c ipcsocket.c ionutils.c
> +$(OUTPUT)/ionmap_test: ionmap_test.c ionutils.c
> diff --git a/tools/testing/selftests/android/ion/config 
> b/tools/testing/selftests/android/ion/config
> index 19db6ca9aa2b..b4ad748a9dd9 100644
> --- a/tools/testing/selftests/android/ion/config
> +++ b/tools/testing/selftests/android/ion/config
> @@ -2,3 +2,4 @@ CONFIG_ANDROID=y
>  CONFIG_STAGING=y
>  CONFIG_ION=y
>  CONFIG_ION_SYSTEM_HEAP=y
> +CONFIG_DRM_VGEM=y
> diff --git a/tools/testing/selftests/android/ion/ionmap_test.c 
> b/tools/testing/selftests/android/ion/ionmap_test.c
> new file mode 100644
> index ..dab36b06b37d
> --- /dev/null
> +++ b/tools/testing/selftests/android/ion/ionmap_test.c
> @@ -0,0 +1,136 @@
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include 
> +
> +#include "ion.h"
> +#include "ionutils.h"
> +
> +int check_vgem(int fd)
> +{
> + drm_version_t version = { 0 };
> + char name[5];
> + int ret;
> +
> + version.name_len = 4;
> + version.name = name;
> +
> + ret = ioctl(fd, DRM_IOCTL_VERSION, );
> + if (ret)
> + return 1;
> +
> + return strcmp(name, "vgem");
> +}
> +
> +int open_vgem(void)
> +{
> + int i, fd;
> + const char *drmstr = "/dev/dri/card";
> +
> + fd = -1;
> + for (i = 0; i < 16; i++) {
> + char name[80];
> +
> + sprintf(name, "%s%u", drmstr, i);
> +
> + fd = open(name, O_RDWR);
> + if (fd < 0)
> + continue;
> +
> + if (check_vgem(fd)) {
> + close(fd);
> + continue;
> + } else {
> + break;
> + }
> +
> + }
> + return fd;
> +}
> +
> +int import_vgem_fd(int vgem_fd, int dma_buf_fd, uint32_t *handle)
> +{
> + struct drm_prime_handle import_handle = { 0 };
> + int ret;
> +
> + import_handle.fd = dma_buf_fd;
> + import_handle.flags = 0;
> + import_handle.handle = 0;
> +
> + ret = ioctl(vgem_fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, _handle);
> + if (ret == 0)
> + *handle = import_handle.handle;
> + return ret;
> +}
> +
> +void close_handle(int vgem_fd, uint32_t handle)
> +{
> + struct drm_gem_close close = { 0 };
> +
> + close.handle = handle;
> + ioctl(vgem_fd, DRM_IOCTL_GEM_CLOSE, );
> +}
> +
> +int main()
> +{
> + int ret, vgem_fd;
> + struct ion_buffer_info info;
> + uint32_t handle = 0;
> + struct dma_buf_sync sync = { 0 };
> +
> + info.heap_type = ION_HEAP_TYPE_SYSTEM;
> + info.heap_size = 4096;
> + info.flag_type = ION_FLAG_CACHED;
> +
> + ret = ion_export_buffer_fd();
> + if (ret < 0) {
> + printf("ion buffer alloc failed\n");
> + return -1;
> + }
> +
> + vgem_fd = open_vgem();
> + if (vgem_fd < 0) {
> + ret = vgem_fd;
> + printf("Failed to open vgem\n");
> + goto out_ion;
> + }
> +
> + ret = import_vgem_fd(vgem_fd, info.buffd, );
> +
> + if (ret < 0) {
> + printf("Failed to import buffer\n");
> + goto out_vgem;
> + }
> +
> + sync.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
> + ret = ioctl(info.buffd, DMA_BUF_IOCTL_SYNC, );
> + if (ret)
> + printf("sync start failed %d\n", errno);
> +
> + memset(info.buffer, 0xff, 4096);
> +
> + sync.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
> + ret = ioctl(info.buffd, DMA_BUF_IOCTL_SYNC, );
> + if (ret)
> +  

[PATCH 13/14] staging: wilc1000: rename wilc_remove_key() parameters to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 4cbfe3b..7ddd20d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2674,13 +2674,13 @@ static void timer_connect_cb(struct timer_list *t)
wilc_enqueue_cmd();
 }
 
-s32 wilc_remove_key(struct host_if_drv *hif_drv, const u8 *pu8StaAddress)
+s32 wilc_remove_key(struct host_if_drv *hif_drv, const u8 *sta_addr)
 {
struct wid wid;
 
wid.id = (u16)WID_REMOVE_KEY;
wid.type = WID_STR;
-   wid.val = (s8 *)pu8StaAddress;
+   wid.val = (s8 *)sta_addr;
wid.size = 6;
 
return 0;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index aa914d6..4b60b18 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -304,7 +304,7 @@ struct add_sta_param {
 };
 
 struct wilc_vif;
-s32 wilc_remove_key(struct host_if_drv *hWFIDrv, const u8 *pu8StaAddress);
+s32 wilc_remove_key(struct host_if_drv *hif_drv, const u8 *sta_addr);
 int wilc_remove_wep_key(struct wilc_vif *vif, u8 index);
 int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index);
 int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 len,
-- 
2.7.4

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


[PATCH 14/14] staging: wilc1000: remove Unnecessary parentheses around 'hif_set_mc->cnt'

2018-02-19 Thread Ajay Singh
Fix "Unnecessary parentheses around 'hif_set_mc->cnt'" issue found by
checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 7ddd20d..6f93966 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2430,7 +2430,7 @@ static void Handle_SetMulticastFilter(struct wilc_vif 
*vif,
*cur_byte++ = ((hif_set_mc->cnt >> 16) & 0xFF);
*cur_byte++ = ((hif_set_mc->cnt >> 24) & 0xFF);
 
-   if ((hif_set_mc->cnt) > 0)
+   if (hif_set_mc->cnt > 0)
memcpy(cur_byte, wilc_multicast_mac_addr_list,
   ((hif_set_mc->cnt) * ETH_ALEN));
 
-- 
2.7.4

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


[PATCH 12/14] staging: wilc1000: rename GetPeriodicRSSI to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 6dd1061..4cbfe3b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3316,7 +3316,7 @@ int wilc_hif_set_cfg(struct wilc_vif *vif,
return wilc_enqueue_cmd();
 }
 
-static void GetPeriodicRSSI(struct timer_list *unused)
+static void get_periodic_rssi(struct timer_list *unused)
 {
struct wilc_vif *vif = periodic_rssi_vif;
 
@@ -3381,7 +3381,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv 
**hif_drv_handler)
}
 
periodic_rssi_vif = vif;
-   timer_setup(_rssi, GetPeriodicRSSI, 0);
+   timer_setup(_rssi, get_periodic_rssi, 0);
mod_timer(_rssi, jiffies + msecs_to_jiffies(5000));
}
 
-- 
2.7.4

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


[PATCH 11/14] staging: wilc1000: rename ListenTimerCB to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 6e39766..6dd1061 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2362,7 +2362,7 @@ static u32 handle_listen_state_expired(struct wilc_vif 
*vif,
return result;
 }
 
-static void ListenTimerCB(struct timer_list *t)
+static void listen_timer_cb(struct timer_list *t)
 {
struct host_if_drv *hif_drv = from_timer(hif_drv, t,
  remain_on_ch_timer);
@@ -3387,7 +3387,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv 
**hif_drv_handler)
 
timer_setup(_drv->scan_timer, timer_scan_cb, 0);
timer_setup(_drv->connect_timer, timer_connect_cb, 0);
-   timer_setup(_drv->remain_on_ch_timer, ListenTimerCB, 0);
+   timer_setup(_drv->remain_on_ch_timer, listen_timer_cb, 0);
 
mutex_init(_drv->cfg_values_lock);
mutex_lock(_drv->cfg_values_lock);
-- 
2.7.4

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


[PATCH 10/14] staging: wilc1000: rename functions starting with TimerCB_ to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issues found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index b861c95..6e39766 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2647,7 +2647,7 @@ static void host_if_work(struct work_struct *work)
complete(_thread_comp);
 }
 
-static void TimerCB_Scan(struct timer_list *t)
+static void timer_scan_cb(struct timer_list *t)
 {
struct host_if_drv *hif_drv = from_timer(hif_drv, t, scan_timer);
struct wilc_vif *vif = hif_drv->scan_timer_vif;
@@ -2660,7 +2660,7 @@ static void TimerCB_Scan(struct timer_list *t)
wilc_enqueue_cmd();
 }
 
-static void TimerCB_Connect(struct timer_list *t)
+static void timer_connect_cb(struct timer_list *t)
 {
struct host_if_drv *hif_drv = from_timer(hif_drv, t,
  connect_timer);
@@ -3385,8 +3385,8 @@ int wilc_init(struct net_device *dev, struct host_if_drv 
**hif_drv_handler)
mod_timer(_rssi, jiffies + msecs_to_jiffies(5000));
}
 
-   timer_setup(_drv->scan_timer, TimerCB_Scan, 0);
-   timer_setup(_drv->connect_timer, TimerCB_Connect, 0);
+   timer_setup(_drv->scan_timer, timer_scan_cb, 0);
+   timer_setup(_drv->connect_timer, timer_connect_cb, 0);
timer_setup(_drv->remain_on_ch_timer, ListenTimerCB, 0);
 
mutex_init(_drv->cfg_values_lock);
-- 
2.7.4

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


[PATCH 09/14] staging: wilc1000: rename functions starting with Handle_ to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 98 +++
 1 file changed, 49 insertions(+), 49 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 24c9a36..b861c95 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -902,7 +902,7 @@ static s32 handle_scan_done(struct wilc_vif *vif,
 }
 
 u8 wilc_connected_ssid[6] = {0};
-static s32 Handle_Connect(struct wilc_vif *vif,
+static s32 handle_connect(struct wilc_vif *vif,
  struct connect_attr *pstrHostIFconnectAttr)
 {
s32 result = 0;
@@ -1244,8 +1244,8 @@ static s32 handle_connect_timeout(struct wilc_vif *vif)
return result;
 }
 
-static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
-   struct rcvd_net_info *rcvd_info)
+static s32 handle_rcvd_ntwrk_info(struct wilc_vif *vif,
+ struct rcvd_net_info *rcvd_info)
 {
u32 i;
bool bNewNtwrkFound;
@@ -1318,8 +1318,8 @@ static s32 host_int_get_assoc_res_info(struct wilc_vif 
*vif,
   u32 max_assoc_resp_info_len,
   u32 *rcvd_assoc_resp_info_len);
 
-static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
-   struct rcvd_async_info *rcvd_info)
+static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
+  struct rcvd_async_info *rcvd_info)
 {
s32 result = 0;
u8 u8MsgType = 0;
@@ -1777,7 +1777,7 @@ static int handle_key(struct wilc_vif *vif,
return result;
 }
 
-static void Handle_Disconnect(struct wilc_vif *vif)
+static void handle_disconnect(struct wilc_vif *vif)
 {
struct wid wid;
struct host_if_drv *hif_drv = vif->hif_drv;
@@ -1869,7 +1869,7 @@ void wilc_resolve_disconnect_aberration(struct wilc_vif 
*vif)
wilc_disconnect(vif, 1);
 }
 
-static void Handle_GetRssi(struct wilc_vif *vif)
+static void handle_get_rssi(struct wilc_vif *vif)
 {
s32 result = 0;
struct wid wid;
@@ -1889,8 +1889,8 @@ static void Handle_GetRssi(struct wilc_vif *vif)
complete(>hif_drv->comp_get_rssi);
 }
 
-static s32 Handle_GetStatistics(struct wilc_vif *vif,
-   struct rf_info *pstrStatistics)
+static s32 handle_get_statistics(struct wilc_vif *vif,
+struct rf_info *pstrStatistics)
 {
struct wid wid_list[5];
u32 wid_cnt = 0, result = 0;
@@ -1943,8 +1943,8 @@ static s32 Handle_GetStatistics(struct wilc_vif *vif,
return 0;
 }
 
-static s32 Handle_Get_InActiveTime(struct wilc_vif *vif,
-  struct sta_inactive_t *hif_sta_inactive)
+static s32 handle_get_inactive_time(struct wilc_vif *vif,
+   struct sta_inactive_t *hif_sta_inactive)
 {
s32 result = 0;
u8 *stamac;
@@ -1987,8 +1987,8 @@ static s32 Handle_Get_InActiveTime(struct wilc_vif *vif,
return result;
 }
 
-static void Handle_AddBeacon(struct wilc_vif *vif,
-struct beacon_attr *pstrSetBeaconParam)
+static void handle_add_beacon(struct wilc_vif *vif,
+ struct beacon_attr *pstrSetBeaconParam)
 {
s32 result = 0;
struct wid wid;
@@ -2040,7 +2040,7 @@ static void Handle_AddBeacon(struct wilc_vif *vif,
kfree(pstrSetBeaconParam->tail);
 }
 
-static void Handle_DelBeacon(struct wilc_vif *vif)
+static void handle_del_beacon(struct wilc_vif *vif)
 {
s32 result = 0;
struct wid wid;
@@ -2095,8 +2095,8 @@ static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer,
return cur_byte - pu8Buffer;
 }
 
-static void Handle_AddStation(struct wilc_vif *vif,
- struct add_sta_param *pstrStationParam)
+static void handle_add_station(struct wilc_vif *vif,
+  struct add_sta_param *pstrStationParam)
 {
s32 result = 0;
struct wid wid;
@@ -2164,8 +2164,8 @@ static void handle_del_all_sta(struct wilc_vif *vif,
complete(_wait_response);
 }
 
-static void Handle_DelStation(struct wilc_vif *vif,
- struct del_sta *pstrDelStaParam)
+static void handle_del_station(struct wilc_vif *vif,
+  struct del_sta *pstrDelStaParam)
 {
s32 result = 0;
struct wid wid;
@@ -2192,8 +2192,8 @@ static void Handle_DelStation(struct wilc_vif *vif,
kfree(wid.val);
 }
 
-static void Handle_EditStation(struct wilc_vif *vif,
-  struct add_sta_param *pstrStationParam)
+static void handle_edit_station(struct wilc_vif *vif,
+   struct add_sta_param *pstrStationParam)
 {
s32 result = 

[PATCH 08/14] staging: wilc1000: rename pstrRcvdNetworkInfo to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index d489b27..24c9a36 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1245,7 +1245,7 @@ static s32 handle_connect_timeout(struct wilc_vif *vif)
 }
 
 static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
-   struct rcvd_net_info *pstrRcvdNetworkInfo)
+   struct rcvd_net_info *rcvd_info)
 {
u32 i;
bool bNewNtwrkFound;
@@ -1257,7 +1257,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
bNewNtwrkFound = true;
 
if (hif_drv->usr_scan_req.scan_result) {
-   wilc_parse_network_info(pstrRcvdNetworkInfo->buffer, 
);
+   wilc_parse_network_info(rcvd_info->buffer, );
if (!pstrNetworkInfo ||
!hif_drv->usr_scan_req.scan_result) {
netdev_err(vif->ndev, "driver is null\n");
@@ -1302,8 +1302,8 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
}
 
 done:
-   kfree(pstrRcvdNetworkInfo->buffer);
-   pstrRcvdNetworkInfo->buffer = NULL;
+   kfree(rcvd_info->buffer);
+   rcvd_info->buffer = NULL;
 
if (pstrNetworkInfo) {
kfree(pstrNetworkInfo->ies);
-- 
2.7.4

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


[PATCH 07/14] staging: wilc1000: rename pstrRcvdGnrlAsyncInfo to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index f685da2..d489b27 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1319,7 +1319,7 @@ static s32 host_int_get_assoc_res_info(struct wilc_vif 
*vif,
   u32 *rcvd_assoc_resp_info_len);
 
 static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
-   struct rcvd_async_info 
*pstrRcvdGnrlAsyncInfo)
+   struct rcvd_async_info *rcvd_info)
 {
s32 result = 0;
u8 u8MsgType = 0;
@@ -1343,26 +1343,26 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif 
*vif,
if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP ||
hif_drv->hif_state == HOST_IF_CONNECTED ||
hif_drv->usr_scan_req.scan_result) {
-   if (!pstrRcvdGnrlAsyncInfo->buffer ||
+   if (!rcvd_info->buffer ||
!hif_drv->usr_conn_req.conn_result) {
netdev_err(vif->ndev, "driver is null\n");
return -EINVAL;
}
 
-   u8MsgType = pstrRcvdGnrlAsyncInfo->buffer[0];
+   u8MsgType = rcvd_info->buffer[0];
 
if ('I' != u8MsgType) {
netdev_err(vif->ndev, "Received Message incorrect.\n");
return -EFAULT;
}
 
-   u8MsgID = pstrRcvdGnrlAsyncInfo->buffer[1];
-   u16MsgLen = MAKE_WORD16(pstrRcvdGnrlAsyncInfo->buffer[2], 
pstrRcvdGnrlAsyncInfo->buffer[3]);
-   u16WidID = MAKE_WORD16(pstrRcvdGnrlAsyncInfo->buffer[4], 
pstrRcvdGnrlAsyncInfo->buffer[5]);
-   u8WidLen = pstrRcvdGnrlAsyncInfo->buffer[6];
-   u8MacStatus  = pstrRcvdGnrlAsyncInfo->buffer[7];
-   u8MacStatusReasonCode = pstrRcvdGnrlAsyncInfo->buffer[8];
-   u8MacStatusAdditionalInfo = pstrRcvdGnrlAsyncInfo->buffer[9];
+   u8MsgID = rcvd_info->buffer[1];
+   u16MsgLen = MAKE_WORD16(rcvd_info->buffer[2], 
rcvd_info->buffer[3]);
+   u16WidID = MAKE_WORD16(rcvd_info->buffer[4], 
rcvd_info->buffer[5]);
+   u8WidLen = rcvd_info->buffer[6];
+   u8MacStatus  = rcvd_info->buffer[7];
+   u8MacStatusReasonCode = rcvd_info->buffer[8];
+   u8MacStatusAdditionalInfo = rcvd_info->buffer[9];
if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) {
u32 u32RcvdAssocRespInfoLen = 0;
struct connect_resp_info *pstrConnectRespInfo = NULL;
@@ -1519,8 +1519,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
}
}
 
-   kfree(pstrRcvdGnrlAsyncInfo->buffer);
-   pstrRcvdGnrlAsyncInfo->buffer = NULL;
+   kfree(rcvd_info->buffer);
+   rcvd_info->buffer = NULL;
 
return result;
 }
-- 
2.7.4

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


[PATCH 06/14] staging: wilc1000: rename strHostIfStaInactiveT to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

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

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index eda395d..f685da2 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1944,7 +1944,7 @@ static s32 Handle_GetStatistics(struct wilc_vif *vif,
 }
 
 static s32 Handle_Get_InActiveTime(struct wilc_vif *vif,
-  struct sta_inactive_t *strHostIfStaInactiveT)
+  struct sta_inactive_t *hif_sta_inactive)
 {
s32 result = 0;
u8 *stamac;
@@ -1959,7 +1959,7 @@ static s32 Handle_Get_InActiveTime(struct wilc_vif *vif,
return -ENOMEM;
 
stamac = wid.val;
-   ether_addr_copy(stamac, strHostIfStaInactiveT->mac);
+   ether_addr_copy(stamac, hif_sta_inactive->mac);
 
result = wilc_send_config_pkt(vif, SET_CFG, , 1,
  wilc_get_vif_idx(vif));
-- 
2.7.4

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


[PATCH 05/14] staging: wilc1000: rename pstrHostIfRegisterFrame to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 11e4737..eda395d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2290,7 +2290,7 @@ static int Handle_RemainOnChan(struct wilc_vif *vif,
 }
 
 static int Handle_RegisterFrame(struct wilc_vif *vif,
-   struct reg_frame *pstrHostIfRegisterFrame)
+   struct reg_frame *hif_reg_frame)
 {
s32 result = 0;
struct wid wid;
@@ -2304,9 +2304,9 @@ static int Handle_RegisterFrame(struct wilc_vif *vif,
 
cur_byte = wid.val;
 
-   *cur_byte++ = pstrHostIfRegisterFrame->reg;
-   *cur_byte++ = pstrHostIfRegisterFrame->reg_id;
-   memcpy(cur_byte, >frame_type, sizeof(u16));
+   *cur_byte++ = hif_reg_frame->reg;
+   *cur_byte++ = hif_reg_frame->reg_id;
+   memcpy(cur_byte, _reg_frame->frame_type, sizeof(u16));
 
wid.size = sizeof(u16) + 2;
 
-- 
2.7.4

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


[PATCH 00/14] staging: wilc1000: fix to avoid cameCase & unnecessary parentheses

2018-02-19 Thread Ajay Singh
This patch series removes the issues found by checkpatch.pl script
in host_interface.c/.h file.

Ajay Singh (14):
  staging: wilc1000: rename s8PowerMode & strPowerMgmtParam to avoid
camelCase
  staging: wilc1000: rename strHostIfSetMulti to avoid camelCase
  staging: wilc1000: rename host_int_get_assoc_res_info() parameters to
avoid camelCase
  staging: wilc1000: rename pstrHostIfRemainOnChan to avoid camelCase
  staging: wilc1000: rename pstrHostIfRegisterFrame to avoid camelCase
  staging: wilc1000: rename strHostIfStaInactiveT to avoid camelCase
  staging: wilc1000: rename pstrRcvdGnrlAsyncInfo to avoid camelCase
  staging: wilc1000: rename pstrRcvdNetworkInfo to avoid camelCase
  staging: wilc1000: rename functions starting with Handle_ to avoid
camelCase
  staging: wilc1000: rename functions starting with TimerCB_ to avoid
camelCase
  staging: wilc1000: rename ListenTimerCB to avoid camelCase
  staging: wilc1000: rename GetPeriodicRSSI to avoid camelCase
  staging: wilc1000: rename wilc_remove_key() parameters to avoid
camelCase
  staging: wilc1000: remove Unnecessary parentheses around
'hif_set_mc->cnt'

 drivers/staging/wilc1000/host_interface.c | 220 +++---
 drivers/staging/wilc1000/host_interface.h |   2 +-
 2 files changed, 111 insertions(+), 111 deletions(-)

-- 
2.7.4

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


[PATCH 02/14] staging: wilc1000: rename strHostIfSetMulti to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 3dc3d2e..edd35b7 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2406,7 +2406,7 @@ static void Handle_PowerManagement(struct wilc_vif *vif,
 }
 
 static void Handle_SetMulticastFilter(struct wilc_vif *vif,
- struct set_multicast *strHostIfSetMulti)
+ struct set_multicast *hif_set_mc)
 {
s32 result = 0;
struct wid wid;
@@ -2414,25 +2414,25 @@ static void Handle_SetMulticastFilter(struct wilc_vif 
*vif,
 
wid.id = (u16)WID_SETUP_MULTICAST_FILTER;
wid.type = WID_BIN;
-   wid.size = sizeof(struct set_multicast) + (strHostIfSetMulti->cnt * 
ETH_ALEN);
+   wid.size = sizeof(struct set_multicast) + (hif_set_mc->cnt * ETH_ALEN);
wid.val = kmalloc(wid.size, GFP_KERNEL);
if (!wid.val)
goto ERRORHANDLER;
 
cur_byte = wid.val;
-   *cur_byte++ = (strHostIfSetMulti->enabled & 0xFF);
+   *cur_byte++ = (hif_set_mc->enabled & 0xFF);
*cur_byte++ = 0;
*cur_byte++ = 0;
*cur_byte++ = 0;
 
-   *cur_byte++ = (strHostIfSetMulti->cnt & 0xFF);
-   *cur_byte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF);
-   *cur_byte++ = ((strHostIfSetMulti->cnt >> 16) & 0xFF);
-   *cur_byte++ = ((strHostIfSetMulti->cnt >> 24) & 0xFF);
+   *cur_byte++ = (hif_set_mc->cnt & 0xFF);
+   *cur_byte++ = ((hif_set_mc->cnt >> 8) & 0xFF);
+   *cur_byte++ = ((hif_set_mc->cnt >> 16) & 0xFF);
+   *cur_byte++ = ((hif_set_mc->cnt >> 24) & 0xFF);
 
-   if ((strHostIfSetMulti->cnt) > 0)
+   if ((hif_set_mc->cnt) > 0)
memcpy(cur_byte, wilc_multicast_mac_addr_list,
-  ((strHostIfSetMulti->cnt) * ETH_ALEN));
+  ((hif_set_mc->cnt) * ETH_ALEN));
 
result = wilc_send_config_pkt(vif, SET_CFG, , 1,
  wilc_get_vif_idx(vif));
-- 
2.7.4

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


[PATCH 01/14] staging: wilc1000: rename s8PowerMode & strPowerMgmtParam to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issues found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 5e01f6e..3dc3d2e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2383,20 +2383,20 @@ static void ListenTimerCB(struct timer_list *t)
 }
 
 static void Handle_PowerManagement(struct wilc_vif *vif,
-  struct power_mgmt_param *strPowerMgmtParam)
+  struct power_mgmt_param *pm_param)
 {
s32 result = 0;
struct wid wid;
-   s8 s8PowerMode;
+   s8 power_mode;
 
wid.id = (u16)WID_POWER_MANAGEMENT;
 
-   if (strPowerMgmtParam->enabled)
-   s8PowerMode = MIN_FAST_PS;
+   if (pm_param->enabled)
+   power_mode = MIN_FAST_PS;
else
-   s8PowerMode = NO_POWERSAVE;
+   power_mode = NO_POWERSAVE;
 
-   wid.val = 
+   wid.val = _mode;
wid.size = sizeof(char);
 
result = wilc_send_config_pkt(vif, SET_CFG, , 1,
-- 
2.7.4

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


[PATCH 03/14] staging: wilc1000: rename host_int_get_assoc_res_info() parameters to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issues reported by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index edd35b7..ec98ccd 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1314,9 +1314,9 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
 }
 
 static s32 host_int_get_assoc_res_info(struct wilc_vif *vif,
-  u8 *pu8AssocRespInfo,
-  u32 u32MaxAssocRespInfoLen,
-  u32 *pu32RcvdAssocRespInfoLen);
+  u8 *assoc_resp_info,
+  u32 max_assoc_resp_info_len,
+  u32 *rcvd_assoc_resp_info_len);
 
 static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
struct rcvd_async_info 
*pstrRcvdGnrlAsyncInfo)
@@ -3080,27 +3080,27 @@ int wilc_disconnect(struct wilc_vif *vif, u16 
reason_code)
 }
 
 static s32 host_int_get_assoc_res_info(struct wilc_vif *vif,
-  u8 *pu8AssocRespInfo,
-  u32 u32MaxAssocRespInfoLen,
-  u32 *pu32RcvdAssocRespInfoLen)
+  u8 *assoc_resp_info,
+  u32 max_assoc_resp_info_len,
+  u32 *rcvd_assoc_resp_info_len)
 {
s32 result = 0;
struct wid wid;
 
wid.id = (u16)WID_ASSOC_RES_INFO;
wid.type = WID_STR;
-   wid.val = pu8AssocRespInfo;
-   wid.size = u32MaxAssocRespInfoLen;
+   wid.val = assoc_resp_info;
+   wid.size = max_assoc_resp_info_len;
 
result = wilc_send_config_pkt(vif, GET_CFG, , 1,
  wilc_get_vif_idx(vif));
if (result) {
-   *pu32RcvdAssocRespInfoLen = 0;
+   *rcvd_assoc_resp_info_len = 0;
netdev_err(vif->ndev, "Failed to send association response\n");
return -EINVAL;
}
 
-   *pu32RcvdAssocRespInfoLen = wid.size;
+   *rcvd_assoc_resp_info_len = wid.size;
return result;
 }
 
-- 
2.7.4

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


[PATCH 04/14] staging: wilc1000: rename pstrHostIfRemainOnChan to avoid camelCase

2018-02-19 Thread Ajay Singh
Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index ec98ccd..11e4737 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2221,7 +2221,7 @@ static void Handle_EditStation(struct wilc_vif *vif,
 }
 
 static int Handle_RemainOnChan(struct wilc_vif *vif,
-  struct remain_ch *pstrHostIfRemainOnChan)
+  struct remain_ch *hif_remain_ch)
 {
s32 result = 0;
u8 u8remain_on_chan_flag;
@@ -2229,13 +2229,13 @@ static int Handle_RemainOnChan(struct wilc_vif *vif,
struct host_if_drv *hif_drv = vif->hif_drv;
 
if (!hif_drv->remain_on_ch_pending) {
-   hif_drv->remain_on_ch.arg = pstrHostIfRemainOnChan->arg;
-   hif_drv->remain_on_ch.expired = pstrHostIfRemainOnChan->expired;
-   hif_drv->remain_on_ch.ready = pstrHostIfRemainOnChan->ready;
-   hif_drv->remain_on_ch.ch = pstrHostIfRemainOnChan->ch;
-   hif_drv->remain_on_ch.id = pstrHostIfRemainOnChan->id;
+   hif_drv->remain_on_ch.arg = hif_remain_ch->arg;
+   hif_drv->remain_on_ch.expired = hif_remain_ch->expired;
+   hif_drv->remain_on_ch.ready = hif_remain_ch->ready;
+   hif_drv->remain_on_ch.ch = hif_remain_ch->ch;
+   hif_drv->remain_on_ch.id = hif_remain_ch->id;
} else {
-   pstrHostIfRemainOnChan->ch = hif_drv->remain_on_ch.ch;
+   hif_remain_ch->ch = hif_drv->remain_on_ch.ch;
}
 
if (hif_drv->usr_scan_req.scan_result) {
@@ -2264,7 +2264,7 @@ static int Handle_RemainOnChan(struct wilc_vif *vif,
}
 
wid.val[0] = u8remain_on_chan_flag;
-   wid.val[1] = (s8)pstrHostIfRemainOnChan->ch;
+   wid.val[1] = (s8)hif_remain_ch->ch;
 
result = wilc_send_config_pkt(vif, SET_CFG, , 1,
  wilc_get_vif_idx(vif));
@@ -2277,7 +2277,7 @@ static int Handle_RemainOnChan(struct wilc_vif *vif,
hif_drv->remain_on_ch_timer_vif = vif;
mod_timer(_drv->remain_on_ch_timer,
  jiffies +
- msecs_to_jiffies(pstrHostIfRemainOnChan->duration));
+ msecs_to_jiffies(hif_remain_ch->duration));
 
if (hif_drv->remain_on_ch.ready)
hif_drv->remain_on_ch.ready(hif_drv->remain_on_ch.arg);
@@ -2321,7 +2321,7 @@ static int Handle_RegisterFrame(struct wilc_vif *vif,
 }
 
 static u32 Handle_ListenStateExpired(struct wilc_vif *vif,
-struct remain_ch *pstrHostIfRemainOnChan)
+struct remain_ch *hif_remain_ch)
 {
u8 u8remain_on_chan_flag;
struct wid wid;
@@ -2350,7 +2350,7 @@ static u32 Handle_ListenStateExpired(struct wilc_vif *vif,
 
if (hif_drv->remain_on_ch.expired) {
hif_drv->remain_on_ch.expired(hif_drv->remain_on_ch.arg,
- 
pstrHostIfRemainOnChan->id);
+ hif_remain_ch->id);
}
P2P_LISTEN_STATE = 0;
} else {
-- 
2.7.4

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


Re: [PATCH] staging: imx-media-vdic: fix inconsistent IS_ERR and PTR_ERR

2018-02-19 Thread Philipp Zabel
Hi Gustavo,

On Wed, 2018-02-14 at 14:57 -0600, Gustavo A. R. Silva wrote:
> Hi all,
> 
> I was just wondering about the status of this patch.

It is en route as commit dcd71a9292b1 ("staging: imx-media-vdic: fix
inconsistent IS_ERR and PTR_ERR") in Hans' for-v4.17a branch:
  git://linuxtv.org/hverkuil/media_tree.git for-v4.17a

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


Re: [PATCH 11/12] staging: wilc1000: fix line over 80 chars in wilc_wlan_txq_filter_dup_tcp_ack()

2018-02-19 Thread Claudiu Beznea


On 16.02.2018 17:11, Ajay Singh wrote:
> Fix "line over 80 characters" issue reported by checkpatch.pl.
> Use temporary variable to avoid checkpatch.pl issue.
> 
> Signed-off-by: Ajay Singh 
> ---
>  drivers/staging/wilc1000/wilc_wlan.c | 16 +---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
> b/drivers/staging/wilc1000/wilc_wlan.c
> index 391ecd5..98cd949 100644
> --- a/drivers/staging/wilc1000/wilc_wlan.c
> +++ b/drivers/staging/wilc1000/wilc_wlan.c
> @@ -262,10 +262,20 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct 
> net_device *dev)
>  
>   spin_lock_irqsave(>txq_spinlock, wilc->txq_spinlock_flags);
>   for (i = pending_base; i < (pending_base + pending_acks); i++) {
> - if (i >= MAX_PENDING_ACKS ||
> - pending_acks_info[i].session_index >= 2 * MAX_TCP_SESSION)
> + u32 session_index;
> + u32 bigger_ack_num;
> +
> + if (i >= MAX_PENDING_ACKS)
i >= MAX_PENDINGS_ACKS could be inserted in conditional part of for:
for (i = pending_base; i < (pending_base + pending_acks) &&
 i < MAX_PENDINGS_ACKS; i++)

or:
int maxcnt = (pending_base + pending_acks > MAX_PENDINGS_ACKS) ? pending_base +
pending_ack : MAX_PENDINGS_ACKS;
for (i = pending_base; i < maxcnt; i++) {
// ...
}

> + break;
> +
> + session_index = pending_acks_info[i].session_index;
> +
> + if (session_index >= 2 * MAX_TCP_SESSION)
>   break;
> - if (pending_acks_info[i].ack_num < 
> ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) {
> +
> + bigger_ack_num = ack_session_info[session_index].bigger_ack_num;
> +
> + if (pending_acks_info[i].ack_num < bigger_ack_num) {
>   struct txq_entry_t *tqe;
>  
>   tqe = pending_acks_info[i].txqe;
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 02/12] staging: wilc1000: fix too many leading tabs warning in sdio_clear_int_ext()

2018-02-19 Thread Claudiu Beznea
Hi Ajay,

On 16.02.2018 17:11, Ajay Singh wrote:
> Refactor sdio_clear_int_ext() function to remove "Too many leading tabs"
> warning reported by checkpatch.pl script.
> 
> Signed-off-by: Ajay Singh 
> ---
>  drivers/staging/wilc1000/wilc_sdio.c | 134 
> +--
>  1 file changed, 65 insertions(+), 69 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/wilc_sdio.c 
> b/drivers/staging/wilc1000/wilc_sdio.c
> index 6ce9c94..27ec90e 100644
> --- a/drivers/staging/wilc1000/wilc_sdio.c
> +++ b/drivers/staging/wilc1000/wilc_sdio.c
> @@ -871,6 +871,7 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val)
>  {
>   struct sdio_func *func = dev_to_sdio_func(wilc->dev);
>   int ret;
> + int vmm_ctl;
>  
>   if (g_sdio.has_thrpt_enh3) {
>   u32 reg;
> @@ -909,84 +910,79 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 
> val)
>   goto _fail_;
>   }
>   }
> - } else {
> - if (g_sdio.irq_gpio) {
> - /* see below. has_thrpt_enh2 uses register 0xf8 to 
> clear interrupts. */
> - /* Cannot clear multiple interrupts. Must clear each 
> interrupt individually */
> - u32 flags;
> -
> - flags = val & (BIT(MAX_NUM_INT) - 1);
> - if (flags) {
> - int i;
> -
> - ret = 1;
> - for (i = 0; i < g_sdio.nint; i++) {
> - if (flags & 1) {
> - struct sdio_cmd52 cmd;
> -
> - cmd.read_write = 1;
> - cmd.function = 0;
> - cmd.raw = 0;
> - cmd.address = 0xf8;
> - cmd.data = BIT(i);
> -
> - ret = wilc_sdio_cmd52(wilc, 
> );
> - if (ret) {
> - dev_err(>dev,
> - "Failed cmd52, 
> set 0xf8 data (%d) ...\n",
> - __LINE__);
> - goto _fail_;
> - }
> + return 1;
> + }> +if (g_sdio.irq_gpio) {

Since you re-factor this, as I suggested in patch:
"[PATCH 6/6] staging: wilc1000: fix line over 80 chars in
wilc_spi_clear_int_ext()" form your previous series:
"fix line over 80 char & coding style in wilc_spi.c",
for code starting here:

> + /* see below. has_thrpt_enh2 uses register 0xf8 to clear 
> interrupts. */
> + /* Cannot clear multiple interrupts. Must clear each interrupt 
> individually */
> + u32 flags;
> +
> + flags = val & (BIT(MAX_NUM_INT) - 1);
> + if (flags) {
> + int i;
> +
> + ret = 1;
> + for (i = 0; i < g_sdio.nint; i++) {
> + if (flags & 1) {
> + struct sdio_cmd52 cmd;
> +
> + cmd.read_write = 1;
> + cmd.function = 0;
> + cmd.raw = 0;
> + cmd.address = 0xf8;
> + cmd.data = BIT(i);
> +
> + ret = wilc_sdio_cmd52(wilc, );
> + if (ret) {
> + dev_err(>dev,
> + "Failed cmd52, set 0xf8 
> data (%d) ...\n",
> + __LINE__);
> + goto _fail_;
>   }
> - if (!ret)
> - break;
> - flags >>= 1;
>   }
>   if (!ret)
> - goto _fail_;
> - for (i = g_sdio.nint; i < MAX_NUM_INT; i++) {
> - if (flags & 1)
> - dev_err(>dev,
> - "Unexpected interrupt 
> cleared %d...\n",
> - i);
> - flags >>= 1;
> - }
> + break;
> + flags >>= 1;
>   }
and 

Re: [PATCH] staging: iio/meter: add name to function definition arguments

2018-02-19 Thread Rodrigo Siqueira
Hi Jonathan,

> On Fri, 16 Feb 2018 11:16:58 -0200
> Rodrigo Siqueira  wrote:
> 
> > Hi Daniel
> > 
> > > Hi Rodrigo,
> > > 
> > > I think this is a nice finding. One comment inline:
> > > 
> > > On Vi, 2018-02-16 at 10:50 -0200, rodrigosiqueira wrote:  
> > > > This patch fixes the checkpatch.pl warning:
> > > > 
> > > > drivers/staging/iio/meter/ade7854.h:157: WARNING: function definition
> > > > argument 'struct device *' should also have an identifier name...
> > > > 
> > > > +   int (*read_reg_32)(struct device *dev, u16 reg_address, u32 
> > > > *val);
> > > > +   int (*write_reg_8)(struct device *dev, u16 reg_address, u8 
> > > > value);  
> > > 
> > > 
> > > Any particular reason for using val vs value? I get that one is a pointer
> > > and another a plain type, but I think the name should be the same.  
> > 
> > Before I selected the name, I figure out that read_reg_* and write_reg_*
> > was assigned inside the iio/meter/ade7754-(i2c|spi).c files by function
> > like ade7754_*_read_reg_* and ade7754_*_write_reg_* .
> > 
> > I considered to use 'value' name for both functions parameters, however,
> > I noticed that function ade7754_*_write_reg_* adopted the name 'value'
> > for the last argument and ade7754_*_read_reg_* named the last argument
> > as 'val'. So, for consistency sake between the header file and the c
> > code, I decided to use the same parameter name patterns.
> > 
> Hohum. It isn't even that consistent ;)
> 
> ade7754_write_reg_8 uses val and ade7754_write_reg_16 uses value.
> 
> I would suggest another patch to make them all val.

Thanks for the review. I will send another patch as you recommended.

Rodrigo Siqueira
 
> Thanks,
> 
> Jonathan
> > 
> > > thanks,
> > > Daniel.
> > >  
> > 
> > Thanks 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[no subject]

2018-02-19 Thread Alfred Chow




Good Day,

This is the second time i am sending you this mail.

I am Mr. Alfred Cheuk Yu Chow, the Director for Credit & Marketing Chong
Hing Bank, Hong Kong, need your alliance in a deal that will be of  
mutual benefit.


Email me back for more details.

Regards.





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


Re: [PATCH 1/4] Staging: ks7010: sdio: Fix multiple use of arguments in RX/TX queue macros.

2018-02-19 Thread Dan Carpenter
On Fri, Feb 16, 2018 at 06:20:50PM -0800, Quytelda Kahja wrote:
> Use GCC extensions to prevent macro arguments from accidentally being 
> evaluated
> multiple times when the macro is called.
> 

Don't over engineer code.  These bugs are never going to occur in real
life because of how the macros are used.

It should be pretty easy to make these into functions anyway...  Which
is a much simpler, better solution.

regards,
dan carpenter

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


Re: [PATCH] Staging: gdm724x: LTE: Fix trailing open parenthesis code style issue.

2018-02-19 Thread Dan Carpenter
On Fri, Feb 16, 2018 at 01:40:08PM -0800, Quytelda Kahja wrote:
> @@ -728,17 +731,21 @@ static void gdm_lte_pdn_table(struct net_device *dev, 
> char *buf, int len)
>  {
>   struct nic *nic = netdev_priv(dev);
>   struct hci_pdn_table_ind *pdn_table = (struct hci_pdn_table_ind *)buf;
> + struct gdm_endian *dft_endian;
> + struct gdm_endian *nic_endian;
>  
>   if (pdn_table->activate) {
>   nic->pdn_table.activate = pdn_table->activate;
> - nic->pdn_table.dft_eps_id = gdm_dev32_to_cpu(
> - nic->phy_dev->get_endian(
> - nic->phy_dev->priv_dev),
> - pdn_table->dft_eps_id);
> - nic->pdn_table.nic_type = gdm_dev32_to_cpu(
> - nic->phy_dev->get_endian(
> - nic->phy_dev->priv_dev),
> - pdn_table->nic_type);
> +
> + dft_endian = nic->phy_dev->get_endian(nic->phy_dev->priv_dev);
> + nic_endian = nic->phy_dev->get_endian(nic->phy_dev->priv_dev);


We don't need both dft_endian abd nic_endian since they're the same
endianness.  Otherwise, this is a nice cleanup.

> +
> + nic->pdn_table.dft_eps_id =
> + gdm_dev32_to_cpu(dft_endian,
> +  pdn_table->dft_eps_id);
> + nic->pdn_table.nic_type =
> + gdm_dev32_to_cpu(nic_endian,
> +  pdn_table->nic_type);
>  
>   netdev_info(dev, "pdn activated, nic_type=0x%x\n",
>   nic->pdn_table.nic_type);

regards,
dan carpenter

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


Re: [PATCH 04/12] staging: wilc1000: fix open parenthesis alignment mismatch in wilc_parse_network_info()

2018-02-19 Thread Dan Carpenter
On Fri, Feb 16, 2018 at 08:41:41PM +0530, Ajay Singh wrote:
> Fix "Alignment should match open parenthesis" issue found by
> checkpatch.pl script.
> 
> Signed-off-by: Ajay Singh 
> ---
>  drivers/staging/wilc1000/coreconfigurator.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
> b/drivers/staging/wilc1000/coreconfigurator.c
> index e98fc8e..2e2187b 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -320,8 +320,8 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
>   get_ssid(msa, network_info->ssid, _info->ssid_len);
>   get_BSSID(msa, network_info->bssid);
>  
> - network_info->ch = get_current_channel_802_11n(msa,
> - rx_len + FCS_LEN);
> + network_info->ch = get_current_channel_802_11n(msa, rx_len
> ++ FCS_LEN);

Greg has already applied this which is fine, but I probably would have
left this as is.  Normally a rule is that the '+' character should be on
the first line, and also it's slightly easier to read when the argument
is one one line instead of split across two.

But it doesn't matter much either way.  We'll probably end up
re-writing great swaths of this code.

regards,
dan carpenter

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


Re: [PATCH 5/6] staging: wilc1000: fix line over 80 characters in wilc_spi_read_int()

2018-02-19 Thread Ajay Singh
On Fri, 16 Feb 2018 20:15:53 +0200
Claudiu Beznea  wrote:

> On 14.02.2018 13:10, Ajay Singh wrote:
> > Refactor wilc_spi_read_int() to fix the line over 80 char issues reported
> > by checkpatch.pl script.
> > 
> > Signed-off-by: Ajay Singh 
> > ---
> >  drivers/staging/wilc1000/wilc_spi.c | 57 
> > +++--
> >  1 file changed, 29 insertions(+), 28 deletions(-)
> > 
> > diff --git a/drivers/staging/wilc1000/wilc_spi.c 
> > b/drivers/staging/wilc1000/wilc_spi.c
> > index fddc0db..7c58beb8 100644
> > --- a/drivers/staging/wilc1000/wilc_spi.c
> > +++ b/drivers/staging/wilc1000/wilc_spi.c
> > @@ -939,45 +939,46 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 
> > *int_status)
> > int happened, j;
> > u32 unknown_mask;
> > u32 irq_flags;
> > +   int k = IRG_FLAGS_OFFSET + 5;
> >  
> > if (g_spi.has_thrpt_enh) {
> > ret = spi_internal_read(wilc, 0xe840 - WILC_SPI_REG_BASE,
> > int_status);
> > -   } else {
> > -   ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE,
> > -   _cnt);
> > -   if (!ret) {
> > -   dev_err(>dev,
> > -   "Failed read WILC_VMM_TO_HOST_SIZE ...\n");
> > -   goto _fail_;
> > -   }
> > -   tmp = (byte_cnt >> 2) & IRQ_DMA_WD_CNT_MASK;
> > +   return ret;
> > +   }
> > +   ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE, _cnt);
> > +   if (!ret) {
> > +   dev_err(>dev,
> > +   "Failed read WILC_VMM_TO_HOST_SIZE ...\n");
> > +   goto _fail_;
> > +   }
> > +   tmp = (byte_cnt >> 2) & IRQ_DMA_WD_CNT_MASK;
> >  
> > -   j = 0;
> > -   do {
> > -   happened = 0;
> > +   j = 0;
> > +   do {
> > +   happened = 0;  
> You could remove this happen
> >  

Yes, we don't need "happened" variable,it can be removed. As the patch
was only to remove the 80 char checkpatch.pl warning. Will remove the
use of this variable in separate patch.

> > -   wilc_spi_read_reg(wilc, 0x1a90, _flags);
> > -   tmp |= ((irq_flags >> 27) << IRG_FLAGS_OFFSET);
> > +   wilc_spi_read_reg(wilc, 0x1a90, _flags);
> > +   tmp |= ((irq_flags >> 27) << IRG_FLAGS_OFFSET);
> >  
> > -   if (g_spi.nint > 5) {
> > -   wilc_spi_read_reg(wilc, 0x1a94,
> > - _flags);
> > -   tmp |= (((irq_flags >> 0) & 0x7) << 
> > (IRG_FLAGS_OFFSET + 5));
> > -   }
> > +   if (g_spi.nint > 5) {
> > +   wilc_spi_read_reg(wilc, 0x1a94, _flags);
> > +   tmp |= (((irq_flags >> 0) & 0x7) << k);
> > +   }
> >  
> > -   unknown_mask = ~((1ul << g_spi.nint) - 1);
> > +   unknown_mask = ~((1ul << g_spi.nint) - 1);  
> You could use GENMASK(g_spi.nint - 1, 0) instead of ~((1ul << g_spi.nint) - 1)
> >  

Will do the modification to make use of GENMASK in future patch.

> > -   if ((tmp >> IRG_FLAGS_OFFSET) & unknown_mask) {
> > -   dev_err(>dev, "Unexpected interrupt (2): 
> > j=%d, tmp=%x, mask=%x\n", j, tmp, unknown_mask);
> > -   happened = 1;
> > -   }
> > +   if ((tmp >> IRG_FLAGS_OFFSET) & unknown_mask) {
> > +   dev_err(>dev,
> > +   "Unexpected interrupt(2):j=%d,tmp=%x,mask=%x\n",
> > +   j, tmp, unknown_mask);
> > +   happened = 1;  
> And here just break;
> > +   }
> >  
> > -   j++;
> > -   } while (happened);  
> And here use while (true);
> > +   j++;
> > +   } while (happened);
> >  
> > -   *int_status = tmp;
> > -   }
> > +   *int_status = tmp;
> >  
> >  _fail_:
> > return ret;
> >   



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