[PATCH] drivers:bluetooth:ath3k.c Fixed sparse warning for cast to restricted __le32

2014-03-25 Thread Surendra Patil
 To fix the sparse warning "cast to restricted __le32" marked
 "rom_version"  to __le32 instead of unsigned int in "struct ath3k_version"
 and added cpu_to_le32() for the expression assigning int value to 
"rom_version".
 Successfully built the module without warnings and errors on x86 machine with 
sparse.

Signed-off-by: Surendra Patil 
---
 drivers/bluetooth/ath3k.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index be571fe..5564207 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -50,7 +50,7 @@
 #define ATH3K_NAME_LEN 0xFF
 
 struct ath3k_version {
-   unsigned introm_version;
+   __le32  rom_version;
unsigned intbuild_version;
unsigned intram_version;
unsigned char   ref_clock;
@@ -375,7 +375,7 @@ static int ath3k_load_patch(struct usb_device *udev)
return ret;
}
 
-   pt_version.rom_version = *(int *)(firmware->data + firmware->size - 8);
+   pt_version.rom_version = cpu_to_le32(*(int *)(firmware->data + 
firmware->size - 8));
pt_version.build_version = *(int *)
(firmware->data + firmware->size - 4);
 
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers:bluetooth:ath3k.c: Fixed sparse warning for cast to restricted __le32

2014-03-25 Thread Surendra Patil
This patch fixes below Sparse warnings -
drivers/bluetooth/ath3k.c:370:17: warning: cast to restricted __le32
drivers/bluetooth/ath3k.c:432:17: warning: cast to restricted __le32

Signed-off-by: Surendra Patil 
---
 drivers/bluetooth/ath3k.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index be571fe..badacbc 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -367,7 +367,7 @@ static int ath3k_load_patch(struct usb_device *udev)
}
 
snprintf(filename, ATH3K_NAME_LEN, "ar3k/AthrBT_0x%08x.dfu",
-   le32_to_cpu(fw_version.rom_version));
+   fw_version.rom_version);
 
ret = request_firmware(&firmware, filename, &udev->dev);
if (ret < 0) {
@@ -429,7 +429,7 @@ static int ath3k_load_syscfg(struct usb_device *udev)
}
 
snprintf(filename, ATH3K_NAME_LEN, "ar3k/ramps_0x%08x_%d%s",
-   le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
+fw_version.rom_version, clk_value, ".dfu");
 
ret = request_firmware(&firmware, filename, &udev->dev);
if (ret < 0) {
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Drivers:net:wireless:ti:wl1251: Fixed Sparse invalid assignment warning

2014-03-04 Thread Surendra Patil
Sparse warns about invalid assignment in
drivers/net/wireless/ti/wl1251/cmd.c:451:42: warning: invalid assignment: |=
drivers/net/wireless/ti/wl1251/cmd.c:451:42:left side has type restricted 
__le16
drivers/net/wireless/ti/wl1251/cmd.c:451:42:right side has type int
Hence type converted right side to __le16.

Signed-off-by: Surendra Patil 
---
 drivers/net/wireless/ti/wl1251/cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wl1251/cmd.c 
b/drivers/net/wireless/ti/wl1251/cmd.c
index 223649b..bf1fa18 100644
--- a/drivers/net/wireless/ti/wl1251/cmd.c
+++ b/drivers/net/wireless/ti/wl1251/cmd.c
@@ -448,7 +448,7 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t 
ssid_len,
 * Note: This bug may be caused by the fw's DTIM handling.
 */
if (is_zero_ether_addr(wl->bssid))
-   cmd->params.scan_options |= WL1251_SCAN_OPT_PRIORITY_HIGH;
+   cmd->params.scan_options |= 
cpu_to_le16(WL1251_SCAN_OPT_PRIORITY_HIGH);
cmd->params.num_channels = n_channels;
cmd->params.num_probe_requests = n_probes;
cmd->params.tx_rate = cpu_to_le16(1 << 1); /* 2 Mbps */
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers:staging:ozwpan Replaced wrapper functions with actual spin lock function

2014-03-03 Thread Surendra Patil
* Replaced all the spin lock/unlock wrappers from oz_polling_lock_bh()
and oz_polllin_unlock_bh() with spin_lock_bh(&g_polling_lock) and
spin_unlock_bh(&g_polling_lock).Completely erased the wrappers defination
and declaration.
* declared g_polling_lock as global variable in header file and added comments 
to it.
Module builded successfully with sparse without warnings.

Signed-off-by: Surendra Patil 
---
 drivers/staging/ozwpan/ozpd.c| 28 ++--
 drivers/staging/ozwpan/ozpd.h|  5 +
 drivers/staging/ozwpan/ozproto.c | 15 +--
 drivers/staging/ozwpan/ozproto.h |  2 --
 4 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index 7436950..29a23a3 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -284,11 +284,11 @@ int oz_services_start(struct oz_pd *pd, u16 apps, int 
resume)
  ai->app_id);
break;
}
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
pd->total_apps |= (1<app_id);
if (resume)
pd->paused_apps &= ~(1<app_id);
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
}
}
return rc;
@@ -304,14 +304,14 @@ void oz_services_stop(struct oz_pd *pd, u16 apps, int 
pause)
oz_pd_dbg(pd, ON, "%s: (0x%x) pause(%d)\n", __func__, apps, pause);
for (ai = g_app_if; ai < &g_app_if[OZ_APPID_MAX]; ai++) {
if (apps & (1<app_id)) {
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
if (pause) {
pd->paused_apps |= (1<app_id);
} else {
pd->total_apps &= ~(1<app_id);
pd->paused_apps &= ~(1<app_id);
}
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
ai->stop(pd, pause);
}
}
@@ -349,17 +349,17 @@ void oz_pd_stop(struct oz_pd *pd)
 
oz_dbg(ON, "oz_pd_stop() State = 0x%x\n", pd->state);
oz_pd_indicate_farewells(pd);
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
stop_apps = pd->total_apps;
pd->total_apps = 0;
pd->paused_apps = 0;
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
oz_services_stop(pd, stop_apps, 0);
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
oz_pd_set_state(pd, OZ_PD_S_STOPPED);
/* Remove from PD list.*/
list_del(&pd->link);
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
oz_dbg(ON, "pd ref count = %d\n", atomic_read(&pd->ref_count));
oz_pd_put(pd);
 }
@@ -372,9 +372,9 @@ int oz_pd_sleep(struct oz_pd *pd)
int do_stop = 0;
u16 stop_apps;
 
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
if (pd->state & (OZ_PD_S_SLEEP | OZ_PD_S_STOPPED)) {
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
return 0;
}
if (pd->keep_alive && pd->session_id)
@@ -383,7 +383,7 @@ int oz_pd_sleep(struct oz_pd *pd)
do_stop = 1;
 
stop_apps = pd->total_apps;
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
if (do_stop) {
oz_pd_stop(pd);
} else {
@@ -999,15 +999,15 @@ void oz_pd_indicate_farewells(struct oz_pd *pd)
const struct oz_app_if *ai = &g_app_if[OZ_APPID_USB-1];
 
while (1) {
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
if (list_empty(&pd->farewell_list)) {
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
break;
}
f = list_first_entry(&pd->farewell_list,
struct oz_farewell, link);
list_del(&f->link);
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
if (ai->farewell)
ai->farewell(pd, f->ep_num, f->report, f->len);
kfree(f);
diff --git a/drivers/staging/ozwpan/ozpd.h b/drivers/staging/ozwpan/ozpd.h
index 12c7129..56e6fdf 100644
--- a/drivers/staging/ozwpan/ozpd.h
+++ b/drivers/staging/ozwpan/ozp

[PATCH] Drivers:staging:ozwpan Replaced wrapper functions with actual spin lock function calls

2014-03-01 Thread Surendra Patil
Replaced all the spin lock/unlock wrappers from oz_polling_lock_bh()
and oz_polllin_unlock_bh() with spin_lock_bh(&g_polling_lock) and
spin_unlock_bh(&g_polling_lock).Completely erased the wrappers defination
and declaration.
Module builded successfully with sparse without warnings.

Signed-off-by: Surendra Patil 
---
 drivers/staging/ozwpan/ozpd.c| 29 +++--
 drivers/staging/ozwpan/ozproto.c |  9 -
 drivers/staging/ozwpan/ozproto.h |  2 --
 3 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index 7436950..66c3a2c 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -22,6 +22,7 @@
 
 #define OZ_MAX_TX_POOL_SIZE6
 
+static DEFINE_SPINLOCK(g_polling_lock);
 static struct oz_tx_frame *oz_tx_frame_alloc(struct oz_pd *pd);
 static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f);
 static void oz_tx_isoc_free(struct oz_pd *pd, struct oz_tx_frame *f);
@@ -284,11 +285,11 @@ int oz_services_start(struct oz_pd *pd, u16 apps, int 
resume)
  ai->app_id);
