Messages in this thread |  | | Date | Sat, 23 Oct 2021 15:14:38 -0500 | From | "Gustavo A. R. Silva" <> | Subject | Re: [PATCH] nvmet: prefer struct_size over open coded arithmetic |
| |
On Sat, Oct 23, 2021 at 01:28:38PM +0200, Len Baker wrote: > Hi Gustavo, > > first of all, thanks for this review (and all others reviews as > well) ;)
No problem. :)
> I think that it is better to use the dynamic allocation since in the > future the struct size could be dynamic.
Yep; that seems sensible.
> it's not one single element. The "sizeof(struct nvme_ana_group_desc)" is > multiplied by "ctrl->nanagrpid" and then added "ctrl->max_namespaces * sizeof(__le32)".
You're right. The whole expression got me a bit confused.
> > drivers/nvme/target/admin-cmd.c:267: return sizeof(struct nvme_ana_group_desc) + count * sizeof(__le32); > > Ok. I forgot it. Apologies.
No apologies. Thanks for your patches.
> Again, thanks for your time and advises,
Anytime.
Thanks -- Gustavo
|  |