I just fixed the coding style errors like return(xxx); to return xxx;.
Signed-off-by: Sangho Yi <[email protected]>
---
drivers/staging/csr/io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/csr/io.c b/drivers/staging/csr/io.c
index e85fe94..ae069f0 100644
--- a/drivers/staging/csr/io.c
+++ b/drivers/staging/csr/io.c
@@ -956,7 +956,7 @@ uf_read_proc(char *page, char **start, off_t offset, int count,
if (offset >= written) {
*eof = 1;
kfree(orig_p);
- return(0);
+ return 0;
}
if (offset + count > written) {
@@ -970,7 +970,7 @@ uf_read_proc(char *page, char **start, off_t offset, int count,
kfree(orig_p);
- return(actual_amount_to_copy);
+ return actual_amount_to_copy;
} /* uf_read_proc() */
#endif
--
1.7.9.5
Fixed a coding style error like array = {{...., ...}}; to ...} };
Signed-off-by: Sangho Yi <[email protected]>
---
drivers/staging/csr/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/csr/io.c b/drivers/staging/csr/io.c
index ae069f0..b7087c7 100644
--- a/drivers/staging/csr/io.c
+++ b/drivers/staging/csr/io.c
@@ -516,7 +516,7 @@ cleanup_unifi_sdio(unifi_priv_t *priv)
int priv_instance;
int i;
static const CsrWifiMacAddress broadcast_address = {{0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}};
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} };
func_enter();
--
1.7.9.5
I made correction on the definition of a macro using parenthesis.
Signed-off-by: Sangho Yi <[email protected]>
---
drivers/staging/csr/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/csr/io.c b/drivers/staging/csr/io.c
index f910aea..74c891a 100644
--- a/drivers/staging/csr/io.c
+++ b/drivers/staging/csr/io.c
@@ -878,7 +878,7 @@ static int
uf_read_proc(char *page, char **start, off_t offset, int count,
int *eof, void *data)
{
-#define UNIFI_DEBUG_TXT_BUFFER 8*1024
+#define UNIFI_DEBUG_TXT_BUFFER (8*1024)
unifi_priv_t *priv;
int actual_amount_to_copy;
char *p, *orig_p;
--
1.7.9.5
Removed braces {} from single line for and if, and else statements.
Signed-off-by: Sangho Yi <[email protected]>
---
drivers/staging/csr/io.c | 54 ++++++++++++++++------------------------------
1 file changed, 18 insertions(+), 36 deletions(-)
diff --git a/drivers/staging/csr/io.c b/drivers/staging/csr/io.c
index 74c891a..d32a525 100644
--- a/drivers/staging/csr/io.c
+++ b/drivers/staging/csr/io.c
@@ -319,15 +319,13 @@ register_unifi_sdio(CsrSdioFunction *sdio_dev, int bus_id, struct device *dev)
/* Initialise the mini-coredump capture buffers */
csrResult = unifi_coredump_init(priv->card, (u16)coredump_max);
- if (csrResult != CSR_RESULT_SUCCESS) {
+ if (csrResult != CSR_RESULT_SUCCESS)
unifi_error(priv, "Couldn't allocate mini-coredump buffers\n");
- }
/* Create the character device nodes */
r = uf_create_device_nodes(priv, bus_id);
- if (r) {
+ if (r)
goto failed1;
- }
/*
* We use the slot number as unifi device index.
@@ -339,9 +337,8 @@ register_unifi_sdio(CsrSdioFunction *sdio_dev, int bus_id, struct device *dev)
* "cast to/from pointer from/to integer of different size"
*/
if (!create_proc_read_entry(priv->proc_entry_name, 0, 0,
- uf_read_proc, (void *)(long)priv->instance)) {
+ uf_read_proc, (void *)(long)priv->instance))
unifi_error(priv, "unifi: can't create /proc/driver/unifi\n");
- }
/* Allocate the net_device for interfaces other than 0. */
{
@@ -396,9 +393,8 @@ register_unifi_sdio(CsrSdioFunction *sdio_dev, int bus_id, struct device *dev)
#endif
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
- if (log_hip_signals) {
+ if (log_hip_signals)
uf_register_hip_offline_debug(priv);
- }
#endif
/* Initialise the SME related threads and parameters */
@@ -414,10 +410,9 @@ register_unifi_sdio(CsrSdioFunction *sdio_dev, int bus_id, struct device *dev)
*/
unifi_trace(priv, UDBG1, "run UniFi helper app...\n");
r = uf_run_unifihelper(priv);
- if (r) {
+ if (r)
unifi_notice(priv, "unable to run UniFi helper app\n");
/* Not a fatal error. */
- }
up(&Unifi_instance_mutex);
@@ -426,9 +421,8 @@ register_unifi_sdio(CsrSdioFunction *sdio_dev, int bus_id, struct device *dev)
failed4:
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
-if (log_hip_signals) {
+if (log_hip_signals)
uf_unregister_hip_offline_debug(priv);
-}
#endif
#ifdef CSR_WIFI_RX_PATH_SPLIT
flush_workqueue(priv->rx_workqueue);
@@ -448,9 +442,8 @@ failed0:
unifi_coredump_free(priv->card);
unifi_free_card(priv->card);
}
- if (priv) {
+ if (priv)
uf_free_netdevice(priv);
- }
up(&Unifi_instance_mutex);
@@ -552,9 +545,8 @@ cleanup_unifi_sdio(unifi_priv_t *priv)
#endif
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
- if (log_hip_signals) {
+ if (log_hip_signals)
uf_unregister_hip_offline_debug(priv);
- }
#endif
/* Free any packets left in the Rx queues */
@@ -721,9 +713,8 @@ unregister_unifi_sdio(int bus_id)
unifi_priv_t *
uf_find_instance(int inst)
{
- if ((inst < 0) || (inst >= MAX_UNIFI_DEVS)) {
+ if ((inst < 0) || (inst >= MAX_UNIFI_DEVS))
return NULL;
- }
return Unifi_instances[inst];
} /* uf_find_instance() */
@@ -746,15 +737,12 @@ uf_find_priv(unifi_priv_t *priv)
{
int inst;
- if (!priv) {
+ if (!priv)
return -1;
- }
- for (inst = 0; inst < MAX_UNIFI_DEVS; inst++) {
- if (Unifi_instances[inst] == priv) {
+ for (inst = 0; inst < MAX_UNIFI_DEVS; inst++)
+ if (Unifi_instances[inst] == priv)
return inst;
- }
- }
return -1;
} /* uf_find_priv() */
@@ -777,16 +765,13 @@ uf_find_netdev_priv(netInterface_priv_t *priv)
{
int inst;
- if (!priv) {
+ if (!priv)
return -1;
- }
for (inst = 0; inst < MAX_UNIFI_DEVS * CSR_WIFI_NUM_INTERFACES;
- inst++) {
- if (Unifi_netdev_instances[inst] == priv) {
+ inst++)
+ if (Unifi_netdev_instances[inst] == priv)
return inst;
- }
- }
return -1;
} /* uf_find_netdev_priv() */
@@ -813,9 +798,8 @@ uf_get_instance(int inst)
down(&Unifi_instance_mutex);
priv = uf_find_instance(inst);
- if (priv) {
+ if (priv)
priv->ref_count++;
- }
up(&Unifi_instance_mutex);
@@ -846,9 +830,8 @@ uf_put_instance(int inst)
priv = uf_find_instance(inst);
if (priv) {
priv->ref_count--;
- if (priv->ref_count == 0) {
+ if (priv->ref_count == 0)
ask_unifi_sdio_cleanup(priv);
- }
}
up(&Unifi_instance_mutex);
@@ -892,9 +875,8 @@ uf_read_proc(char *page, char **start, off_t offset, int count,
* "cast to/from pointer from/to integer of different size"
*/
priv = uf_find_instance((int)(long)data);
- if (!priv) {
+ if (!priv)
return 0;
- }
p = kmalloc(UNIFI_DEBUG_TXT_BUFFER, GFP_KERNEL);
--
1.7.9.5
Yes, just removing one trailing whitespace, that's all.
Signed-off-by: Sangho Yi <[email protected]>
---
drivers/staging/csr/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/csr/io.c b/drivers/staging/csr/io.c
index b7087c7..f910aea 100644
--- a/drivers/staging/csr/io.c
+++ b/drivers/staging/csr/io.c
@@ -781,7 +781,7 @@ uf_find_netdev_priv(netInterface_priv_t *priv)
return -1;
}
- for (inst = 0; inst < MAX_UNIFI_DEVS * CSR_WIFI_NUM_INTERFACES;
+ for (inst = 0; inst < MAX_UNIFI_DEVS * CSR_WIFI_NUM_INTERFACES;
inst++) {
if (Unifi_netdev_instances[inst] == priv) {
return inst;
--
1.7.9.5