Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp185725ybi; Thu, 11 Jul 2019 17:21:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWeqPhy4RdZaobSqO72dTaQXokqElNHOnL9MUOqQ63xueVf7uN1GT8ShWdCPsoc209A/4D X-Received: by 2002:a17:902:8c98:: with SMTP id t24mr7989731plo.320.1562890916063; Thu, 11 Jul 2019 17:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562890916; cv=none; d=google.com; s=arc-20160816; b=LqFyZNK6m9YkLW7YWmg9ZBDgnXElfm/F6zdHTg7YZBSzulqlhED5+G+nHpQ5KGddHA hqZgIG8yHYu7IysyhWv58HrOQ+byOJBa2HH9xC2iEyT4yZi3cdjj8Eku3nf4oHskFks/ yfUoRuGIBYJ9tSXTRHIApDN54pTe62638dK1PdE3L96enA3rBEJwMbFS7qCeVo6wG+Mz pQkwcRQnAPMEbfKP7j4hXPrTDLxWfaIYmCtwUOSQD/uvy6hmTtbx2C+kV4rI7WbvXx1p FsJaQlNdF/vPZLR0AEIbtmIkRF/K2tj9GhsKOciw4KllSnv/9L6qkIIim5vdbUnRhvi5 Ku0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature; bh=ikifAx/xZE2Hygp/gjJZMb9ec8DwwTr57T242pctyqw=; b=fBJjQnQFMEnzjczZ+zja+ehFpA1WdSxYhYXV3OgVCt0fPRBFz4WJJUNX0/cRxaqObf QrtwFftVfb8/N/xwkyKQV+E75vUQdmrEfoyz1BiCZ15M+6Y0YJr4rH7Nc0Tcadj67Tvr ydyY60W9j6s+6MPo0kg3wqYndoPyaM5IeYlYO4zdlsTiaJVf38q9J9e6u3xkQuUa+V80 ckbGrngpsrDRCJqu39hBOLc5RhEzXD1Icn/wS/95kenPD86NKrjjIUb0HHLFb+f/TavC aw+WyKUCwuSRjKUhku80EqrguPG2X4Y9DwpHxCxrut//m283BxzENOnYUK7o8cY30v3V UuYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="EX8GM9R/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si5949741pjs.58.2019.07.11.17.21.40; Thu, 11 Jul 2019 17:21:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="EX8GM9R/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730572AbfGLAUO (ORCPT + 99 others); Thu, 11 Jul 2019 20:20:14 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:40034 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728102AbfGLAUO (ORCPT ); Thu, 11 Jul 2019 20:20:14 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x6C0IxBN072399; Fri, 12 Jul 2019 00:18:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2018-07-02; bh=ikifAx/xZE2Hygp/gjJZMb9ec8DwwTr57T242pctyqw=; b=EX8GM9R/r2omkzopNRNKk1pBbDLXTN5+SNwFsuzwni7wqAG0+XS2Lv6kgOtaLLi9f+98 8pPDExnZOiFcsWseAe/X4/E11ZismKWL7UMeAaUjWYUFwjRPR4tXwUo4qsMS2RFLGeUD mattgH6L4tWbz7IAykZAqj7UcliqgKw4P02IJcxyjVXYvu73MNUVtjX6fxYCfTPhkVhN L0jXbRvZgQ9+N26kRjxGJny+wav0isAYc/avOKBcN3dHXTSKwHzV7F+QLy1/hTDr+Vgi Z4ubZxLcsVYd9eHZxFunCfSfrIEXo/xnMBVzekUT/Vhsa4/2OOw1ytAf/DSi+z6mQvzV hg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2tjk2u2w1g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 00:18:59 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x6C0HUVS030890; Fri, 12 Jul 2019 00:18:59 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2tnc8tu1ab-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 00:18:59 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x6C0Iv2t027874; Fri, 12 Jul 2019 00:18:58 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Jul 2019 17:18:57 -0700 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 Subject: Re: [PATCH] scsi: virtio_scsi: Use struct_size() helper From: "Martin K. Petersen" Organization: Oracle Corporation References: <20190619192833.GA825@embeddedor> Date: Thu, 11 Jul 2019 20:18:54 -0400 In-Reply-To: <20190619192833.GA825@embeddedor> (Gustavo A. R. Silva's message of "Wed, 19 Jun 2019 14:28:33 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=602 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907120002 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9315 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=658 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907120002 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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