lkml.org 
[lkml]   [2014]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] staging: rtl8192u: r8192U_core.c: Cleaning up uninitialized variables
From
Hi Dan!


Now this is a bad example because there is nothing really wrong, and I
could not find the original error log :-(


But i get for the testing variable:
drivers/staging/rtl8192u/r8192U_core.c : 4747] : (style) Variable
'testing' is assigned a value that is never used.


And for the this file i now get:

drivers/staging/rtl8192u/r8192U_core.c : 1014] : (style) Variable
'ret' is assigned a value that is never used.
drivers/staging/rtl8192u/r8192U_core.c : 1258] : (error) Possible
null pointer dereference : dev
drivers/staging/rtl8192u/r8192U_core.c : 1411] : (style) Variable
'rate_config' is assigned a value that is never used.
drivers/staging/rtl8192u/r8192U_core.c : 1908] : (portability)
'oldaddr' is of type 'void *'. When using void pointers in
calculations, the behaviour is undefined.
drivers/staging/rtl8192u/r8192U_core.c : 1959] : (style) Unused variable : i
drivers/staging/rtl8192u/r8192U_core.c : 2040] ->
[drivers/staging/rtl8192u/r8192U.h : 1129] : (style, inconclusive)
The struct 'r8192_priv' hides a typedef with the same name.
drivers/staging/rtl8192u/r8192U_core.c : 2041] ->
[drivers/staging/rtl8192u/r8192U_core.c : 2048] : (warning) Possible
null pointer dereference : priv - otherwise it is redundant to check
it against null.




But why not test yourself, see:


http://cppcheck.sourceforge.net/


Appropriate arguments to start with are:
cppcheck --force --quiet --enable=all drivers/staging/rtl8192u/r8192U_core.c


Best regards
Rickard Strandqvist


2014-06-02 9:39 GMT+02:00 Dan Carpenter <dan.carpenter@oracle.com>:
> On Sun, Jun 01, 2014 at 11:05:39PM +0200, Rickard Strandqvist wrote:
>> Hi Dan
>>
>> I agree, this looks strange.
>> Have been looking for a while in history with, to see if the code has
>> been removed. I start my search using cppcheck for over three months
>> ago.
>> But could not find anything. Sorry about that :-(
>>
>> But I'll make a patch that completely removes testing variable then instead?
>
> Yes. Btw, what do the cppcheck error messages for this look like
> anyway?
>
> regards,
> dan carpenter
>


\
 
 \ /
  Last update: 2014-06-02 23:01    [W:0.051 / U:2.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site