lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZvV1nqnbJMfTpgwI@kuha.fi.intel.com>
Date: Thu, 26 Sep 2024 17:54:22 +0300
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Markus Elfring <Markus.Elfring@....de>
Cc: linux-usb@...r.kernel.org, Ajay Gupta <ajayg@...dia.com>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Haotien Hsu <haotienh@...dia.com>,
	Utkarsh Patel <utkarsh.h.patel@...el.com>,
	Uwe Kleine-König <u.kleine-koenig@...libre.com>,
	Wolfram Sang <wsa@...-dreams.de>,
	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 2/2] usb: typec: ucsi: ccg: Use common code in ccg_read()

On Wed, Sep 25, 2024 at 07:33:47PM +0200, Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Wed, 25 Sep 2024 19:08:07 +0200
> 
> Add a label so that two statements can be better reused at the end of
> this function implementation.
> 
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>

Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>

> ---
>  drivers/usb/typec/ucsi/ucsi_ccg.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index ed075a403d87..e3850c42583e 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -269,15 +269,16 @@ static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 len)
>  		status = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
>  		if (status < 0) {
>  			dev_err(uc->dev, "i2c_transfer failed %d\n", status);
> -			pm_runtime_put_sync(uc->dev);
> -			return status;
> +			goto put_sync;
>  		}
>  		rab += rlen;
>  		rem_len -= rlen;
>  	}
> 
> +	status = 0;
> +put_sync:
>  	pm_runtime_put_sync(uc->dev);
> -	return 0;
> +	return status;
>  }
> 
>  static int ccg_write(struct ucsi_ccg *uc, u16 rab, const u8 *data, u32 len)
> --
> 2.46.1

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