staging: vt6655: refactor iwctl_giwaplist() to avoid -Wframe-larger-than warn.
authorKonrad Zapalowicz <bergo.torino@gmail.com>
Tue, 27 May 2014 15:42:25 +0000 (17:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 May 2014 21:10:46 +0000 (14:10 -0700)
commit0c4df9c9697887c32db41fe6cdff847f92bce244
tree275acbe17e08aa482196a6b04e4342d1bfa38094
parent5dda2528ef830b0cb61a43164dfbada9e658cef9
staging: vt6655: refactor iwctl_giwaplist() to avoid -Wframe-larger-than warn.

This commit refactors the iwctl_giwaplist() function so that the sparse
warning "the frame size of 1292 bytes is larger than 1024 bytes
[-Wframe-larger-than=]" is no more.

The root cause of this warning were two arrays allocated on the stack
and this commit changes this - these arrays are now kmalloc'ed. As a
result the function is refactored and hopefully stil working the same.

I were not able to test these changes so at least the carefull review
is more than welcomed.

Note that my changes has broadened the set of error codes that this
function can return. The new error code is ENOMEM. Luckily, this is
no issue.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/iwctl.c