[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <yq1h88mwax7.fsf@oracle.com>
Date: Tue, 18 Jun 2019 22:45:08 -0400
From: "Martin K. Petersen" <martin.petersen@...cle.com>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc: Kashyap Desai <kashyap.desai@...adcom.com>,
Sumit Saxena <sumit.saxena@...adcom.com>,
Shivasharan S <shivasharan.srikanteshwara@...adcom.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
megaraidlinux.pdl@...adcom.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: megaraid_sas: Use struct_size() helper
Gustavo,
> One of the more common cases of allocation size calculations is finding
> the size of a structure that has a zero-sized array at the end, along
> with memory for some number of elements for that array. For example:
>
> struct MR_PD_CFG_SEQ_NUM_SYNC {
> ...
> struct MR_PD_CFG_SEQ seq[1];
> } __packed;
>
> Make use of the struct_size() helper instead of an open-coded version
> in order to avoid any potential type mistakes.
Applied to 5.3/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
Powered by blists - more mailing lists