break;
}
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
pd->total_apps |= (1<app_id);
if (resume)
pd->paused_apps &= ~(1<app_id);
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
}
}
return rc;
@@ -304,14 +305,14 @@ void oz_services_stop(struct oz_pd *pd, u16 apps, int 
pause)
oz_pd_dbg(pd, ON, "%s: (0x%x) pause(%d)\n", __func__, apps, pause);
for (ai = g_app_if; ai < &g_app_if[OZ_APPID_MAX]; ai++) {
if (apps & (1<app_id)) {
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
if (pause) {
pd->paused_apps |= (1<app_id);
} else {
pd->total_apps &= ~(1<app_id);
pd->paused_apps &= ~(1<app_id);
}
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
ai->stop(pd, pause);
}
}
@@ -349,17 +350,17 @@ void oz_pd_stop(struct oz_pd *pd)
 
oz_dbg(ON, "oz_pd_stop() State = 0x%x\n", pd->state);
oz_pd_indicate_farewells(pd);
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
stop_apps = pd->total_apps;
pd->total_apps = 0;
pd->paused_apps = 0;
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
oz_services_stop(pd, stop_apps, 0);
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
oz_pd_set_state(pd, OZ_PD_S_STOPPED);
/* Remove from PD list.*/
list_del(&pd->link);
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
oz_dbg(ON, "pd ref count = %d\n", atomic_read(&pd->ref_count));
oz_pd_put(pd);
 }
@@ -372,9 +373,9 @@ int oz_pd_sleep(struct oz_pd *pd)
int do_stop = 0;
u16 stop_apps;
 
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
if (pd->state & (OZ_PD_S_SLEEP | OZ_PD_S_STOPPED)) {
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
return 0;
}
if (pd->keep_alive && pd->session_id)
@@ -383,7 +384,7 @@ int oz_pd_sleep(struct oz_pd *pd)
do_stop = 1;
 
