]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit766417c97fc219ac2770caf5a390539bb814885b
tree275acbe17e08aa482196a6b04e4342d1bfa38094
parent2df5c212c339f7935c88bd9f70c3866cf04f23cd
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