diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-05-16 09:37:32 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-16 16:08:00 -0700 |
commit | e7b7691f52547eeabbdab70b00e337a7c38acb1f (patch) | |
tree | a91f360fde59e7e13b6782742fc5c4f51cf2947d /drivers/staging/wlags49_h2 | |
parent | 167bf09e2e032fab0ae6fe2dee200cc33a8c4231 (diff) | |
download | linux-e7b7691f52547eeabbdab70b00e337a7c38acb1f.tar.gz linux-e7b7691f52547eeabbdab70b00e337a7c38acb1f.tar.bz2 linux-e7b7691f52547eeabbdab70b00e337a7c38acb1f.zip |
staging: wlags49_h2: fix up "205179d staging: wlags49_h2: strncpy, need checking the memory length" for avoiding warnings
Type of 'probe_rsp->rawData[1]' is 'hcf_8' which is 'u8', it will
compare with 'int', so use min_t() to cast to 'u8' to avoid related
warning.
If use min(), it has '(void) (&_min1 == &_min2);', so if no type cast,
the compiler will report 'pointer types lacks a cast':
drivers/staging/wlags49_h2/wl_main.c:3174:122: warning: comparison of distinct pointer types lacks a cast [enabled by default]
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlags49_h2')
-rw-r--r-- | drivers/staging/wlags49_h2/wl_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/wlags49_h2/wl_main.c b/drivers/staging/wlags49_h2/wl_main.c index 35d617d0792d..43535610acc4 100644 --- a/drivers/staging/wlags49_h2/wl_main.c +++ b/drivers/staging/wlags49_h2/wl_main.c @@ -3171,7 +3171,8 @@ void wl_process_mailbox( struct wl_private *lp ) memset( ssid, 0, sizeof( ssid )); strncpy( ssid, &probe_rsp->rawData[2], - min(probe_rsp->rawData[1], + min_t(u8, + probe_rsp->rawData[1], HCF_MAX_NAME_LEN - 1)); DBG_TRACE( DbgInfo, "(%s) SSID : %s\n", |