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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B6ADC001DE for ; Wed, 12 Jul 2023 22:40:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232444AbjGLWkm (ORCPT ); Wed, 12 Jul 2023 18:40:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232427AbjGLWkj (ORCPT ); Wed, 12 Jul 2023 18:40:39 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 950EC1BF9 for ; Wed, 12 Jul 2023 15:40:35 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1b852785a65so256325ad.0 for ; Wed, 12 Jul 2023 15:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689201635; x=1691793635; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=W74OVpeHRuNiX8pMSZJwMLioV1gL07KE3H1a2Sb6peY=; b=QgNyeryYTTACVv5xzPnNBA4fBv8uhd7VsaVJyHLSkvwtHQ661hFCyV66BZ6tioghkS IiSrAN7DKiJZGemA6V8wlUMgmctAMNrRpVUKhk/5Lv33vAAYGSUdGM69pCLaNnlbNOXh 8XefLt2O2fzoj5+Y6R5Z6VGjlTW+vbMv4QtDQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689201635; x=1691793635; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=W74OVpeHRuNiX8pMSZJwMLioV1gL07KE3H1a2Sb6peY=; b=EK+YCt8WTuk7ekbxYVWaHzPGondw6mcVdUz9xhRmgPxR6ukMpRsf4qfiOCGWeg/k2K k+oST84Gst/wSXD1qwGweyPOWTJZZyOBBuuFpL/epA5nw+Ncu8Ti673TwTrZbzB66LBD XDkiQHqtsld1JimU83Hlg3Dq1lcVMYrNrDaM+gPac2KUAIE4atVoXyu0TP0PcD41S1m9 5ndRoTuqJmu8zsa4E7Dff516GqoruVUIMnIAD4f/KDSv48GMKmmQtgpbZ/zm2e/9Nvjf 3Syqs7HQCX1PimxcxGJmSoyoLSSFsau2UI0wi23NcnEpmx/nFNd4SqLROfSu1MY+kRmc hIIg== X-Gm-Message-State: ABy/qLalFX4ovv/YOxJ4tCLtgWHa+I0C3iKVfyfdn5Fu4Q85cgXokv9m PpAZkTGtGgdDU0yqnc6lAig0FA== X-Google-Smtp-Source: APBJJlHjYHPAqP5SmPN3RIOl52xjZOYYkXRgyg60M7GK47U7g8k/67db5mDhdwbCY4s7DI8euJG7fA== X-Received: by 2002:a17:902:ea03:b0:1b9:d38d:efb1 with SMTP id s3-20020a170902ea0300b001b9d38defb1mr196238plg.8.1689201635138; Wed, 12 Jul 2023 15:40:35 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id d14-20020a170903230e00b001b864add154sm4475679plh.154.2023.07.12.15.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:40:34 -0700 (PDT) Date: Wed, 12 Jul 2023 15:40:34 -0700 From: Kees Cook To: Christophe JAILLET Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH] soc: qcom: smem: Use struct_size() Message-ID: <202307121540.F8EBBCA1D3@keescook> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 12, 2023 at 10:42:15PM +0200, Christophe JAILLET wrote: > Use struct_size() instead of hand-writing it, when allocating a structure > with a flex array. > > This is less verbose. > > Signed-off-by: Christophe JAILLET Reviewed-by: Kees Cook -- Kees Cook