From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Sang-Heon Jeon <ekffu200098@gmail.com>
Cc: Julia.Lawall@inria.fr,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
cocci@inria.fr, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: Re: [PATCH 33/36] usb: typec: fusb302: remove conditional return with no effect
Date: Mon, 27 Jul 2026 15:35:07 +0200 [thread overview]
Message-ID: <amdei6iyJ_N3l8Vs@black.igk.intel.com> (raw)
In-Reply-To: <20260723184538.3888637-34-ekffu200098@gmail.com>
On Fri, Jul 24, 2026 at 03:45:35AM +0900, Sang-Heon Jeon wrote:
> Both branches of the check return the same value, so the check has
> no effect. Remove it and return the value directly.
>
> This is the result of running the Coccinelle script from
> scripts/coccinelle/misc/cond_return_no_effect.cocci.
>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/tcpm/fusb302.c | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
> index 3319f6a2b0c9..d0ab247b24bf 100644
> --- a/drivers/usb/typec/tcpm/fusb302.c
> +++ b/drivers/usb/typec/tcpm/fusb302.c
> @@ -314,11 +314,7 @@ static int fusb302_i2c_mask_write(struct fusb302_chip *chip, u8 address,
> return ret;
> data &= ~mask;
> data |= value;
> - ret = fusb302_i2c_write(chip, address, data);
> - if (ret < 0)
> - return ret;
> -
> - return ret;
> + return fusb302_i2c_write(chip, address, data);
> }
>
> static int fusb302_i2c_set_bits(struct fusb302_chip *chip, u8 address,
> @@ -375,12 +371,8 @@ static int fusb302_init_interrupt(struct fusb302_chip *chip)
> ret = fusb302_i2c_write(chip, FUSB_REG_MASKB, 0xFF);
> if (ret < 0)
> return ret;
> - ret = fusb302_i2c_clear_bits(chip, FUSB_REG_CONTROL0,
> - FUSB_REG_CONTROL0_INT_MASK);
> - if (ret < 0)
> - return ret;
> -
> - return ret;
> + return fusb302_i2c_clear_bits(chip, FUSB_REG_CONTROL0,
> + FUSB_REG_CONTROL0_INT_MASK);
> }
>
> static int fusb302_set_power_mode(struct fusb302_chip *chip, u8 power_mode)
> --
> 2.43.0
--
heikki
next prev parent reply other threads:[~2026-07-27 13:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 18:45 [PATCH 00/36] treewide: remove conditional returns with no effect Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 32/36] USB: serial: ch341: remove conditional return " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 33/36] usb: typec: fusb302: " Sang-Heon Jeon
2026-07-27 13:35 ` Heikki Krogerus [this message]
2026-07-24 21:48 ` [PATCH 00/36] treewide: remove conditional returns " Jakub Kicinski
2026-07-27 8:30 ` Jani Nikula
2026-07-27 11:08 ` Sang-Heon Jeon
2026-07-27 11:36 ` Jani Nikula
2026-07-24 23:35 ` (subset) " Sebastian Reichel
2026-07-27 12:12 ` Mark Brown
2026-07-27 12:59 ` Sang-Heon Jeon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=amdei6iyJ_N3l8Vs@black.igk.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=Julia.Lawall@inria.fr \
--cc=cocci@inria.fr \
--cc=ekffu200098@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox