[PATCH 5/9] nvme-core: use normal pattern

Chaitanya Kulkarni chaitanyak at nvidia.com
Thu Mar 23 15:01:19 PDT 2023


On 3/23/23 10:50, Keith Busch wrote:
> On Wed, Mar 22, 2023 at 08:36:32PM -0700, Chaitanya Kulkarni wrote:
>> Although return is allowed in the switch ... case when function is
>> returing void, it creates confusion for future code which is desirable
>> pattern to use for switch ... case. Repalce return in the switch with
>> break that is standard pattern for the switch ... case.
> The previous patch replaced 'break' with 'return', and this one does the
> opposite. What's special about a void return that makes this a standard
> pattern?

Regarding previous patch :
In switch case if we are not returning any value then it looks
odd to use return, can we please should avoid such pattern and
use break ?

Regarding his patch :
we are returning the value so I kept the original code, I can
add break everywhere in this patch if needed, please let
me know..

-ck




More information about the Linux-nvme mailing list