On Thursday 05 November 2015 21:00:22 Amitoj Kaur Chawla wrote:
Make sure that the code is actually correct. You can probably avoid the warning by introducing a local variable like
bool status_ok = (fcport->stats_status == BFA_STATUS_OK); if (status_ok) timestamp = ktime_get_seconds(); ... Arnd
I just tried the introduction of the new variable and it doesn't remove the warning so I'll skip the new variable and send the patch without it, since the warning is unreliable.
Just to clarify: you have to check that local variable in both places for gcc to know that this is the same one as before.
If that doesn't work, you may have to unconditionally initialize the timestamp to zero before the check. We don't like to get those warnings even if they are unreliable. If you have to do this, please mention in the changelog that it is done to avoid a harmless warning from gcc (and which version of gcc caused it).
Arnd