stop_apps = pd->total_apps;
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
if (do_stop) {
oz_pd_stop(pd);
} else {
@@ -999,15 +1000,15 @@ void oz_pd_indicate_farewells(struct oz_pd *pd)
const struct oz_app_if *ai = &g_app_if[OZ_APPID_USB-1];
 
while (1) {
-   oz_polling_lock_bh();
+   spin_lock_bh(&g_polling_lock);
if (list_empty(&pd->farewell_list)) {
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
break;
}
f = list_first_entry(&pd->farewell_list,
struct oz_farewell, link);
list_del(&f->link);
-   oz_polling_unlock_bh();
+   spin_unlock_bh(&g_polling_lock);
if (ai->farewell)
ai->farewell(pd, f->ep_num, f->report, f->len);
kfree(f);
diff --git a

[PATCH] Drivers:staging:ozwpan Fixed sparse context imbalance warning

2014-02-28 Thread Surendra Patil
Sparse warns about -
drivers/staging/ozwpan/ozproto.c:797:6: warning: context imbalance in 
'oz_polling_lock_bh' - wrong count at exit
drivers/staging/ozwpan/ozproto.c:802:6: warning: context imbalance in 
'oz_polling_unlock_bh' - unexpected unlock
so added __acquires() and __releases().

Signed-off-by: Surendra Patil 
---
 drivers/staging/ozwpan/ozproto.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c
index e7138ed..b47cec1 100644
--- a/drivers/staging/ozwpan/ozproto.c
+++ b/drivers/staging/ozwpan/ozproto.c
@@ -795,11 +795,13 @@ int oz_get_pd_list(struct oz_mac_addr *addr, int 
max_count)
 }
 
 void oz_polling_lock_bh(void)
+__acquires(&g_polling_block)
 {
spin_lock_bh(&g_polling_lock);
 }
 
 void oz_polling_unlock_bh(void)
+__releases(&g_polling_block)
 {
spin_unlock_bh(&g_polling_lock);
 }
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers:staging:octeon-usb: Fixed Bitfields coding style errors

2014-01-30 Thread Surendra Patil
Fixed Below coding style errors -
octeon-hcd.h:146: ERROR: spaces prohibited around that ':' (ctx:WxW)
octeon-hcd.h:147: ERROR: spaces prohibited around that ':' (ctx:WxW)
total: 243 errors, 0 warnings, 1819 lines checked - fixed all errors

Signed-off-by: Surendra Patil 
---
 drivers/staging/octeon-usb/octeon-hcd.h | 486 
 1 file changed, 243 insertions(+), 243 deletions(-)

diff --git a/drivers/staging/octeon-usb/octeon-hcd.h 
b/drivers/staging/octeon-usb/octeon-hcd.h
index 42fe4fe..c534e317 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.h
+++ b/drivers/staging/octeon-usb/octeon-hcd.h
@@ -143,13 +143,13 @@ union cvmx_usbcx_gahbcfg {
 *  * 1'b1: Unmask the interrupt assertion to the application.
 */
struct cvmx_usbcx_gahbcfg_s {
-   uint32_t reserved_9_31  : 23;
-   uint32_t ptxfemplvl : 1;
-   uint32_t nptxfemplvl: 1;
-   uint32_t reserved_6_6   : 1;
-   uint32_t dmaen  : 1;
-   uint32_t hbstlen: 4;
-   uint32_t glblintrmsk: 1;
+   uint32_t reserved_9_31:23;
+   uint32_t ptxfemplvl:1;
+   uint32_t nptxfemplvl:1;
+   uint32_t reserved_6_6:1;
+   uint32_t dmaen:1;
+   uint32_t hbstlen:4;
+   uint32_t glblintrmsk:1;
} s;
 };
 
@@ -209,16 +209,16 @@ union cvmx_usbcx_ghwcfg3 {
 *  * Others: Reserved
 */
struct cvmx_usbcx_ghwcfg3_s {
-   uint32_t dfifodepth : 16;
-   uint32_t reserved_13_15 : 3;
-   uint32_t ahbphysync : 1;
-   uint32_t rsttype: 1;
-   uint32_t optfeature : 1;
-   uint32_t vendor_control_interface_support   : 1;
-   uint32_t i2c_selection  : 1;
-   uint32_t otgen  : 1;
-   uint32_t pktsizewidth   : 3;
-   uint32_t xfersizewidth  : 4;
+   uint32_t dfifodepth:16;
+   uint32_t reserved_13_15:3;
+   uint32_t ahbphysync:1;
+   uint32_t rsttype:1;
+   uint32_t optfeature:1;
+   uint32_t vendor_control_interface_support:1;
+   uint32_t i2c_selection:1;
+   uint32_t otgen:1;
+   uint32_t pktsizewidth:3;
+   uint32_t xfersizewidth:4;
} s;
 };
 
@@ -275,38 +275,38 @@ union cvmx_usbcx_gintmsk {
 * @modemismsk: Mode Mismatch Interrupt Mask (ModeMisMsk)
 */
struct cvmx_usbcx_gintmsk_s {
-   uint32_t wkupintmsk : 1;
-   uint32_t sessreqintmsk  : 1;
-   uint32_t disconnintmsk  : 1;
-   uint32_t conidstschngmsk: 1;
-   uint32_t reserved_27_27 : 1;
-   uint32_t ptxfempmsk : 1;
-   uint32_t hchintmsk  : 1;
-   uint32_t prtintmsk  : 1;
-   uint32_t reserved_23_23 : 1;
-   uint32_t fetsuspmsk : 1;
-   uint32_t incomplpmsk: 1;
-   uint32_t incompisoinmsk : 1;
-   uint32_t oepintmsk  : 1;
-   uint32_t inepintmsk : 1;
-   uint32_t epmismsk   : 1;
-   uint32_t reserved_16_16 : 1;
-   uint32_t eopfmsk: 1;
-   uint32_t isooutdropmsk  : 1;
-   uint32_t enumdonemsk: 1;
-   uint32_t usbrstmsk  : 1;
-   uint32_t usbsuspmsk : 1;
-   uint32_t erlysuspmsk: 1;
-   uint32_t i2cint : 1;
-   uint32_t ulpickintmsk   : 1;
-   uint32_t goutnakeffmsk  : 1;
-   uint32_t ginnakeffmsk   : 1;
-   uint32_t nptxfempmsk: 1;
-   uint32_t rxflvlmsk  : 1;
-   uint32_t sofmsk : 1;
-   uint32_t otgintmsk  : 1;
-   uint32_t modemismsk : 1;
-   uint32_t reserved_0_0   : 1;
+   uint32_t wkupintmsk:1;
+   uint32_t sessreqintmsk:1;
+   uint32_t disconnintmsk:1;
+   uint32_t conidstschngmsk:1;
+   uint32_t reserved_27_27:1;
+   uint32_t ptxfempmsk:1;
+   uint32_t hchintmsk:1;
+   uint32_t prtintmsk:1;
+   uint32_t reserved_23_23:1;
+   uint32_t fetsuspmsk:1;
+

[PATCH] Drivers:staging:octeon-usb: Fixed Few coding style errors

2014-01-30 Thread Surendra Patil
fixed below errors - only few listed
octeon-hcd.c:162: ERROR: spaces prohibited around that ':' (ctx:WxW)
cteon-hcd.c:249: ERROR: Macros with complex values should be enclosed in 
parenthesis
octeon-hcd.c:992: WARNING: braces {} are not necessary for single statement 
blocks
octeon-hcd.c:3228: ERROR: return is not a function, parentheses are not required

Signed-off-by: Surendra Patil 
---
 drivers/staging/octeon-usb/octeon-hcd.c | 31 +++
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/octeon-usb/octeon-hcd.c 
b/drivers/staging/octeon-usb/octeon-hcd.c
index 47e0a91..b25e0f8 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -159,13 +159,13 @@ enum cvmx_usb_complete {
  * status call.
  */
 struct cvmx_usb_port_status {
-   uint32_t reserved   : 25;
-   uint32_t port_enabled   : 1;
-   uint32_t port_over_current  : 1;
-   uint32_t port_powered   : 1;
-   enum cvmx_usb_speed port_speed  : 2;
-   uint32_t connected  : 1;
-   uint32_t connect_change : 1;
+   uint32_t reserved:25;
+   uint32_t port_enabled:1;
+   uint32_t port_over_current:1;
+   uint32_t port_powered:1;
+   enum cvmx_usb_speed port_speed:2;
+   uint32_t connected:1;
+   uint32_t connect_change:1;
 };
 
 /**
@@ -181,11 +181,11 @@ struct cvmx_usb_port_status {
 union cvmx_usb_control_header {
uint64_t u64;
struct {
-   uint64_t request_type   : 8;
-   uint64_t request: 8;
-   uint64_t value  : 16;
-   uint64_t index  : 16;
-   uint64_t length : 16;
+   uint64_t request_type:8;
+   uint64_t request:8;
+   uint64_t value:16;
+   uint64_t index:16;
+   uint64_t length:16;
} s;
 };
 
@@ -246,7 +246,7 @@ enum cvmx_usb_pipe_flags {
 };
 
 /* Normal prefetch that use the pref instruction. */
-#define CVMX_PREFETCH(address, offset) asm volatile ("pref %[type], 
%[off](%[rbase])" : : [rbase] "d" (address), [off] "I" (offset), [type] "n" (0))
+#define CVMX_PREFETCH(address, offset) (asm volatile ("pref %[type], 
%[off](%[rbase])" : : [rbase] "d" (address), [off] "I" (offset), [type] "n" 
(0)))
 
 /* Maximum number of times to retry failed transactions */
 #define MAX_RETRIES3
@@ -989,9 +989,8 @@ static int cvmx_usb_enable(struct cvmx_usb_state *usb)
return 0;
 
/* If there is nothing plugged into the port then fail immediately */
-   if (!usb->usbcx_hprt.s.prtconnsts) {
+   if (!usb->usbcx_hprt.s.prtconnsts)
return -ETIMEDOUT;
-   }
 
/* Program the port reset bit to start the reset process */
USB_SET_FIELD32(CVMX_USBCX_HPRT(usb->index), union cvmx_usbcx_hprt, 
prtrst, 1);
@@ -3225,7 +3224,7 @@ static int octeon_usb_hub_status_data(struct usb_hcd 
*hcd, char *buf)
buf[0] = 0;
buf[0] = port_status.connect_change << 1;
 
-   return (buf[0] != 0);
+   return buf[0] != 0;
 }
 
 static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 
wValue, u16 wIndex, char *buf, u16 wLength)
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging : comedi : comedidev.h Fixed warning space coding style issue

