From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin K. Petersen" Subject: Re: [PATCH] scsi: virtio_scsi: Use struct_size() helper Date: Thu, 11 Jul 2019 20:18:54 -0400 Message-ID: References: <20190619192833.GA825@embeddedor> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <20190619192833.GA825@embeddedor> (Gustavo A. R. Silva's message of "Wed, 19 Jun 2019 14:28:33 -0500") Sender: linux-kernel-owner@vger.kernel.org To: "Gustavo A. R. Silva" Cc: "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , "James E.J. Bottomley" , "Martin K. Petersen" , virtualization@lists.linux-foundation.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-scsi@vger.kernel.org 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! -- Martin K. Petersen Oracle Linux Engineering