[PATCH 2/2] nvmet: use macro definitions for setting cmic value

Keith Busch kbusch at kernel.org
Thu Sep 23 12:46:16 PDT 2021


On Thu, Sep 23, 2021 at 05:20:21PM +0000, Chaitanya Kulkarni wrote:
> On 9/23/21 3:17 AM, Max Gurtovoy wrote:
> > This makes the code more readable.
> > 
> > Signed-off-by: Max Gurtovoy <mgurtovoy at nvidia.com>
> > ---
> >   drivers/nvme/target/admin-cmd.c | 3 ++-
> >   include/linux/nvme.h            | 1 +
> >   2 files changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
> > index 4ee9fe134697..92d81dc5906b 100644
> > --- a/drivers/nvme/target/admin-cmd.c
> > +++ b/drivers/nvme/target/admin-cmd.c
> > @@ -380,7 +380,8 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
> >   	 */
> >   
> >   	/* we support multiple ports, multiples hosts and ANA: */
> > -	id->cmic = (1 << 0) | (1 << 1) | (1 << 3);
> > +	id->cmic = NVME_CTRL_CMIC_MULTI_PORT | NVME_CTRL_CMIC_MULTI_CTRL |
> > +		NVME_CTRL_CMIC_ANA;
> >   
> >   	
> 
> So we actually had this discussion before to keep it open coded.
> 
> If I remember Keith had already sent out patch for this one...

The similiar patch I'd sent went in as 92decf118f1da. I argued symbolic
names helps browsing the code since we can tag/cscope them, so I think
this is a fine change.



More information about the Linux-nvme mailing list