2014-01-20 Thread Surendra Patil
Fixed a coding style issue,removed space after the function pointer name

Signed-off-by: Surendra Patil 
---
 drivers/staging/comedi/comedidev.h | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h 
b/drivers/staging/comedi/comedidev.h
index f82bd42..588e9e7 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -61,29 +61,29 @@ struct comedi_subdevice {
 
unsigned int *chanlist; /* driver-owned chanlist (not used) */
 
-   int (*insn_read) (struct comedi_device *, struct comedi_subdevice *,
+   int (*insn_read)(struct comedi_device *, struct comedi_subdevice *,
  struct comedi_insn *, unsigned int *);
-   int (*insn_write) (struct comedi_device *, struct comedi_subdevice *,
+   int (*insn_write)(struct comedi_device *, struct comedi_subdevice *,
   struct comedi_insn *, unsigned int *);
-   int (*insn_bits) (struct comedi_device *, struct comedi_subdevice *,
+   int (*insn_bits)(struct comedi_device *, struct comedi_subdevice *,
  struct comedi_insn *, unsigned int *);
-   int (*insn_config) (struct comedi_device *, struct comedi_subdevice *,
+   int (*insn_config)(struct comedi_device *, struct comedi_subdevice *,
struct comedi_insn *, unsigned int *);
 
-   int (*do_cmd) (struct comedi_device *, struct comedi_subdevice *);
-   int (*do_cmdtest) (struct comedi_device *, struct comedi_subdevice *,
+   int (*do_cmd)(struct comedi_device *, struct comedi_subdevice *);
+   int (*do_cmdtest)(struct comedi_device *, struct comedi_subdevice *,
   struct comedi_cmd *);
-   int (*poll) (struct comedi_device *, struct comedi_subdevice *);
-   int (*cancel) (struct comedi_device *, struct comedi_subdevice *);
+   int (*poll)(struct comedi_device *, struct comedi_subdevice *);
+   int (*cancel)(struct comedi_device *, struct comedi_subdevice *);
/* int (*do_lock)(struct comedi_device *, struct comedi_subdevice *); */
/* int (*do_unlock)(struct comedi_device *, \
struct comedi_subdevice *); */
 
/* called when the buffer changes */
-   int (*buf_change) (struct comedi_device *dev,
+   int (*buf_change)(struct comedi_device *dev,
   struct comedi_subdevice *s, unsigned long new_size);
 
-   void (*munge) (struct comedi_device *dev, struct comedi_subdevice *s,
+   void (*munge)(struct comedi_device *dev, struct comedi_subdevice *s,
   void *data, unsigned int num_bytes,
   unsigned int start_chan_index);
enum dma_data_direction async_dma_dir;
@@ -146,7 +146,7 @@ struct comedi_async {
 
unsigned int cb_mask;
 
-   int (*inttrig) (struct comedi_device *dev, struct comedi_subdevice *s,
+   int (*inttrig)(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned int x);
 };
 
@@ -155,9 +155,9 @@ struct comedi_driver {
 
const char *driver_name;
struct module *module;
-   int (*attach) (struct comedi_device *, struct comedi_devconfig *);
-   void (*detach) (struct comedi_device *);
-   int (*auto_attach) (struct comedi_device *, unsigned long);
+   int (*attach)(struct comedi_device *, struct comedi_devconfig *);
+   void (*detach)(struct comedi_device *);
+   int (*auto_attach)(struct comedi_device *, unsigned long);
 
/* number of elements in board_name and board_id arrays */
unsigned int num_names;
@@ -202,8 +202,8 @@ struct comedi_device {
 
struct fasync_struct *async_queue;
 
-   int (*open) (struct comedi_device *dev);
-   void (*close) (struct comedi_device *dev);
+   int (*open)(struct comedi_device *dev);
+   void (*close)(struct comedi_device *dev);
 };
 
 static inline const void *comedi_board(const struct comedi_device *dev)
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/