sfc: Work around bogus 'uninitialised variable' warning
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 31 May 2012 23:56:22 +0000 (00:56 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Tue, 17 Jul 2012 15:12:29 +0000 (16:12 +0100)
With some gcc versions & optimisations, the compiler will warn that
'depth' in efx_filter_insert_filter() may be used without being
initialised, although this is not the case.

This is related to inlining of efx_filter_search(), which only has
one caller since commit 8db182f4a8a6e2dcb8b65905ea4af56210e65430
('sfc: Remove now-unused filter function').

Shut the compiler up by initialising it to 0.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/filter.c

index fea7f73..c3fd61f 100644 (file)
@@ -662,7 +662,7 @@ s32 efx_filter_insert_filter(struct efx_nic *efx, struct efx_filter_spec *spec,
        struct efx_filter_table *table = efx_filter_spec_table(state, spec);
        struct efx_filter_spec *saved_spec;
        efx_oword_t filter;
-       unsigned int filter_idx, depth;
+       unsigned int filter_idx, depth = 0;
        u32 key;
        int rc;