[PATCH 0/2 linux-next] coding style clean up for lustre/osc/osc_dev.c

2014-06-12 Thread Honggang Li
Patches clean up coding style issue of the file:
linux-next/drivers/staging/lustre/lustre/osc/osc_dev.c

Honggang Li (2):
  lustre/osc/osc_dev.c remove space between sizeof and open parenthesis
  lustre/osc/osc_dev.c add a blank line after declarations

 drivers/staging/lustre/lustre/osc/osc_dev.c | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

-- 
1.8.3.1

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


[PATCH 2/2] lustre/osc/osc_dev.c add a blank line after declarations

2014-06-12 Thread Honggang Li
Signed-off-by: Honggang Li 
---
 drivers/staging/lustre/lustre/osc/osc_dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/lustre/lustre/osc/osc_dev.c 
b/drivers/staging/lustre/lustre/osc/osc_dev.c
index 5249e66..048a5a5 100644
--- a/drivers/staging/lustre/lustre/osc/osc_dev.c
+++ b/drivers/staging/lustre/lustre/osc/osc_dev.c
@@ -132,6 +132,7 @@ static void osc_key_fini(const struct lu_context *ctx,
 struct lu_context_key *key, void *data)
 {
struct osc_thread_info *info = data;
+
OBD_SLAB_FREE_PTR(info, osc_thread_kmem);
 }
 
@@ -156,6 +157,7 @@ static void osc_session_fini(const struct lu_context *ctx,
 struct lu_context_key *key, void *data)
 {
struct osc_session *info = data;
+
OBD_SLAB_FREE_PTR(info, osc_session_kmem);
 }
 
-- 
1.8.3.1

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


[PATCH 1/2] lustre/osc/osc_dev.c remove space between sizeof and open parenthesis

2014-06-12 Thread Honggang Li
Signed-off-by: Honggang Li 
---
 drivers/staging/lustre/lustre/osc/osc_dev.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_dev.c 
b/drivers/staging/lustre/lustre/osc/osc_dev.c
index a7c1ec0..5249e66 100644
--- a/drivers/staging/lustre/lustre/osc/osc_dev.c
+++ b/drivers/staging/lustre/lustre/osc/osc_dev.c
@@ -61,32 +61,32 @@ struct lu_kmem_descr osc_caches[] = {
{
.ckd_cache = &osc_lock_kmem,
.ckd_name  = "osc_lock_kmem",
-   .ckd_size  = sizeof (struct osc_lock)
+   .ckd_size  = sizeof(struct osc_lock)
},
{
.ckd_cache = &osc_object_kmem,
.ckd_name  = "osc_object_kmem",
-   .ckd_size  = sizeof (struct osc_object)
+   .ckd_size  = sizeof(struct osc_object)
},
{
.ckd_cache = &osc_thread_kmem,
.ckd_name  = "osc_thread_kmem",
-   .ckd_size  = sizeof (struct osc_thread_info)
+   .ckd_size  = sizeof(struct osc_thread_info)
},
{
.ckd_cache = &osc_session_kmem,
.ckd_name  = "osc_session_kmem",
-   .ckd_size  = sizeof (struct osc_session)
+   .ckd_size  = sizeof(struct osc_session)
},
{
.ckd_cache = &osc_req_kmem,
.ckd_name  = "osc_req_kmem",
-   .ckd_size  = sizeof (struct osc_req)
+   .ckd_size  = sizeof(struct osc_req)
},
{
.ckd_cache = &osc_extent_kmem,
.ckd_name  = "osc_extent_kmem",
-   .ckd_size  = sizeof (struct osc_extent)
+   .ckd_size  = sizeof(struct osc_extent)
},
{
.ckd_cache = &osc_quota_kmem,
-- 
1.8.3.1

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


[PATCHv2] staging: keucr: usb.c: add blank lines after declarations

2014-06-12 Thread mathias . engan
From: Mathias Engan 

Add blank line after declarations in eucr_suspend and eucr_resume
as reported by checkpatch.

Signed-off-by: Mathias Engan 
---
 drivers/staging/keucr/usb.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/keucr/usb.c b/drivers/staging/keucr/usb.c
index 12ebde7..dbbd63f 100644
--- a/drivers/staging/keucr/usb.c
+++ b/drivers/staging/keucr/usb.c
@@ -37,6 +37,7 @@ MODULE_DEVICE_TABLE(usb, eucr_usb_ids);
 static int eucr_suspend(struct usb_interface *iface, pm_message_t message)
 {
struct us_data *us = usb_get_intfdata(iface);
+
pr_info("--- eucr_suspend ---\n");
/* Wait until no command is running */
mutex_lock(&us->dev_mutex);
@@ -53,6 +54,7 @@ static int eucr_resume(struct usb_interface *iface)
u8tmp = 0;
 
struct us_data *us = usb_get_intfdata(iface);
+
pr_info("--- eucr_resume---\n");
mutex_lock(&us->dev_mutex);
 
-- 
1.7.9.5

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


Re: [PATCH 06/22] staging: rtl8188eu: Instead of intf_hdl pass adapter in read & write functions

2014-06-12 Thread Dan Carpenter
On Wed, Jun 11, 2014 at 10:51:25PM +0530, navin patidar wrote:
> diff --git a/drivers/staging/rtl8188eu/core/rtw_io.c 
> b/drivers/staging/rtl8188eu/core/rtw_io.c
> index a0a31e6..85306bf 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_io.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_io.c
> @@ -57,10 +57,10 @@ u8 _rtw_read8(struct adapter *adapter, u32 addr)
>   u8 r_val;
>   struct io_priv *pio_priv = &adapter->iopriv;
>   struct  intf_hdl *pintfhdl = &(pio_priv->intf);
> - u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
> + u8 (*_read8)(struct adapter *pintfhdl, u32 addr);
 
Could you send a follow on patch to change pintfhdl to adapter in all
the declarations?

regards,
dan carpenter

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


[PATCH] staging: iio: fix coding style

2014-06-12 Thread Jimmy P
This patch fixes coding style errors reported by checkpatch.pl for
lines that was over 80 chars long. The macro value shoud be put in () as
well.

Signed-off-by: Jimmy P 
---
 drivers/staging/iio/frequency/ad5930.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/frequency/ad5930.c 
b/drivers/staging/iio/frequency/ad5930.c
index a4aeee6..95a3550 100644
--- a/drivers/staging/iio/frequency/ad5930.c
+++ b/drivers/staging/iio/frequency/ad5930.c
@@ -21,7 +21,7 @@
 
 #define DRV_NAME "ad5930"
 
-#define value_mask (u16)0xf000
+#define value_mask ((u16)0xf000)
 #define addr_shift 12
 
 /* Register format: 4 bits addr + 12 bits value */
@@ -52,12 +52,15 @@ static ssize_t ad5930_set_parameter(struct device *dev,
 
config->control = (config->control & ~value_mask);
config->incnum = (config->control & ~value_mask) | (1 << addr_shift);
-   config->frqdelt[0] = (config->control & ~value_mask) | (2 << 
addr_shift);
+   config->frqdelt[0] = (config->control & ~value_mask) |
+   (2 << addr_shift);
config->frqdelt[1] = (config->control & ~value_mask) | 3 << addr_shift;
config->incitvl = (config->control & ~value_mask) | 4 << addr_shift;
config->buritvl = (config->control & ~value_mask) | 8 << addr_shift;
-   config->strtfrq[0] = (config->control & ~value_mask) | 0xc << 
addr_shift;
-   config->strtfrq[1] = (config->control & ~value_mask) | 0xd << 
addr_shift;
+   config->strtfrq[0] = (config->control & ~value_mask) |
+   0xc << addr_shift;
+   config->strtfrq[1] = (config->control & ~value_mask) |
+   0xd << addr_shift;
 
xfer.len = len;
xfer.tx_buf = config;
-- 
2.0.0

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


Re: [PATCH 06/22] staging: rtl8188eu: Instead of intf_hdl pass adapter in read & write functions

2014-06-12 Thread navin patidar
On Thu, Jun 12, 2014 at 1:13 PM, Dan Carpenter  wrote:
> On Wed, Jun 11, 2014 at 10:51:25PM +0530, navin patidar wrote:
>> diff --git a/drivers/staging/rtl8188eu/core/rtw_io.c 
>> b/drivers/staging/rtl8188eu/core/rtw_io.c
>> index a0a31e6..85306bf 100644
>> --- a/drivers/staging/rtl8188eu/core/rtw_io.c
>> +++ b/drivers/staging/rtl8188eu/core/rtw_io.c
>> @@ -57,10 +57,10 @@ u8 _rtw_read8(struct adapter *adapter, u32 addr)
>>   u8 r_val;
>>   struct io_priv *pio_priv = &adapter->iopriv;
>>   struct  intf_hdl *pintfhdl = &(pio_priv->intf);
>> - u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
>> + u8 (*_read8)(struct adapter *pintfhdl, u32 addr);
>  
> Could you send a follow on patch to change pintfhdl to adapter in all
> the declarations?
>

dan, these declarations are removed by other patches of this patch set.

do i still need to send v2 of this patch?

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


[PATCH] drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c: fix coding style

2014-06-12 Thread Wahib Faizi
Fix coding style issues detected by checkpatch.pl:
1. do not use assignment in if condition
2. line over 80 characters

Signed-off-by: Wahib Faizi 
---
 .../usbip/userspace/libsrc/usbip_host_driver.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c 
b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
index 92caef7..bef08d5 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
@@ -47,7 +47,8 @@ static int32_t read_attr_usbip_status(struct usbip_usb_device 
*udev)
snprintf(status_attr_path, SYSFS_PATH_MAX, "%s/usbip_status",
 udev->path);
 
-   if ((fd = open(status_attr_path, O_RDONLY)) < 0) {
+   fd = open(status_attr_path, O_RDONLY);
+   if (fd < 0) {
err("error opening attribute %s", status_attr_path);
return -1;
}
@@ -87,8 +88,8 @@ struct usbip_exported_device *usbip_exported_device_new(const 
char *sdevpath)
goto err;
 
/* reallocate buffer to include usb interface data */
-   size = sizeof(struct usbip_exported_device) + edev->udev.bNumInterfaces 
*
-   sizeof(struct usbip_usb_interface);
+   size = sizeof(struct usbip_exported_device) +
+   edev->udev.bNumInterfaces * sizeof(struct usbip_usb_interface);
 
edev_old = edev;
edev = realloc(edev, size);
-- 
1.7.9.5

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


Eudyptula Challenge (Task 10)

2014-06-12 Thread Wahib Faizi

Greetings Linux Kernel Developers!

This is Task 10 of the Eudyptula Challenge.

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


[PATCH] staging: lustre: obdclass: linux-sysctl.c: fix pointer coding style issue

2014-06-12 Thread Andrey Skvortsov

Signed-off-by: Andrey Skvortsov 
---
 drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
index c1ef0c9..b87ca10 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
@@ -196,7 +196,7 @@ int LL_PROC_PROTO(proc_max_dirty_pages_in_mb)
}
if (write) {
rc = lprocfs_write_frac_helper(buffer, *lenp,
-  (unsigned int*)table->data,
+  (unsigned int *)table->data,
   1 << (20 - PAGE_CACHE_SHIFT));
/* Don't allow them to let dirty pages exceed 90% of system
 * memory and set a hard minimum of 4MB. */
@@ -214,7 +214,7 @@ int LL_PROC_PROTO(proc_max_dirty_pages_in_mb)
int len;
 
len = lprocfs_read_frac_helper(buf, sizeof(buf),
-  *(unsigned int*)table->data,
+  *(unsigned int *)table->data,
   1 << (20 - PAGE_CACHE_SHIFT));
if (len > *lenp)
len = *lenp;
@@ -238,15 +238,14 @@ int LL_PROC_PROTO(proc_alloc_fail_rate)
}
if (write) {
rc = lprocfs_write_frac_helper(buffer, *lenp,
-  (unsigned int*)table->data,
+  (unsigned int *)table->data,
   OBD_ALLOC_FAIL_MULT);
} else {
char buf[21];
int  len;
 
len = lprocfs_read_frac_helper(buf, 21,
-  *(unsigned int*)table->data,
+  *(unsigned int *)table->data,
   OBD_ALLOC_FAIL_MULT);
if (len > *lenp)
len = *lenp;
--
1.7.10.4

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


[PATCH v3 6/8] Staging: bcm: Outsourced selecting of alternate setting

2014-06-12 Thread Matthias Beyer
This patch outsources a chunk of code which is for selecting an
alternate setting for highspeed modem into a new function.

Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/InterfaceInit.c | 207 +++-
 1 file changed, 112 insertions(+), 95 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceInit.c 
b/drivers/staging/bcm/InterfaceInit.c
index bda33c8..9f9045d 100644
--- a/drivers/staging/bcm/InterfaceInit.c
+++ b/drivers/staging/bcm/InterfaceInit.c
@@ -374,6 +374,113 @@ static int device_run(struct bcm_interface_adapter 
*psIntfAdapter)
return 0;
 }
 
+static int select_alternate_setting_for_highspeed_modem(
+   struct bcm_interface_adapter *psIntfAdapter,
+   struct usb_endpoint_descriptor **endpoint,
+   const struct usb_host_interface *iface_desc,
+   int *usedIntOutForBulkTransfer)
+{
+   int retval = 0;
+   struct bcm_mini_adapter *psAd = psIntfAdapter->psAdapter;
+
+   /* selecting alternate setting one as a default setting
+* for High Speed  modem. */
+   if (psIntfAdapter->bHighSpeedDevice)
+   retval = usb_set_interface(psIntfAdapter->udev,
+  DEFAULT_SETTING_0,
+  ALTERNATE_SETTING_1);
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY,
+   DBG_LVL_ALL,
+   "BCM16 is applicable on this dongle\n");
+   if (retval || !psIntfAdapter->bHighSpeedDevice) {
+   *usedIntOutForBulkTransfer = EP2;
+   *endpoint = &iface_desc->endpoint[EP2].desc;
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
+   DRV_ENTRY, DBG_LVL_ALL,
+   "Interface altsetting failed or modem is 
configured to Full Speed, hence will work on default setting 0\n");
+   /*
+* If Modem is high speed device EP2 should be
+* INT OUT End point
+*
+* If Mode is FS then EP2 should be bulk end
+* point
+*/
+   if ((psIntfAdapter->bHighSpeedDevice &&
+   !usb_endpoint_is_int_out(*endpoint)) ||
+   (!psIntfAdapter->bHighSpeedDevice &&
+!usb_endpoint_is_bulk_out(*endpoint))) {
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
+   DRV_ENTRY, DBG_LVL_ALL,
+   "Configuring the EEPROM\n");
+   /* change the EP2, EP4 to INT OUT end point */
+   ConfigureEndPointTypesThroughEEPROM(
+   psAd);
+
+   /*
+* It resets the device and if any thing
+* gets changed in USB descriptor it
+* will show fail and re-enumerate the
+* device
+*/
+   retval = usb_reset_device(
+   psIntfAdapter->udev);
+   if (retval) {
+   BCM_DEBUG_PRINT(psAd,
+   DBG_TYPE_INITEXIT,
+   DRV_ENTRY,
+   DBG_LVL_ALL,
+   "reset failed.  Re-enumerating 
the device.\n");
+   return retval;
+   }
+
+   }
+   if (!psIntfAdapter->bHighSpeedDevice &&
+   usb_endpoint_is_bulk_out(*endpoint)) {
+   /* Once BULK is selected in FS mode. Revert it back to 
INT. Else USB_IF will fail. */
+   UINT _uiData = ntohl(EP2_CFG_INT);
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
+   DRV_ENTRY, DBG_LVL_ALL,
+   "Reverting Bulk to INT as it is in Full 
Speed mode.\n");
+   BeceemEEPROMBulkWrite(psAd,
+   (PUCHAR) & _uiData,
+   0x136, 4, TRUE);
+   }
+   } else {
+   *usedIntOutForBulkTransfer = EP4;
+   *endpoint = &iface_desc->endpoint[EP4].desc;
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
+   DRV_ENTRY, DBG_LVL_ALL,
+   "Choosing AltSetting as a default setting.\n");
+   if (!usb_endpoint_is_int_out(*endpoint)) {
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
+   DRV_ENTRY, DBG_LVL_ALL,
+   "Dongle does not have BCM16 Fix.\n");
+   /* change the E

[PATCH v3 3/8] Staging: bcm: Replaced member accessing with variable in device_run()

2014-06-12 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/InterfaceInit.c | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceInit.c 
b/drivers/staging/bcm/InterfaceInit.c
index dd7b4a5..e1a3e6d 100644
--- a/drivers/staging/bcm/InterfaceInit.c
+++ b/drivers/staging/bcm/InterfaceInit.c
@@ -340,16 +340,16 @@ static int device_run(struct bcm_interface_adapter 
*psIntfAdapter)
 {
int value = 0;
UINT status = STATUS_SUCCESS;
+   struct bcm_mini_adapter *psAd = psIntfAdapter->psAdapter;
 
-   status = InitCardAndDownloadFirmware(psIntfAdapter->psAdapter);
+   status = InitCardAndDownloadFirmware(psAd);
if (status != STATUS_SUCCESS) {
pr_err(DRV_NAME "InitCardAndDownloadFirmware failed.\n");
return status;
}
-   if (psIntfAdapter->psAdapter->fw_download_done) {
+   if (psAd->fw_download_done) {
if (StartInterruptUrb(psIntfAdapter)) {
-   BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,
-   DBG_TYPE_INITEXIT, DRV_ENTRY,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY,
DBG_LVL_ALL,
"Cannot send interrupt in URB\n");
}
@@ -358,17 +358,15 @@ static int device_run(struct bcm_interface_adapter 
*psIntfAdapter)
 * now register the cntrl interface.  after downloading the f/w
 * waiting for 5 sec to get the mailbox interrupt.
 */
-   psIntfAdapter->psAdapter->waiting_to_fw_download_done = false;
-   value = wait_event_timeout(
-   
psIntfAdapter->psAdapter->ioctl_fw_dnld_wait_queue,
-   
psIntfAdapter->psAdapter->waiting_to_fw_download_done,
-   5 * HZ);
+   psAd->waiting_to_fw_download_done = false;
+   value = wait_event_timeout(psAd->ioctl_fw_dnld_wait_queue,
+  psAd->waiting_to_fw_download_done,
+  5 * HZ);
 
if (value == 0)
pr_err(DRV_NAME ": Timeout waiting for mailbox 
interrupt.\n");
 
-   if (register_control_device_interface(
-   psIntfAdapter->psAdapter) < 0) {
+   if (register_control_device_interface(psAd) < 0) {
pr_err(DRV_NAME ": Register Control Device failed.\n");
return -EIO;
}
-- 
2.0.0

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


[PATCH v3 7/8] Staging: bcm: Shortened some lines in select_alternate_setting_for_highspeed_modem()

2014-06-12 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/InterfaceInit.c | 47 ++---
 1 file changed, 18 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceInit.c 
b/drivers/staging/bcm/InterfaceInit.c
index 9f9045d..276825f 100644
--- a/drivers/staging/bcm/InterfaceInit.c
+++ b/drivers/staging/bcm/InterfaceInit.c
@@ -389,14 +389,12 @@ static int select_alternate_setting_for_highspeed_modem(
retval = usb_set_interface(psIntfAdapter->udev,
   DEFAULT_SETTING_0,
   ALTERNATE_SETTING_1);
-   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY,
-   DBG_LVL_ALL,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
"BCM16 is applicable on this dongle\n");
if (retval || !psIntfAdapter->bHighSpeedDevice) {
*usedIntOutForBulkTransfer = EP2;
*endpoint = &iface_desc->endpoint[EP2].desc;
-   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
-   DRV_ENTRY, DBG_LVL_ALL,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
"Interface altsetting failed or modem is 
configured to Full Speed, hence will work on default setting 0\n");
/*
 * If Modem is high speed device EP2 should be
@@ -409,8 +407,8 @@ static int select_alternate_setting_for_highspeed_modem(
!usb_endpoint_is_int_out(*endpoint)) ||
(!psIntfAdapter->bHighSpeedDevice &&
 !usb_endpoint_is_bulk_out(*endpoint))) {
-   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
-   DRV_ENTRY, DBG_LVL_ALL,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY,
+   DBG_LVL_ALL,
"Configuring the EEPROM\n");
/* change the EP2, EP4 to INT OUT end point */
ConfigureEndPointTypesThroughEEPROM(
@@ -422,13 +420,10 @@ static int select_alternate_setting_for_highspeed_modem(
 * will show fail and re-enumerate the
 * device
 */
-   retval = usb_reset_device(
-   psIntfAdapter->udev);
+   retval = usb_reset_device(psIntfAdapter->udev);
if (retval) {
-   BCM_DEBUG_PRINT(psAd,
-   DBG_TYPE_INITEXIT,
-   DRV_ENTRY,
-   DBG_LVL_ALL,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
+   DRV_ENTRY, DBG_LVL_ALL,
"reset failed.  Re-enumerating 
the device.\n");
return retval;
}
@@ -438,26 +433,23 @@ static int select_alternate_setting_for_highspeed_modem(
usb_endpoint_is_bulk_out(*endpoint)) {
/* Once BULK is selected in FS mode. Revert it back to 
INT. Else USB_IF will fail. */
UINT _uiData = ntohl(EP2_CFG_INT);
-   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
-   DRV_ENTRY, DBG_LVL_ALL,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY,
+   DBG_LVL_ALL,
"Reverting Bulk to INT as it is in Full 
Speed mode.\n");
-   BeceemEEPROMBulkWrite(psAd,
-   (PUCHAR) & _uiData,
-   0x136, 4, TRUE);
+   BeceemEEPROMBulkWrite(psAd, (PUCHAR) & _uiData, 0x136,
+ 4, TRUE);
}
} else {
*usedIntOutForBulkTransfer = EP4;
*endpoint = &iface_desc->endpoint[EP4].desc;
-   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
-   DRV_ENTRY, DBG_LVL_ALL,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,
"Choosing AltSetting as a default setting.\n");
if (!usb_endpoint_is_int_out(*endpoint)) {
-   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
-   DRV_ENTRY, DBG_LVL_ALL,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY,
+   DBG_LVL_ALL,
"Dongle does not have BCM16 Fix.\n");
 

[PATCH v3 2/8] Staging: bcm: replaced member accessing by variable

2014-06-12 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/InterfaceInit.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceInit.c 
b/drivers/staging/bcm/InterfaceInit.c
index d61a688..dd7b4a5 100644
--- a/drivers/staging/bcm/InterfaceInit.c
+++ b/drivers/staging/bcm/InterfaceInit.c
@@ -28,28 +28,28 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *Adapter);
 static void InterfaceAdapterFree(struct bcm_interface_adapter *psIntfAdapter)
 {
int i = 0;
+   struct bcm_mini_adapter *ps_ad = psIntfAdapter->psAdapter;
 
/* Wake up the wait_queue... */
-   if (psIntfAdapter->psAdapter->LEDInfo.led_thread_running &
+   if (ps_ad->LEDInfo.led_thread_running &
BCM_LED_THREAD_RUNNING_ACTIVELY) {
-   psIntfAdapter->psAdapter->DriverState = DRIVER_HALT;
-   wake_up(&psIntfAdapter->psAdapter->LEDInfo.notify_led_event);
+   ps_ad->DriverState = DRIVER_HALT;
+   wake_up(&ps_ad->LEDInfo.notify_led_event);
}
-   reset_card_proc(psIntfAdapter->psAdapter);
+   reset_card_proc(ps_ad);
 
/*
 * worst case time taken by the RDM/WRM will be 5 sec. will check after
 * every 100 ms to accertain the device is not being accessed. After
 * this No RDM/WRM should be made.
 */
-   while (psIntfAdapter->psAdapter->DeviceAccess) {
-   BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT,
-   DRV_ENTRY, DBG_LVL_ALL,
+   while (ps_ad->DeviceAccess) {
+   BCM_DEBUG_PRINT(ps_ad, DBG_TYPE_INITEXIT, DRV_ENTRY, 
DBG_LVL_ALL,
"Device is being accessed.\n");
msleep(100);
}
/* Free interrupt URB */
-   /* psIntfAdapter->psAdapter->device_removed = TRUE; */
+   /* ps_ad->device_removed = TRUE; */
usb_free_urb(psIntfAdapter->psInterruptUrb);
 
/* Free transmit URBs */
@@ -67,7 +67,7 @@ static void InterfaceAdapterFree(struct bcm_interface_adapter 
*psIntfAdapter)
psIntfAdapter->asUsbRcb[i].urb = NULL;
}
}
-   AdapterFree(psIntfAdapter->psAdapter);
+   AdapterFree(ps_ad);
 }
 
 static void ConfigureEndPointTypesThroughEEPROM(
-- 
2.0.0

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


[PATCH v3 1/8] Staging: bcm: Shortened some lines

2014-06-12 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/InterfaceInit.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceInit.c 
b/drivers/staging/bcm/InterfaceInit.c
index 7c04c73..d61a688 100644
--- a/drivers/staging/bcm/InterfaceInit.c
+++ b/drivers/staging/bcm/InterfaceInit.c
@@ -70,7 +70,8 @@ static void InterfaceAdapterFree(struct bcm_interface_adapter 
*psIntfAdapter)
AdapterFree(psIntfAdapter->psAdapter);
 }
 
-static void ConfigureEndPointTypesThroughEEPROM(struct bcm_mini_adapter 
*Adapter)
+static void ConfigureEndPointTypesThroughEEPROM(
+   struct bcm_mini_adapter *Adapter)
 {
u32 ulReg;
int bytes;
@@ -147,7 +148,8 @@ static void ConfigureEndPointTypesThroughEEPROM(struct 
bcm_mini_adapter *Adapter
BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x1C2, 4, TRUE);
 }
 
-static int usbbcm_device_probe(struct usb_interface *intf, const struct 
usb_device_id *id)
+static int usbbcm_device_probe(struct usb_interface *intf,
+  const struct usb_device_id *id)
 {
struct usb_device *udev = interface_to_usbdev(intf);
int retval;
-- 
2.0.0

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


[PATCH v3 8/8] Staging: bcm: Line length cleanup

2014-06-12 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/InterfaceInit.c | 25 +++--
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceInit.c 
b/drivers/staging/bcm/InterfaceInit.c
index 276825f..bef13a6 100644
--- a/drivers/staging/bcm/InterfaceInit.c
+++ b/drivers/staging/bcm/InterfaceInit.c
@@ -44,8 +44,8 @@ static void InterfaceAdapterFree(struct bcm_interface_adapter 
*psIntfAdapter)
 * this No RDM/WRM should be made.
 */
while (ps_ad->DeviceAccess) {
-   BCM_DEBUG_PRINT(ps_ad, DBG_TYPE_INITEXIT, DRV_ENTRY, 
DBG_LVL_ALL,
-   "Device is being accessed.\n");
+   BCM_DEBUG_PRINT(ps_ad, DBG_TYPE_INITEXIT, DRV_ENTRY,
+   DBG_LVL_ALL, "Device is being accessed.\n");
msleep(100);
}
/* Free interrupt URB */
@@ -130,7 +130,10 @@ static void ConfigureEndPointTypesThroughEEPROM(
ulReg &= 0x0101;
BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x1FC, 4, TRUE);
 
-   /* Update length field if required. Also make the string NULL 
terminated. */
+   /*
+* Update length field if required.
+* Also make the string NULL terminated.
+*/
 
ReadBeceemEEPROM(Adapter, 0xA8, &ulReg);
if ((ulReg&0x00FF)>>16 > 0x30) {
@@ -431,7 +434,11 @@ static int select_alternate_setting_for_highspeed_modem(
}
if (!psIntfAdapter->bHighSpeedDevice &&
usb_endpoint_is_bulk_out(*endpoint)) {
-   /* Once BULK is selected in FS mode. Revert it back to 
INT. Else USB_IF will fail. */
+   /*
+* Once BULK is selected in FS mode.
+* Revert it back to INT.
+* Else USB_IF will fail.
+*/
UINT _uiData = ntohl(EP2_CFG_INT);
BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY,
DBG_LVL_ALL,
@@ -448,7 +455,10 @@ static int select_alternate_setting_for_highspeed_modem(
BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY,
DBG_LVL_ALL,
"Dongle does not have BCM16 Fix.\n");
-   /* change the EP2, EP4 to INT OUT end point and use EP4 
in altsetting */
+   /*
+* change the EP2, EP4 to INT OUT end point and use EP4
+* in altsetting
+*/
ConfigureEndPointTypesThroughEEPROM(psAd);
 
/*
@@ -573,7 +583,10 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *psIntfAdapter)
if (!psIntfAdapter->sBulkOut.bulk_out_endpointAddr &&
(psAd->chip_id == T3B) &&
(value == usedIntOutForBulkTransfer)) {
-   /* use first intout end point as a bulk out end 
point */
+   /*
+* use first intout end point as a bulk out end
+* point
+*/
buffer_size =
le16_to_cpu(endpoint->wMaxPacketSize);
psIntfAdapter->sBulkOut.bulk_out_size =
-- 
2.0.0

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


[PATCH v3 5/8] Staging: bcm: Merged some lines which got shorter by the latest patch

2014-06-12 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/InterfaceInit.c | 43 +++--
 1 file changed, 17 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceInit.c 
b/drivers/staging/bcm/InterfaceInit.c
index 2f540d6..bda33c8 100644
--- a/drivers/staging/bcm/InterfaceInit.c
+++ b/drivers/staging/bcm/InterfaceInit.c
@@ -396,9 +396,8 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *psIntfAdapter)
psAd->interface_rdm = BcmRDM;
psAd->interface_wrm = BcmWRM;
 
-   bytes = rdmalt(psAd, CHIP_ID_REG,
-   (u32 *) &(psAd->chip_id),
-   sizeof(u32));
+   bytes = rdmalt(psAd, CHIP_ID_REG, (u32 *) &(psAd->chip_id),
+  sizeof(u32));
if (bytes < 0) {
retval = bytes;
BCM_DEBUG_PRINT(psAd, DBG_TYPE_PRINTK, 0, 0,
@@ -410,7 +409,7 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *psIntfAdapter)
psAd->chip_id &= ~0xF0;
 
dev_info(&psIntfAdapter->udev->dev, "RDM Chip ID 0x%lx\n",
-   psAd->chip_id);
+psAd->chip_id);
 
iface_desc = psIntfAdapter->interface->cur_altsetting;
 
@@ -422,26 +421,24 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *psIntfAdapter)
bBcm16 = TRUE;
 
dev_info(&psIntfAdapter->udev->dev,
-   "number of alternate setting %d\n",
-   psIntfAdapter->interface->num_altsetting);
+"number of alternate setting %d\n",
+psIntfAdapter->interface->num_altsetting);
 
if (bBcm16 == TRUE) {
/* selecting alternate setting one as a default setting
 * for High Speed  modem. */
if (psIntfAdapter->bHighSpeedDevice)
retval = usb_set_interface(psIntfAdapter->udev,
-   DEFAULT_SETTING_0,
-   ALTERNATE_SETTING_1);
-   BCM_DEBUG_PRINT(psAd,
-   DBG_TYPE_INITEXIT, DRV_ENTRY,
+  DEFAULT_SETTING_0,
+  ALTERNATE_SETTING_1);
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT, DRV_ENTRY,
DBG_LVL_ALL,
"BCM16 is applicable on this dongle\n");
if (retval || !psIntfAdapter->bHighSpeedDevice) {
usedIntOutForBulkTransfer = EP2;
endpoint = &iface_desc->endpoint[EP2].desc;
-   BCM_DEBUG_PRINT(psAd,
-   DBG_TYPE_INITEXIT, DRV_ENTRY,
-   DBG_LVL_ALL,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
+   DRV_ENTRY, DBG_LVL_ALL,
"Interface altsetting failed or 
modem is configured to Full Speed, hence will work on default setting 0\n");
/*
 * If Modem is high speed device EP2 should be
@@ -454,8 +451,7 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *psIntfAdapter)

!usb_endpoint_is_int_out(endpoint)) ||

(!psIntfAdapter->bHighSpeedDevice &&
 
!usb_endpoint_is_bulk_out(endpoint))) {
-   BCM_DEBUG_PRINT(psAd,
-   DBG_TYPE_INITEXIT,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
DRV_ENTRY, DBG_LVL_ALL,
"Configuring the 
EEPROM\n");
/* change the EP2, EP4 to INT OUT end 
point */
@@ -484,25 +480,21 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *psIntfAdapter)
usb_endpoint_is_bulk_out(endpoint)) {
/* Once BULK is selected in FS mode. 
Revert it back to INT. Else USB_IF will fail. */
UINT _uiData = ntohl(EP2_CFG_INT);
-   BCM_DEBUG_PRINT(psAd,
-   DBG_TYPE_INITEXIT,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_INITEXIT,
DRV_ENTRY, DBG_LVL_ALL,

[PATCH v3 0/8] Cleanup patches for bcm staging driver

2014-06-12 Thread Matthias Beyer
Hi,

hopefully, this is the last version of the patchset.

I fixed up my `sed` error and test compiled the module.

Please notice: I cannot test the patches as I do not have the appropriate
hardware.

Kind regards,
Matthias Beyer

Matthias Beyer (8):
  Staging: bcm: Shortened some lines
  Staging: bcm: replaced member accessing by variable
  Staging: bcm: Replaced member accessing with variable in device_run()
  Staging: bcm: Replaced member accessing with variable in
InterfaceAdapterInit()
  Staging: bcm: Merged some lines which got shorter by the latest patch
  Staging: bcm: Outsourced selecting of alternate setting
  Staging: bcm: Shortened some lines in
select_alternate_setting_for_highspeed_modem()
  Staging: bcm: Line length cleanup

 drivers/staging/bcm/InterfaceInit.c | 303 +++-
 1 file changed, 157 insertions(+), 146 deletions(-)

-- 
2.0.0

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


[PATCH v3 4/8] Staging: bcm: Replaced member accessing with variable in InterfaceAdapterInit()

2014-06-12 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/InterfaceInit.c | 53 +++--
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceInit.c 
b/drivers/staging/bcm/InterfaceInit.c
index e1a3e6d..2f540d6 100644
--- a/drivers/staging/bcm/InterfaceInit.c
+++ b/drivers/staging/bcm/InterfaceInit.c
@@ -385,6 +385,7 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *psIntfAdapter)
bool bBcm16 = false;
UINT uiData = 0;
int bytes;
+   struct bcm_mini_adapter *psAd = psIntfAdapter->psAdapter;
 
/* Store the usb dev into interface adapter */
psIntfAdapter->udev =
@@ -392,31 +393,31 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *psIntfAdapter)
 
psIntfAdapter->bHighSpeedDevice =
(psIntfAdapter->udev->speed == USB_SPEED_HIGH);
-   psIntfAdapter->psAdapter->interface_rdm = BcmRDM;
-   psIntfAdapter->psAdapter->interface_wrm = BcmWRM;
+   psAd->interface_rdm = BcmRDM;
+   psAd->interface_wrm = BcmWRM;
 
-   bytes = rdmalt(psIntfAdapter->psAdapter, CHIP_ID_REG,
-   (u32 *) &(psIntfAdapter->psAdapter->chip_id),
+   bytes = rdmalt(psAd, CHIP_ID_REG,
+   (u32 *) &(psAd->chip_id),
sizeof(u32));
if (bytes < 0) {
retval = bytes;
-   BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0,
+   BCM_DEBUG_PRINT(psAd, DBG_TYPE_PRINTK, 0, 0,
"CHIP ID Read Failed\n");
return retval;
}
 
-   if (0xbece3200 == (psIntfAdapter->psAdapter->chip_id & ~(0xF0)))
-   psIntfAdapter->psAdapter->chip_id &= ~0xF0;
+   if (0xbece3200 == (psAd->chip_id & ~(0xF0)))
+   psAd->chip_id &= ~0xF0;
 
dev_info(&psIntfAdapter->udev->dev, "RDM Chip ID 0x%lx\n",
-   psIntfAdapter->psAdapter->chip_id);
+   psAd->chip_id);
 
iface_desc = psIntfAdapter->interface->cur_altsetting;
 
-   if (psIntfAdapter->psAdapter->chip_id == T3B) {
+   if (psAd->chip_id == T3B) {
/* T3B device will have EEPROM, check if EEPROM is proper and
 * BCM16 can be done or not. */
-   BeceemEEPROMBulkRead(psIntfAdapter->psAdapter, &uiData, 0x0, 4);
+   BeceemEEPROMBulkRead(psAd, &uiData, 0x0, 4);
if (uiData == BECM)
bBcm16 = TRUE;
 
@@ -431,14 +432,14 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *psIntfAdapter)
retval = usb_set_interface(psIntfAdapter->udev,
DEFAULT_SETTING_0,
ALTERNATE_SETTING_1);
-   BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,
+   BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT, DRV_ENTRY,
DBG_LVL_ALL,
"BCM16 is applicable on this dongle\n");
if (retval || !psIntfAdapter->bHighSpeedDevice) {
usedIntOutForBulkTransfer = EP2;
endpoint = &iface_desc->endpoint[EP2].desc;
-   BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,
+   BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT, DRV_ENTRY,
DBG_LVL_ALL,
"Interface altsetting failed or 
modem is configured to Full Speed, hence will work on default setting 0\n");
@@ -453,13 +454,13 @@ static int InterfaceAdapterInit(struct 
bcm_interface_adapter *psIntfAdapter)

!usb_endpoint_is_int_out(endpoint)) ||

(!psIntfAdapter->bHighSpeedDevice &&
 
!usb_endpoint_is_bulk_out(endpoint))) {
-   
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,
+   BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT,
DRV_ENTRY, DBG_LVL_ALL,
"Configuring the 
EEPROM\n");
/* change the EP2, EP4 to INT OUT end 
point */
ConfigureEndPointTypesThroughEEPROM(
-   
psIntfAdapter->psAdapter);
+   psAd);
 
/*
 * It resets th

Re: [PATCH 06/22] staging: rtl8188eu: Instead of intf_hdl pass adapter in read & write functions

2014-06-12 Thread Dan Carpenter
On Thu, Jun 12, 2014 at 03:52:33PM +0530, navin patidar wrote:
> On Thu, Jun 12, 2014 at 1:13 PM, Dan Carpenter  
> wrote:
> > On Wed, Jun 11, 2014 at 10:51:25PM +0530, navin patidar wrote:
> >> diff --git a/drivers/staging/rtl8188eu/core/rtw_io.c 
> >> b/drivers/staging/rtl8188eu/core/rtw_io.c
> >> index a0a31e6..85306bf 100644
> >> --- a/drivers/staging/rtl8188eu/core/rtw_io.c
> >> +++ b/drivers/staging/rtl8188eu/core/rtw_io.c
> >> @@ -57,10 +57,10 @@ u8 _rtw_read8(struct adapter *adapter, u32 addr)
> >>   u8 r_val;
> >>   struct io_priv *pio_priv = &adapter->iopriv;
> >>   struct  intf_hdl *pintfhdl = &(pio_priv->intf);
> >> - u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
> >> + u8 (*_read8)(struct adapter *pintfhdl, u32 addr);
> >  
> > Could you send a follow on patch to change pintfhdl to adapter in all
> > the declarations?
> >
> 
> dan, these declarations are removed by other patches of this patch set.
> 
> do i still need to send v2 of this patch?

No.  That's fine, thanks.

regards,
dan carpenter

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


Re: [PATCH] drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c: fix coding style

2014-06-12 Thread Greg Kroah-Hartman
On Thu, Jun 12, 2014 at 02:35:38PM +0400, Wahib Faizi wrote:
> Fix coding style issues detected by checkpatch.pl:
> 1. do not use assignment in if condition
> 2. line over 80 characters

You are doing two different things here, so please break it up into two
different patches.  Can you please do this and resend?

thanks,

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


Re: PATCH[[vme/bridges/vme_ca91cx42.c:1382: Bad if test Bug Fix]‏‏

2014-06-12 Thread nick
Here is the fixed patch. Having issues with using Thunderbird
so just used Evolution for now.
Nick 
--- drivers/vme/bridges/vme_ca91cx42.h.orig 2014-06-11 22:50:29.339671939 
-0400
+++ drivers/vme/bridges/vme_ca91cx42.h  2014-06-11 23:15:36.027685173 -0400
Fixes bug issues with wrong bus width in if statments in vme_ca91cx42.c
Signed-off-by: Nicholas Krause 
@@ -526,7 +526,7 @@ static const int CA91CX42_LINT_LM[] = {
 #define CA91CX42_VSI_CTL_SUPER_SUPR(1<<21)
 
 #define CA91CX42_VSI_CTL_VAS_M (7<<16)
-#define CA91CX42_VSI_CTL_VAS_A16   0
+#define CA91CX42_VSI_CTL_VAS_A16   (3<<16)
 #define CA91CX42_VSI_CTL_VAS_A24   (1<<16)
 #define CA91CX42_VSI_CTL_VAS_A32   (1<<17)
 #define CA91CX42_VSI_CTL_VAS_USER1 (3<<17)
@@ -549,7 +549,7 @@ static const int CA91CX42_LINT_LM[] = {
 #define CA91CX42_LM_CTL_SUPR   (1<<21)
 #define CA91CX42_LM_CTL_NPRIV  (1<<20)
 #define CA91CX42_LM_CTL_AS_M   (5<<16)
-#define CA91CX42_LM_CTL_AS_A16 0
+#define CA91CX42_LM_CTL_AS_A16 (3<<16)
 #define CA91CX42_LM_CTL_AS_A24 (1<<16)
 #define CA91CX42_LM_CTL_AS_A32 (1<<17)



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


Re: PATCH[[vme/bridges/vme_ca91cx42.c:1382: Bad if test Bug Fix]‏‏

2014-06-12 Thread Dan Carpenter
On Thu, Jun 12, 2014 at 10:33:09AM -0400, nick wrote:
> Here is the fixed patch. Having issues with using Thunderbird
> so just used Evolution for now.
> Nick 

Please read the first paragraph of:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/Documentation/email-clients.txt

It's not clear from reading this email why 0 is incorrect and 3<<16 is
correct.  Explain in the changelog.  What are the user visible effects
of this bug etc.

The patch must have a signed-off-by line.

Here is what typical patch emails should look like:
https://lkml.org/lkml/2014/6/12/377
https://lkml.org/lkml/2014/6/12/369
https://lkml.org/lkml/2014/6/12/299

The subject should be:

[PATCH] vme: ca91cx42: Bad if test something something

Make sure it apply with `git am` and review the log.

regards,
dan carpenter


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


Re: [PATCH v3 0/8] Cleanup patches for bcm staging driver

2014-06-12 Thread Dan Carpenter
Good enough.  Thanks.

regards,
dan carpenter

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


Re: [PATCHv2] staging: keucr: usb.c: add blank lines after declarations

2014-06-12 Thread Greg KH
On Thu, Jun 12, 2014 at 09:28:56AM +0200, mathias.en...@gmail.com wrote:
> From: Mathias Engan 
> 
> Add blank line after declarations in eucr_suspend and eucr_resume
> as reported by checkpatch.
> 
> Signed-off-by: Mathias Engan 
> ---
>  drivers/staging/keucr/usb.c |2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/keucr/usb.c b/drivers/staging/keucr/usb.c
> index 12ebde7..dbbd63f 100644
> --- a/drivers/staging/keucr/usb.c
> +++ b/drivers/staging/keucr/usb.c
> @@ -37,6 +37,7 @@ MODULE_DEVICE_TABLE(usb, eucr_usb_ids);
>  static int eucr_suspend(struct usb_interface *iface, pm_message_t message)
>  {
>   struct us_data *us = usb_get_intfdata(iface);
> +
>   pr_info("--- eucr_suspend ---\n");
>   /* Wait until no command is running */
>   mutex_lock(&us->dev_mutex);
> @@ -53,6 +54,7 @@ static int eucr_resume(struct usb_interface *iface)
>   u8tmp = 0;
>  
>   struct us_data *us = usb_get_intfdata(iface);

Shouldn't you remove the blank line above this variable as well?

thanks,

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


Re: [PATCH] staging: iio: fix coding style

2014-06-12 Thread Greg Kroah-Hartman
On Thu, Jun 12, 2014 at 05:42:43PM +0800, Jimmy P wrote:
> This patch fixes coding style errors reported by checkpatch.pl for
> lines that was over 80 chars long. The macro value shoud be put in () as
> well.
> 
> Signed-off-by: Jimmy P 

We need a "real" or "full" name here for the signed-off-by: line, please
read Documentation/SubmittingPatches for the full details as to what
this line means and why we need that.

Also, this patch does multiple things, please break it up into different
patches, each only doing one specific thing.

thanks,

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


[PATCH v2 2/2] drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c: fix coding style

2014-06-12 Thread Wahib Faizi
Fix coding style issue "line over 80 characters"
detected by checkpatch.pl in usbip_host_driver.c.

Signed-off-by: Wahib Faizi 
---
 .../usbip/userspace/libsrc/usbip_host_driver.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c 
b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
index 32b8f52..bef08d5 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
@@ -88,8 +88,8 @@ struct usbip_exported_device *usbip_exported_device_new(const 
char *sdevpath)
goto err;
 
/* reallocate buffer to include usb interface data */
-   size = sizeof(struct usbip_exported_device) + edev->udev.bNumInterfaces 
*
-   sizeof(struct usbip_usb_interface);
+   size = sizeof(struct usbip_exported_device) +
+   edev->udev.bNumInterfaces * sizeof(struct usbip_usb_interface);
 
edev_old = edev;
edev = realloc(edev, size);
-- 
1.7.9.5

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


Split patch into 2 logical chunks

2014-06-12 Thread Wahib Faizi

Fix coding style issues detected by checkpatch.pl in usbip_host_driver.c.

v2: Split patch into logical chunks, as suggested by 
Greg Kroah-Hartman 

[PATCH v2 1/2]
Fix coding style issue "do not use assignment in if condition" 
detected by checkpatch.pl in usbip_host_driver.c.

[PATCH v2 2/2]
Fix coding style issue "line over 80 characters" 
detected by checkpatch.pl in usbip_host_driver.c.

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


[PATCH v2 1/2] drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c: fix coding style

2014-06-12 Thread Wahib Faizi
Fix coding style issue "do not use assignment in if condition"
detected by checkpatch.pl in usbip_host_driver.c.

Signed-off-by: Wahib Faizi 
---
 .../usbip/userspace/libsrc/usbip_host_driver.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c 
b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
index 92caef7..32b8f52 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
@@ -47,7 +47,8 @@ static int32_t read_attr_usbip_status(struct usbip_usb_device 
*udev)
snprintf(status_attr_path, SYSFS_PATH_MAX, "%s/usbip_status",
 udev->path);
 
-   if ((fd = open(status_attr_path, O_RDONLY)) < 0) {
+   fd = open(status_attr_path, O_RDONLY);
+   if (fd < 0) {
err("error opening attribute %s", status_attr_path);
return -1;
}
-- 
1.7.9.5

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


[PATCH] staging: rtl8172u: Make ieee80211_crypto_init static

2014-06-12 Thread L . Alberto Giménez
Fix sparse warning.

Signed-off-by: L. Alberto Giménez 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c
index 5533221..3be690d 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c
@@ -200,7 +200,7 @@ static struct ieee80211_crypto_ops ieee80211_crypt_null = {
.owner  = THIS_MODULE,
 };
 
-int __init ieee80211_crypto_init(void)
+static int __init ieee80211_crypto_init(void)
 {
int ret = -ENOMEM;
 
-- 
2.0.0.rc0

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


Re: [PATCH v2 1/2] drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c: fix coding style

2014-06-12 Thread Greg Kroah-Hartman
On Thu, Jun 12, 2014 at 09:32:19PM +0400, Wahib Faizi wrote:
> Fix coding style issue "do not use assignment in if condition"
> detected by checkpatch.pl in usbip_host_driver.c.
> 
> Signed-off-by: Wahib Faizi 

Both of these patches have the same Subject: line, which isn't good as
it doesn't make much sense.

You can also shorten it a lot, for example, this one should be:
  Subject: staging: usbip: usbip_host_driver.c: fix if assignment style issue

Care to redo both of these that way?

thanks,

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


Re: [PATCH v2 1/2] drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c: fix coding style

2014-06-12 Thread Joe Perches
On Thu, 2014-06-12 at 10:54 -0700, Greg Kroah-Hartman wrote:
> On Thu, Jun 12, 2014 at 09:32:19PM +0400, Wahib Faizi wrote:
> > Fix coding style issue "do not use assignment in if condition"
> > detected by checkpatch.pl in usbip_host_driver.c.
> > 
> > Signed-off-by: Wahib Faizi 
> 
> Both of these patches have the same Subject: line, which isn't good as
> it doesn't make much sense.
> 
> You can also shorten it a lot, for example, this one should be:
>   Subject: staging: usbip: usbip_host_driver.c: fix if assignment style issue

True.  usbip_host_driver.c doesn't add much though.

It could even be something like:

staging: usbip: avoid assignment in if


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


[PATCHv3] staging: keucr: usb.c: add blank lines after declarations

2014-06-12 Thread mathias . engan
From: Mathias Engan 

Add blank line after declarations in eucr_suspend and eucr_resume
as reported by checkpatch.

Signed-off-by: Mathias Engan 
---
 drivers/staging/keucr/usb.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/keucr/usb.c b/drivers/staging/keucr/usb.c
index 12ebde7..1e2073b 100644
--- a/drivers/staging/keucr/usb.c
+++ b/drivers/staging/keucr/usb.c
@@ -37,6 +37,7 @@ MODULE_DEVICE_TABLE(usb, eucr_usb_ids);
 static int eucr_suspend(struct usb_interface *iface, pm_message_t message)
 {
struct us_data *us = usb_get_intfdata(iface);
+
pr_info("--- eucr_suspend ---\n");
/* Wait until no command is running */
mutex_lock(&us->dev_mutex);
@@ -51,8 +52,8 @@ static int eucr_suspend(struct usb_interface *iface, 
pm_message_t message)
 static int eucr_resume(struct usb_interface *iface)
 {
u8tmp = 0;
-
struct us_data *us = usb_get_intfdata(iface);
+
pr_info("--- eucr_resume---\n");
mutex_lock(&us->dev_mutex);
 
-- 
1.7.9.5

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


[PATCH 2/2] staging: usbip: usbip_host_driver.c: fix line over 80 characters

2014-06-12 Thread Wahib Faizi
Fix coding style issue "line over 80 characters"
detected by checkpatch.pl in usbip_host_driver.c.

Signed-off-by: Wahib Faizi 
---
 .../usbip/userspace/libsrc/usbip_host_driver.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c 
b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
index 32b8f52..bef08d5 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
@@ -88,8 +88,8 @@ struct usbip_exported_device *usbip_exported_device_new(const 
char *sdevpath)
goto err;
 
/* reallocate buffer to include usb interface data */
-   size = sizeof(struct usbip_exported_device) + edev->udev.bNumInterfaces 
*
-   sizeof(struct usbip_usb_interface);
+   size = sizeof(struct usbip_exported_device) +
+   edev->udev.bNumInterfaces * sizeof(struct usbip_usb_interface);
 
edev_old = edev;
edev = realloc(edev, size);
-- 
1.7.9.5

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


Fix subject line

2014-06-12 Thread Wahib Faizi

Fix coding style issues detected by checkpatch.pl in usbip_host_driver.c.

v3: Shorten subject line, as suggested by
Greg Kroah-Hartman ,
Joe Perches 
 
v2: Split patch into logical chunks, as suggested by
Greg Kroah-Hartman 

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


[PATCH 1/2] staging: usbip: usbip_host_driver.c: avoid assignment in if

2014-06-12 Thread Wahib Faizi
Fix coding style issue "do not use assignment in if condition"
detected by checkpatch.pl in usbip_host_driver.c.

Signed-off-by: Wahib Faizi 
---
 .../usbip/userspace/libsrc/usbip_host_driver.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c 
b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
index 92caef7..32b8f52 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
@@ -47,7 +47,8 @@ static int32_t read_attr_usbip_status(struct usbip_usb_device 
*udev)
snprintf(status_attr_path, SYSFS_PATH_MAX, "%s/usbip_status",
 udev->path);
 
-   if ((fd = open(status_attr_path, O_RDONLY)) < 0) {
+   fd = open(status_attr_path, O_RDONLY);
+   if (fd < 0) {
err("error opening attribute %s", status_attr_path);
return -1;
}
-- 
1.7.9.5

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


[PATCH v3 0/2] Fix subject line

2014-06-12 Thread Wahib Faizi

Fix coding style issues detected by checkpatch.pl in usbip_host_driver.c.

v3: Shorten subject line, as suggested by 
Greg Kroah-Hartman ,
Joe Perches 

v2: Split patch into logical chunks, as suggested by 
Greg Kroah-Hartman 

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


[PATCH v3 1/2] staging: usbip: usbip_host_driver.c: avoid assignment in if

2014-06-12 Thread Wahib Faizi
Fix coding style issue "do not use assignment in if condition"
detected by checkpatch.pl in usbip_host_driver.c.

Signed-off-by: Wahib Faizi 
---
 .../usbip/userspace/libsrc/usbip_host_driver.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c 
b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
index 92caef7..32b8f52 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
@@ -47,7 +47,8 @@ static int32_t read_attr_usbip_status(struct usbip_usb_device 
*udev)
snprintf(status_attr_path, SYSFS_PATH_MAX, "%s/usbip_status",
 udev->path);
 
-   if ((fd = open(status_attr_path, O_RDONLY)) < 0) {
+   fd = open(status_attr_path, O_RDONLY);
+   if (fd < 0) {
err("error opening attribute %s", status_attr_path);
return -1;
}
-- 
1.7.9.5

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


[PATCH v3 2/2] staging: usbip: usbip_host_driver.c: fix line over 80 characters

2014-06-12 Thread Wahib Faizi
Fix coding style issue "line over 80 characters"
detected by checkpatch.pl in usbip_host_driver.c.

Signed-off-by: Wahib Faizi 
---
 .../usbip/userspace/libsrc/usbip_host_driver.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c 
b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
index 32b8f52..bef08d5 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
@@ -88,8 +88,8 @@ struct usbip_exported_device *usbip_exported_device_new(const 
char *sdevpath)
goto err;
 
/* reallocate buffer to include usb interface data */
-   size = sizeof(struct usbip_exported_device) + edev->udev.bNumInterfaces 
*
-   sizeof(struct usbip_usb_interface);
+   size = sizeof(struct usbip_exported_device) +
+   edev->udev.bNumInterfaces * sizeof(struct usbip_usb_interface);
 
edev_old = edev;
edev = realloc(edev, size);
-- 
1.7.9.5

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


Re: [PATCH v3 0/2] Fix subject line

2014-06-12 Thread Davidlohr Bueso
On Thu, 2014-06-12 at 23:40 +0400, Wahib Faizi wrote:
> Fix coding style issues detected by checkpatch.pl in usbip_host_driver.c.

Sorry but unless bundled with something more meaningful, I really don't
see the value in these changes. I certainly don't want to discourage
folks or anything, but just testing other patches is a lot more helpful
than this. 

I haven't followed much about the Eudyptula Challenge, but I hope other
assignments are more involved than this.

Thanks,
Davidlohr

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


Re: [PATCH v3 0/2] Fix subject line

2014-06-12 Thread Greg Kroah-Hartman
On Thu, Jun 12, 2014 at 01:25:34PM -0700, Davidlohr Bueso wrote:
> On Thu, 2014-06-12 at 23:40 +0400, Wahib Faizi wrote:
> > Fix coding style issues detected by checkpatch.pl in usbip_host_driver.c.
> 
> Sorry but unless bundled with something more meaningful, I really don't
> see the value in these changes. I certainly don't want to discourage
> folks or anything, but just testing other patches is a lot more helpful
> than this. 

When the staging code is still needing basic fixes like this, it is
"meaningful" to do patches that clean up stuff like this.  That's what
the staging tree is for.

thanks,

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


Re: [PATCH v3 0/2] Fix subject line

2014-06-12 Thread Davidlohr Bueso
On Thu, 2014-06-12 at 13:35 -0700, Greg Kroah-Hartman wrote:
> On Thu, Jun 12, 2014 at 01:25:34PM -0700, Davidlohr Bueso wrote:
> > On Thu, 2014-06-12 at 23:40 +0400, Wahib Faizi wrote:
> > > Fix coding style issues detected by checkpatch.pl in usbip_host_driver.c.
> > 
> > Sorry but unless bundled with something more meaningful, I really don't
> > see the value in these changes. I certainly don't want to discourage
> > folks or anything, but just testing other patches is a lot more helpful
> > than this. 
> 
> When the staging code is still needing basic fixes like this, it is
> "meaningful" to do patches that clean up stuff like this.  That's what
> the staging tree is for.

Sure, but "making checkpatch happy just to make checkpatch happy" isn't
a good justification, even for staging. Patch 1 does have value in that
it helps avoid silly bugs, but take patch 2/2, we end-up saving just a
few spaces... Anyways, just my 2 cents.

Thanks,
Davidlohr

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


Re: PATCH[[vme/bridges/vme_ca91cx42.c:1382: Bad if test Bug Fix]‏‏

2014-06-12 Thread Dan Carpenter
Martyn,

Nick Krause emailed me privately that he's not able to get git to work.
Normally for bug fixes, we would patch this up ourselves.

The offending code was introduced in:

commit 2b82beb8c1bc81b3dde69d16cacbc22546681acf
Author: Martyn Welch 
Date:   Thu Feb 18 15:13:19 2010 +

Staging: vme: Add location monitor support for ca91cx42

The |= 0 does look very suspicious and I have a static checker warning
for code like that.  Certainly it sounds very authoritative to say that
instead of zero, CA91CX42_LM_CTL_AS_A16 should be (3 << 16).  But then
the condition:

if ((lm_ctl & (5 << 16)) == (3 << 16))

is always false...  It is puzzling.

I don't know this code and I have no idea what is correct.  Was this a
real bug that Nick hit in testing, or was it a static checker fix?  He
hasn't told us any of this stuff...

What to do...

regards,
dan carpenter

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


[PATCH] staging: lustre: removed spaces at the start of a line

2014-06-12 Thread Marc Fite
Hello,

This is a patch in order to remove 2 lines with spaces at the start of the line.

Best Regards.

Signed-off-by: Marc Fite 
---
 drivers/staging/lustre/lustre/obdecho/lproc_echo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdecho/lproc_echo.c 
b/drivers/staging/lustre/lustre/obdecho/lproc_echo.c
index 8fe9245..c972eb4 100644
--- a/drivers/staging/lustre/lustre/obdecho/lproc_echo.c
+++ b/drivers/staging/lustre/lustre/obdecho/lproc_echo.c
@@ -51,7 +51,7 @@ static struct lprocfs_vars lprocfs_echo_module_vars[] = {
 
 void lprocfs_echo_init_vars(struct lprocfs_static_vars *lvars)
 {
-lvars->module_vars  = lprocfs_echo_module_vars;
-lvars->obd_vars = lprocfs_echo_obd_vars;
+   lvars->module_vars  = lprocfs_echo_module_vars;
+   lvars->obd_vars = lprocfs_echo_obd_vars;
 }
 #endif /* LPROCFS */
-- 
2.0.0

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


Re: [PATCH] staging: usbip: stub_main.c: Cleaning up missing null-terminate after strncpy call

2014-06-12 Thread Rickard Strandqvist
2014-06-11 7:45 GMT+02:00 Dan Carpenter :
> On Tue, Jun 10, 2014 at 10:48:35PM +0200, Rickard Strandqvist wrote:
>> Hi
>>
>> True!
>> Sorry  :-(
>>
>> But then one would either operate strcpy outright.
>>
>> Or use strlcpy then the code would be:
>>
>> /* strlcpy() handles not include \0 */
>> len = strlcpy(busid, buf + 4, BUSID_SIZE);
>>
>> /* busid needs to include \0 termination */
>> if (!(len < BUSID_SIZE))
>
> I don't like this condition.  Just say (len >= BUSID_SIZE).  The
> comments here are obvious and could be left out.
>
>> return -EINVAL;
>
> I don't have strong feelings about a cleanup patch.  But I think that
> cppcheck is not being very sofisticated here with the NUL termination
> warning so we should not go out of our way to try to silence the
> warning.
>
> regards,
> dan carpenter
>


Hi Dan

I agree that you should not do patches just to silence a static control program.

Concerning (len >= BUSID_SIZE) I agree! But I usually try to change as
little as possible in the patches I do. But perhaps I should not think
that way.



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


Re: [PATCH v3 0/2] Fix subject line

2014-06-12 Thread Dan Carpenter
On Thu, Jun 12, 2014 at 01:48:38PM -0700, Davidlohr Bueso wrote:
> On Thu, 2014-06-12 at 13:35 -0700, Greg Kroah-Hartman wrote:
> > On Thu, Jun 12, 2014 at 01:25:34PM -0700, Davidlohr Bueso wrote:
> > > On Thu, 2014-06-12 at 23:40 +0400, Wahib Faizi wrote:
> > > > Fix coding style issues detected by checkpatch.pl in 
> > > > usbip_host_driver.c.
> > > 
> > > Sorry but unless bundled with something more meaningful, I really don't
> > > see the value in these changes. I certainly don't want to discourage
> > > folks or anything, but just testing other patches is a lot more helpful
> > > than this. 
> > 
> > When the staging code is still needing basic fixes like this, it is
> > "meaningful" to do patches that clean up stuff like this.  That's what
> > the staging tree is for.
> 
> Sure, but "making checkpatch happy just to make checkpatch happy" isn't
> a good justification, even for staging.

It actually is.  Fighting against checkpatch is a losers battle.  Our
way more efficient.

1) We do need to fix this checkpatch warning before it moves out of
   staging.
2) NAKing patches is actually a lot of stress for everyone.  It stresses
   out submitters and drives them away.  It stresses out the
   maintainers because we feel bad.  That stress is bad when it is
   pointless.
3) This patch is ok.
4) If we don't apply this patch then someone else will send the exact
   same patch or something worse until we apply something.
5) The v3 of this patch takes under 30 seconds to review and apply.
6) Newbies feel happy when their patch gets merged and that is good.

The other thing is that if you start asking "Is this patch meaningful"
then it makes applying any patch into a big question about meaning and
it tires you out.

In staging we have clear rules for when a patch is going to be applied
and everyone understands the rules.  It means that if Greg is traveling
then you know which patches he is going to apply in what order and life
is easier because it is more predictable.

regards,
dan carpenter

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


Re: [PATCH] staging: usbip: stub_main.c: Cleaning up missing null-terminate after strncpy call

2014-06-12 Thread Dan Carpenter
On Thu, Jun 12, 2014 at 11:09:20PM +0200, Rickard Strandqvist wrote:
> I agree that you should not do patches just to silence a static control 
> program.
> 
> Concerning (len >= BUSID_SIZE) I agree! But I usually try to change as
> little as possible in the patches I do. But perhaps I should not think
> that way.

The "one thing per patch" rule is tricky for a lot of people when they
start upstream kernel programming.

1) If you are going to need to backport a patch then write the simplest
   version you can and do any cleanup in a later patch.

2) Most of these patches will not need to back ported.  The "one thing"
is about how you describe the patch.  You're allowed to make minor
closely related changes.  In this case the one thing would be, "Clean up
string handling in xxx()".  The commit message would say:

cppcheck has a false positive here.  I looked at the code and it's ok,
but a bit messy.  I have cleaned it up by doing:

1) use strclpy() or whatever
2) cleanup a condition
3) remove obvious comments
4) blah blah blah

The new code is simpler and doesn't generate a cppcheck warning.

Where checkpatch.pl get into trouble is that they say "I am doing one
thing and it is to fix everything in filename.c".  That's everything and
not "one thing".

regards,
dan carpenter

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


Patch[Fixes marco definition for if statements that use marco CA91CX42_LM_CTL_AS_A16 in header file, vme_ca91cx42.h]

2014-06-12 Thread Nick

Signed-off-by: Nicholas Krause 
---
 drivers/vme/bridges/vme_ca91cx42.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vme/bridges/vme_ca91cx42.h 
b/drivers/vme/bridges/vme_ca91cx42.h
index 02a7c79..57e942f 100644
--- a/drivers/vme/bridges/vme_ca91cx42.h
+++ b/drivers/vme/bridges/vme_ca91cx42.h
@@ -549,7 +549,7 @@ static const int CA91CX42_LINT_LM[] = { CA91CX42_LINT_LM0, 
CA91CX42_LINT_LM1,
 #define CA91CX42_LM_CTL_SUPR   (1<<21)
 #define CA91CX42_LM_CTL_NPRIV  (1<<20)
 #define CA91CX42_LM_CTL_AS_M   (5<<16)
-#define CA91CX42_LM_CTL_AS_A16 0
+#define CA91CX42_LM_CTL_AS_A16 (3<<16)
 #define CA91CX42_LM_CTL_AS_A24 (1<<16)
 #define CA91CX42_LM_CTL_AS_A32 (1<<17)
 
-- 
1.9.1

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


[PATCH] drivers/staging/speakup/main: fixed jiffie comparison

2014-06-12 Thread Robin Schroer
speakup_key() used manual comparison of jiffies to determine the time
since the last keypress, replaced it with time_after()

Signed-off-by: Robin Schroer 
---
 drivers/staging/speakup/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 7de79d5..0cd3cdb 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2067,7 +2067,7 @@ speakup_key(struct vc_data *vc, int shift_state, int 
keycode, u_short keysym,
if (up_flag)
goto out;
if (last_keycode == keycode &&
-   last_spk_jiffy + MAX_DELAY > jiffies) {
+   time_after(last_spk_jiffy + MAX_DELAY, jiffies)) {
spk_close_press = 1;
offset = spk_shift_table[shift_info + 32];
/* double press? */
-- 
1.9.3

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


[PATCH] drivers/staging/speakup/main: fixed jiffie comparison

2014-06-12 Thread Robin Schroer
speakup_key() used manual comparison of jiffies to determine the time
since the last keypress, replaced it with time_after()

Resend with kernel mailing list cc'ed (duh...)

Signed-off-by: Robin Schroer 
---
 drivers/staging/speakup/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 7de79d5..0cd3cdb 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2067,7 +2067,7 @@ speakup_key(struct vc_data *vc, int shift_state, int 
keycode, u_short keysym,
if (up_flag)
goto out;
if (last_keycode == keycode &&
-   last_spk_jiffy + MAX_DELAY > jiffies) {
+   time_after(last_spk_jiffy + MAX_DELAY, jiffies)) {
spk_close_press = 1;
offset = spk_shift_table[shift_info + 32];
/* double press? */
-- 
1.9.3

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


Re: [PATCH v13 06/10] drm: drm_display_mode: add signal polarity flags

2014-06-12 Thread Laurent Pinchart
Hi Denis,

Thank you for the patch.

On Tuesday 10 June 2014 12:25:47 Denis Carikli wrote:
> We need a way to pass signal polarity informations
>   between DRM panels, and the display drivers.
> 
> To do that, a pol_flags field was added to drm_display_mode.
> 
> Signed-off-by: Denis Carikli 
> ---
> ChangeLog v12->v13:
> - Added Docbook documentation for pol_flags the struct field.
> - Removed the _PRESERVE   defines: it was used by patches
>   against the imx_drm driver. Now theses patches have been
>   adapted not to require that defines.
> ChangeLog v11->v12:
> - Rebased: This patch now applies against drm_modes.h
> - Rebased: It now uses the new DRM_MODE_FLAG_POL_DE flags defines names
> 
> ChangeLog v10->v11:
> - Since the imx-drm won't be able to retrive its regulators
>   from the device tree when using display-timings nodes,
>   and that I was told that the drm simple-panel driver
>   already supported that, I then, instead, added what was
>   lacking to make the eukrea displays work with the
>   drm-simple-panel driver.
> 
>   That required a way to get back the display polarity
>   informations from the imx-drm driver without affecting
>   userspace.
> ---
>  Documentation/DocBook/drm.tmpl |   30 ++
>  include/drm/drm_modes.h|6 ++
>  2 files changed, 36 insertions(+)
> 
> diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
> index c526d81..29c0e5a 100644
> --- a/Documentation/DocBook/drm.tmpl
> +++ b/Documentation/DocBook/drm.tmpl
> @@ -2292,6 +2292,36 @@ void intel_crt_init(struct drm_device *dev)
>  and height_mm fields are only used
> internally during EDID parsing and should not be set when creating modes
> manually. 
> +  
> +The pol_flags value represents the
> display
> +signal polarity flags, it can be a combination of
> +
> +  
> +DRM_MODE_FLAG_POL_PIXDATA_NEGEDGE
> + 
> + drive pixel data on falling edge, sample data on
> rising edge.
> + 
> +  
> +  
> +DRM_MODE_FLAG_POL_PIXDATA_POSEDGE
> +
> +  Drive pixel data on rising edge, sample data on falling
> edge.
> +
> +  
> +  
> +DRM_MODE_FLAG_POL_DE_LOW
> +
> +  data-enable pulse is active low
> +
> +  
> +  
> +DRM_MODE_FLAG_POL_DE_HIGH
> +
> +  data-enable pulse is active low

I assume you mean active high here.

> +
> +  
> +
> +  
>  
>  
>int (*mode_valid)(struct drm_connector *connector,
> diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
> index 91d0582..c5cbe31 100644
> --- a/include/drm/drm_modes.h
> +++ b/include/drm/drm_modes.h
> @@ -93,6 +93,11 @@ enum drm_mode_status {
> 
>  #define DRM_MODE_FLAG_3D_MAX DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF
> 
> +#define DRM_MODE_FLAG_POL_PIXDATA_NEGEDGEBIT(1)
> +#define DRM_MODE_FLAG_POL_PIXDATA_POSEDGEBIT(2)
> +#define DRM_MODE_FLAG_POL_DE_LOW BIT(3)
> +#define DRM_MODE_FLAG_POL_DE_HIGHBIT(4)
> +
>  struct drm_display_mode {
>   /* Header */
>   struct list_head head;
> @@ -144,6 +149,7 @@ struct drm_display_mode {
>   int vrefresh;   /* in Hz */
>   int hsync;  /* in kHz */
>   enum hdmi_picture_aspect picture_aspect_ratio;
> + unsigned int pol_flags;
>  };
> 
>  /* mode specified on the command line */

-- 
Regards,

Laurent Pinchart

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


[PATCH] staging: iio: fix coding style

2014-06-12 Thread Jimmy Picard
This patch fixes coding style reported by checkpatch.pl that missing
a blank line after declarations.

Signed-off-by: Jimmy Picard 
---
 drivers/staging/iio/iio_simple_dummy.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/iio/iio_simple_dummy.c 
b/drivers/staging/iio/iio_simple_dummy.c
index fd334a0..bf78e6f 100644
--- a/drivers/staging/iio/iio_simple_dummy.c
+++ b/drivers/staging/iio/iio_simple_dummy.c
@@ -550,6 +550,7 @@ error_ret:
 static __init int iio_dummy_init(void)
 {
int i, ret;
+
if (instances > 10) {
instances = 1;
return -EINVAL;
@@ -577,6 +578,7 @@ module_init(iio_dummy_init);
 static __exit void iio_dummy_exit(void)
 {
int i;
+
for (i = 0; i < instances; i++)
iio_dummy_remove(i);
kfree(iio_dummy_devs);
-- 
2.0.0

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