OSDN Git Service

usb: typec: silence a static checker warning
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 14 Apr 2021 07:44:40 +0000 (10:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 13:15:40 +0000 (15:15 +0200)
commit434438d8f9d3f2bc8f404b937f87a70da3fbc7fb
tree0a937e70c1caa4740fb13a79a776892aeb22197c
parent401411bbc4e62bcbcc020c2c458ecb90843140a8
usb: typec: silence a static checker warning

Smatch complains about a potential missing error code:

    drivers/usb/typec/port-mapper.c:168 typec_link_port()
    warn: missing error code 'ret'

This is a false positive and returning zero is intentional.  Let's
re-arrange the code to silence the warning and make the intent more
clear.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YHadaACH8Mq/10F7@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/port-mapper.c