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] [thread-next>] [day] [month] [year] [list]
Message-ID: <d3e53aabf39e888d8184faa2981f7837@codeaurora.org>
Date:   Fri, 08 Jan 2021 15:26:46 +0530
From:   rojay@...eaurora.org
To:     Wolfram Sang <wsa@...nel.org>
Cc:     swboyd@...omium.org, dianders@...omium.org,
        saiprakash.ranjan@...eaurora.org, gregkh@...uxfoundation.org,
        mka@...omium.org, akashast@...eaurora.org,
        msavaliy@....qualcomm.com, skakit@...eaurora.org,
        pyarlaga@...eaurora.org, rnayak@...eaurora.org, agross@...nel.org,
        bjorn.andersson@...aro.org, linux-arm-msm@...r.kernel.org,
        linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
        sumit.semwal@...aro.org, linux-media@...r.kernel.org
Subject: Re: [PATCH V7 2/2] i2c: i2c-qcom-geni: Add shutdown callback for i2c

Hi Wolfram,

On 2021-01-05 20:57, Wolfram Sang wrote:
>> +	geni_status = readl_relaxed(gi2c->se.base + SE_GENI_STATUS);
>> +	if (!(geni_status & M_GENI_CMD_ACTIVE))
>> +		goto out;
>> +
>> +	cur = gi2c->cur;
>> +	geni_i2c_abort_xfer(gi2c);
>> +	if (cur->flags & I2C_M_RD)
>> +		geni_i2c_rx_msg_cleanup(gi2c, cur);
>> +	else
>> +		geni_i2c_tx_msg_cleanup(gi2c, cur);
>> +out:
>> +	pm_runtime_put_sync_suspend(gi2c->se.dev);
>> +}
> 
> The use of 'goto' is not needed here IMHO. I think:
> 
> 	if (geni_status & M_GENI_CMD_ACTIVE) {
> 		do_the_stuff
> 	}
> 
> 	pm_runtime_put_sync_suspend(...);
> 
> is more readable, in fact.
> 

In context to the previous comment [1], I have implemented this way.
But, yeah anything is fine for me.

> Also, I don't think we really need the 'cur'
> variable and just use 'gi2c->cur' but that's very minor and you can 
> keep
> it if you like it.
> 

In geni_i2c_abort_xfer() function gi2c->cur will be made NULL, so 
copying it before to "cur" is needed here.

> Reset looks good!

[1] 
https://patchwork.kernel.org/project/linux-arm-msm/patch/20200820103522.26242-3-rojay@codeaurora.org/#23560541

Thanks,
Roja

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