useless variable initializations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there any policy about useless variable intializations, such as:

struct foo *x = NULL;
...
x = kmalloc(...);

where the original value of x is never used?


Another example is (fs/nfs/client.c):

struct rpc_clnt *clnt = NULL;
...
clnt = rpc_create(&args);

This could actually be slightly misleading, because rpc_create returns 
either a valid pointer or a value created with ERR_PTR, never NULL, so 
NULL is not really in the set of reasonable values for clnt.

julia

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux