lkml.org 
[lkml]   [2013]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers: staging: ft1000: ft1000-usb: initialize 'status' with STATUS_SUCCESS in request_code_segment()
On Wed, Nov 27, 2013 at 11:01:18AM +0800, Chen Gang wrote:
> If "!bool_case", it returns unexpected value instead of STATUS_SUCCESS,
> so need fix it, the related warning (with allmodconfig under hexagon):
>
> CC [M] drivers/staging/ft1000/ft1000-usb/ft1000_download.o
> drivers/staging/ft1000/ft1000-usb/ft1000_download.c: In function 'request_code_segment':
> drivers/staging/ft1000/ft1000-usb/ft1000_download.c:581:6: warning: 'status' may be used uninitialized in this function [-Wuninitialized]
>
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>

Reviewed-by: Josh Triplett <josh@joshtriplett.org>

> .../staging/ft1000/ft1000-usb/ft1000_download.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
> index 68ded17..15f3062 100644
> --- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
> +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
> @@ -578,7 +578,7 @@ static int request_code_segment(struct ft1000_usb *ft1000dev, u16 **s_file,
> u8 **c_file, const u8 *endpoint, bool boot_case)
> {
> long word_length;
> - int status;
> + int status = STATUS_SUCCESS;
>
> /*DEBUG("FT1000:REQUEST_CODE_SEGMENT\n");i*/
> word_length = get_request_value(ft1000dev);
> --
> 1.7.7.6


\
 
 \ /
  Last update: 2013-11-27 10:41    [W:0.332 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site