* [PATCH 1/2] staging: wilc1000: linux_wlan_spi: correct types
@ 2015-10-08 18:23 Stanislav Kholmanskikh
2015-10-08 18:23 ` [PATCH 2/2] staging: wilc1000: linux_wlan_spi: include header Stanislav Kholmanskikh
0 siblings, 1 reply; 2+ messages in thread
From: Stanislav Kholmanskikh @ 2015-10-08 18:23 UTC (permalink / raw)
To: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim, gregkh
Cc: linux-wireless, devel, linux-kernel, Stanislav Kholmanskikh
linux_spi_write(), linux_spi_read(), linux_spi_write_read():
nwi->io_func.u.spi.spi_tx = linux_spi_write;
nwi->io_func.u.spi.spi_rx = linux_spi_read;
nwi->io_func.u.spi.spi_trx = linux_spi_write_read;
are expected to accept arguments of 'u8 *', u32 types:
struct {
int (*spi_max_speed)(void);
int (*spi_tx)(u8 *, u32);
int (*spi_rx)(u8 *, u32);
int (*spi_trx)(u8 *, u8 *, u32);
} spi;
However, linux_spi_read() and linux_spi_write_read() do not do this,
they use 'unsigned char *' and 'unsigned long' instead.
Changed the types of their arguments to satisfy the expectations.
Signed-off-by: Stanislav Kholmanskikh <kholmanskikh.s.s@gmail.com>
---
drivers/staging/wilc1000/linux_wlan_spi.c | 12 ++++++------
drivers/staging/wilc1000/linux_wlan_spi.h | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c
index 51bbd96..c6c1f6e 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.c
+++ b/drivers/staging/wilc1000/linux_wlan_spi.c
@@ -243,7 +243,7 @@ int linux_spi_write(u8 *b, u32 len)
#if defined(TXRX_PHASE_SIZE)
-int linux_spi_read(unsigned char *rb, unsigned long rlen)
+int linux_spi_read(u8 *rb, u32 rlen)
{
int ret;
@@ -307,7 +307,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
kfree(t_buffer);
} else {
- PRINT_ER("can't read data with the following length: %ld\n", rlen);
+ PRINT_ER("can't read data with the following length: %u\n", rlen);
ret = -1;
}
/* change return value to match WILC interface */
@@ -317,7 +317,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
}
#else
-int linux_spi_read(unsigned char *rb, unsigned long rlen)
+int linux_spi_read(u8 *rb, u32 rlen)
{
int ret;
@@ -351,7 +351,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
}
kfree(t_buffer);
} else {
- PRINT_ER("can't read data with the following length: %ld\n", rlen);
+ PRINT_ER("can't read data with the following length: %u\n", rlen);
ret = -1;
}
/* change return value to match WILC interface */
@@ -362,7 +362,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
#endif
-int linux_spi_write_read(unsigned char *wb, unsigned char *rb, unsigned int rlen)
+int linux_spi_write_read(u8 *wb, u8 *rb, u32 rlen)
{
int ret;
@@ -390,7 +390,7 @@ int linux_spi_write_read(unsigned char *wb, unsigned char *rb, unsigned int rlen
PRINT_ER("SPI transaction failed\n");
}
} else {
- PRINT_ER("can't read data with the following length: %d\n", rlen);
+ PRINT_ER("can't read data with the following length: %u\n", rlen);
ret = -1;
}
/* change return value to match WILC interface */
diff --git a/drivers/staging/wilc1000/linux_wlan_spi.h b/drivers/staging/wilc1000/linux_wlan_spi.h
index d8eed0f..7356785 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.h
+++ b/drivers/staging/wilc1000/linux_wlan_spi.h
@@ -9,6 +9,6 @@ int linux_spi_init(void *vp);
void linux_spi_deinit(void *vp);
int linux_spi_write(u8 *b, u32 len);
int linux_spi_read(u8 *rb, u32 rlen);
-int linux_spi_write_read(unsigned char *wb, unsigned char *rb, unsigned int rlen);
+int linux_spi_write_read(u8 *wb, u8 *rb, u32 rlen);
int linux_spi_set_max_speed(void);
#endif
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH 2/2] staging: wilc1000: linux_wlan_spi: include header
2015-10-08 18:23 [PATCH 1/2] staging: wilc1000: linux_wlan_spi: correct types Stanislav Kholmanskikh
@ 2015-10-08 18:23 ` Stanislav Kholmanskikh
0 siblings, 0 replies; 2+ messages in thread
From: Stanislav Kholmanskikh @ 2015-10-08 18:23 UTC (permalink / raw)
To: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim, gregkh
Cc: linux-wireless, devel, linux-kernel, Stanislav Kholmanskikh
A check using 'sparse' shows warnings in linux_wlan_spi.c:
drivers/staging/wilc1000/linux_wlan_spi.c:43:19: warning: symbol 'wilc_spi_dev' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:71:19: warning: symbol 'wilc_bus' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:95:5: warning: symbol 'linux_spi_init' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:195:5: warning: symbol 'linux_spi_write' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:320:5: warning: symbol 'linux_spi_read' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:365:5: warning: symbol 'linux_spi_write_read' was not declared. Should it be static?
drivers/staging/wilc1000/linux_wlan_spi.c:402:5: warning: symbol 'linux_spi_set_max_speed' was not declared. Should it be static?
Let's avoid it by including "linux_wlan_spi.h" header.
Signed-off-by: Stanislav Kholmanskikh <kholmanskikh.s.s@gmail.com>
---
drivers/staging/wilc1000/linux_wlan_spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c
index c6c1f6e..760b72a 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.c
+++ b/drivers/staging/wilc1000/linux_wlan_spi.c
@@ -10,6 +10,7 @@
#include <linux/spi/spi.h>
#include "linux_wlan_common.h"
+#include "linux_wlan_spi.h"
#define USE_SPI_DMA 0 /* johnny add */
@@ -40,7 +41,6 @@
static u32 SPEED = MIN_SPEED;
-struct spi_device *wilc_spi_dev;
void linux_spi_deinit(void *vp);
static int __init wilc_bus_probe(struct spi_device *spi)
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-08 18:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-08 18:23 [PATCH 1/2] staging: wilc1000: linux_wlan_spi: correct types Stanislav Kholmanskikh
2015-10-08 18:23 ` [PATCH 2/2] staging: wilc1000: linux_wlan_spi: include header Stanislav Kholmanskikh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®