diff options
author | Paul Bolle <pebolle@tiscali.nl> | 2014-01-04 02:44:19 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-09 03:20:20 +0400 |
commit | aa98a28563d2abcd904d07fd5e54553290c85f91 (patch) | |
tree | e8df39fe22fd43abf2eb54647b1bccee9fa186a0 /Documentation/misc-devices | |
parent | d276b6c54d47a427e4cffd7c84f3b631a1edf98e (diff) | |
download | linux-aa98a28563d2abcd904d07fd5e54553290c85f91.tar.xz |
Documentation/misc-devices/mei/mei-amt-version.c: remove unneeded call of mei_deinit()
Building mei-amt-version.o triggers a GCC warning:
Documentation/misc-devices/mei/mei-amt-version.c: In function 'main':
Documentation/misc-devices/mei/mei-amt-version.c:103:5: warning: 'acmd.fd' is used uninitialized in this function [-Wuninitialized]
if (cl->fd != -1)
^
Documentation/misc-devices/mei/mei-amt-version.c:443:21: note: 'acmd.fd' was declared here
struct amt_host_if acmd;
^
GCC is correct. See, the call chain that GCC detects must be
main()
amt_host_if_init()
mei_init()
mei_deinit()
But when we enter mei_deinit() struct amt_host_if acmd is still
unitialized. That makes the test for (effectively) amt_host_if->mei_cl->fd
bogus.
But it turns out that call of mei_deinit() isn't needed at all. All of
the members of mei_cl will be set later in mei_init() and none will be
used before they are set. So we can simply drop this call of
mei_deinit().
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Cc: Tomas Winkler <tomas.winkler@intel.com>
Reported-by: David Howells <dhowells@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/misc-devices')
-rw-r--r-- | Documentation/misc-devices/mei/mei-amt-version.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/Documentation/misc-devices/mei/mei-amt-version.c b/Documentation/misc-devices/mei/mei-amt-version.c index 49e4f770864a..57d0d871dcf7 100644 --- a/Documentation/misc-devices/mei/mei-amt-version.c +++ b/Documentation/misc-devices/mei/mei-amt-version.c @@ -115,8 +115,6 @@ static bool mei_init(struct mei *me, const uuid_le *guid, struct mei_client *cl; struct mei_connect_client_data data; - mei_deinit(me); - me->verbose = verbose; me->fd = open("/dev/mei", O_RDWR); |