[PATCH 4/9] nvme-core: code cleanup for __nvme_check_ready()

Chaitanya Kulkarni chaitanyak at nvidia.com
Thu Mar 23 15:24:09 PDT 2023


>> +     * Only allow commands on a live queue, except for 
>> connect/auth_send/
>> +     * auth_recv commands which are require to set the queue live in 
>> the
>> +     * appropriate states.
>> +     */
>> +    switch (ctrl->state) {
>> +    case NVME_CTRL_CONNECTING:
>> +        if (blk_rq_is_passthrough(rq) &&
>> +            nvme_is_fabrics(req->cmd)) {
>> +            switch (req->cmd->fabrics.fctype) {
>> +            case nvme_fabrics_type_connect:
>> +            case nvme_fabrics_type_auth_send:
>> +            case nvme_fabrics_type_auth_receive:
>>                   return true;
>> -            break;
>> -        default:
>> -            break;
>> -        case NVME_CTRL_DEAD:
>> -            return false;
>> +            default:
>> +                break;
>
> I think we can safely remove the default case here.
>
>> +            }
>>           }
>> +        break;
>> +    default:
>> +        break;
>
> While we're at it, same here.
>
>> +    case NVME_CTRL_DEAD:
>> +        return false;
>

only concern is if we should keep to avoid any stupid warnings
from some static code analyzers that I don't have ...

-ck




More information about the Linux-nvme mailing list