Re: [PATCH] tpm_i2c_nuvoton: Use common error handling code in i2c_nuvoton_send()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> @@ -457,12 +455,15 @@ static int i2c_nuvoton_send(struct tpm_chip *chip, u8 *buf, size_t len)
>>  					     &priv->read_queue);
>>  	if (rc) {
>>  		dev_err(dev, "%s() timeout command duration\n", __func__);
>> -		i2c_nuvoton_ready(chip);
>> -		return rc;
>> +		goto write_ready;
>>  	}
>>  
>>  	dev_dbg(dev, "%s() -> %zd\n", __func__, len);
>>  	return len;
>> +
>> +write_ready:
>> +	i2c_nuvoton_ready(chip);
>> +	return rc;
>>  }
>>  
>>  static bool i2c_nuvoton_req_canceled(struct tpm_chip *chip, u8 status)
>> -- 
>> 2.14.2
>>
> 
> Setting the commandReady bit gives means to abort the command.
> Setting the bit is not the end goal.

Does your constructive feedback mean that there are any more implementation details
to consider besides the suggested code layout adjustment?


> Use something like err_cancel instead.

I am unsure about this suggestion. Will a simple replacement be sufficient
at the end?

Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux