[PATCH 2/3] nvme: refactor command completion

Sagi Grimberg sagi at grimberg.me
Mon Aug 17 03:45:10 EDT 2020


> [fullquote deleted, sigh..]
> 
>> Would be better to reuse nvme_is_ana_error I think so we
>> don't need to maintain ana status codes in both places:
>>
>> static inline bool nvme_is_path_error(u16 status)
>> {
>> 	if (nvme_is_ana_error(status))
>> 		return true;
>> 	switch (status & 0x7ff) {
>> 	case NVME_SC_HOST_PATH_ERROR:
>> 	case NVME_SC_HOST_ABORTED_CMD:
>> 		return true;
>> 	default:
>> 		return false;
>> 	}
>> }
> 
> I initially had:
> 
> static inline bool nvme_is_path_error(u16 status)
> {
> 	switch (status & 0x7ff) {
> 	case NVME_SC_HOST_PATH_ERROR:
> 	case NVME_SC_HOST_ABORTED_CMD:
> 		return true;
> 	default:
> 		return nvme_is_ana_error(status);
> 	}
> }
> 
> but found that a little weird, but I can go back to it.

Seems better to me.



More information about the Linux-nvme mailing list