From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FDEFC742C2 for ; Fri, 12 Jul 2019 14:14:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2E0021019 for ; Fri, 12 Jul 2019 14:14:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727465AbfGLOOa (ORCPT ); Fri, 12 Jul 2019 10:14:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58730 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727256AbfGLOOa (ORCPT ); Fri, 12 Jul 2019 10:14:30 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4E21B3086202; Fri, 12 Jul 2019 14:14:30 +0000 (UTC) Received: from redhat.com (ovpn-116-209.ams2.redhat.com [10.36.116.209]) by smtp.corp.redhat.com (Postfix) with SMTP id 0577960C66; Fri, 12 Jul 2019 14:14:24 +0000 (UTC) Date: Fri, 12 Jul 2019 10:14:23 -0400 From: "Michael S. Tsirkin" 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 Subject: Re: [PATCH] scsi: virtio_scsi: Use struct_size() helper Message-ID: <20190712101408-mutt-send-email-mst@kernel.org> References: <20190619192833.GA825@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 12 Jul 2019 14:14:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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