From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH] scsi: virtio_scsi: Use struct_size() helper Date: Fri, 12 Jul 2019 10:14:23 -0400 Message-ID: <20190712101408-mutt-send-email-mst@kernel.org> References: <20190619192833.GA825@embeddedor> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: "Martin K. Petersen" Cc: "Gustavo A. R. Silva" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , "James E.J. Bottomley" , virtualization@lists.linux-foundation.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-scsi@vger.kernel.org On Thu, Jul 11, 2019 at 08:18:54PM -0400, Martin K. Petersen wrote: > > 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: > > Applied to 5.4/scsi-queue, thanks! Oh I put it in the virtio tree already. Can't hurt I guess :) > -- > Martin K. Petersen Oracle Linux Engineering