Skip to content
Commit 97c93e06 authored by Tom Rix's avatar Tom Rix Committed by Wolfram Sang
Browse files

i2c: amd_mp2: handle num is 0 input for i2c_amd_xfer



clang static analyzer reports this problem

i2c-amd-mp2-plat.c:174:9: warning: Branch condition evaluates
  to a garbage value
        return err ? err : num;
               ^~~

err is not initialized, it depends on the being set in the
transfer loop which will not happen if num is 0.  Surveying
other master_xfer() implementations show all handle a 0 num.

Because returning 0 is expected, initialize err to 0.

Signed-off-by: default avatarTom Rix <trix@redhat.com>
Acked-by: default avatarElie Morisse <syniurge@gmail.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 703b3228
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment