Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35593074rwd; Mon, 10 Jul 2023 09:32:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlH9S0/z/2HDMpCfwYXVlkVzk7/kDCuV5IyctLNYrpC0+uvuKBTmWczhVnd3MC1Yw5k9NsKw X-Received: by 2002:a17:906:5b:b0:974:56aa:6dce with SMTP id 27-20020a170906005b00b0097456aa6dcemr13483478ejg.46.1689006776517; Mon, 10 Jul 2023 09:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689006776; cv=none; d=google.com; s=arc-20160816; b=MCWir93t/EqoxQyt5RBRBCoOeXbjpHKhKuCAX5fjIzyftCxk230+eDcKKEW6wQYgb9 ndZy4qA/BYs85l+Dq2NXXjUnifboJQi/zrn/Z3V7MWhejGDxS4JDXhL/MDmEO9EN9rFK 45izno86LUNoW+aKaAq8CzL75wTrQrb40Fbh7DSzDxWyEa71bGaeNPQV0jETAOSKf08Y yrgQ83FQ+Jgd+9yx7opy2KTXSjYQJoViSmUUZ8dGiokcGBbnW4CxaBFcPZZhKk01cSbx 9xu16UuOVlzqpBithLTwXREwH4JJyBbJ35mxylqE32CJYYcKEofUwJAePm1kknUpIyFt xNrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=FOIVXaz8vwXP2x82ioyjbasmdcVHUNeu4oggrDsrpt0=; fh=lE39/3Km2bzVeSWpkQU7gWL6CWk14p38NIO044ZqdCw=; b=sZUW5cF3OzjwYbaQqOhQzBWm9S1UsEkFa2s6nHavkO9AJEcUFZzptQbIJz7YweBCCZ D6ut3u9UkrWmoh15XsYREh85Rr/seu55GeqNsshpNE9oXNJdaO8Ov8c22MmMeEmtxnnv nHPsqZM32/2OMTczbF0tHQnpIl94fjSHqOU/8yFQuzxidJ/r1wi5SKMpy35WtaUMH3YV zmalIqfIZzTeMj7VSxEvbxRrPH8Lvlba9PR1hdGJtDy7+6K06AroxKu1uRpSyG6flbGk 5RlErkkm3Bsa0feCBV/uBWK0VJZOP0jdFWbwlRQkrP+HKBzCuGkAxazwBOSqhlacKYYx lWEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw16-20020a170906fcb000b009930d4e327dsi9059345ejb.880.2023.07.10.09.32.31; Mon, 10 Jul 2023 09:32:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232894AbjGJQBe (ORCPT + 99 others); Mon, 10 Jul 2023 12:01:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233701AbjGJQBb (ORCPT ); Mon, 10 Jul 2023 12:01:31 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45FD512E for ; Mon, 10 Jul 2023 09:01:27 -0700 (PDT) Received: from moin.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::7b] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qItIz-0006h7-IH; Mon, 10 Jul 2023 18:00:05 +0200 Received: from pengutronix.de (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 0B1351ED16C; Mon, 10 Jul 2023 15:59:56 +0000 (UTC) Date: Mon, 10 Jul 2023 17:59:55 +0200 From: Marc Kleine-Budde To: Andy Shevchenko Cc: Mark Brown , Cristian Ciocaltea , Yang Yingliang , Amit Kumar Mahapatra via Alsa-devel , Neil Armstrong , Tharun Kumar P , Vijaya Krishna Nivarthi , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-trace-kernel@vger.kernel.org, netdev@vger.kernel.org, Richard Cochran , Alexandre Belloni , Heiko Stuebner , Alexandre Torgue , Max Filippov , Fabio Estevam , Jerome Brunet , Kevin Hilman , Tudor Ambarus , Andy Gross , NXP Linux Team , Alain Volmat , Orson Zhai , Radu Pirea , Maxime Coquelin , Martin Blumenstingl , Sascha Hauer , Steven Rostedt , Sanjay R Mehta , Baolin Wang , Paul Walmsley , Matthias Brugger , AngeloGioacchino Del Regno , Bjorn Andersson , Nicolas Ferre , Serge Semin , Konrad Dybcio , Palmer Dabbelt , Masami Hiramatsu , Pengutronix Kernel Team , Chunyan Zhang , Shawn Guo , Claudiu Beznea Subject: Re: [PATCH v2 09/15] spi: Use struct_size() helper Message-ID: <20230710-doze-scared-9f0a2e1a9125-mkl@pengutronix.de> References: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> <20230710154932.68377-10-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fkfcsps3yw5kjzrk" Content-Disposition: inline In-Reply-To: <20230710154932.68377-10-andriy.shevchenko@linux.intel.com> X-SA-Exim-Connect-IP: 2a0a:edc0:0:b01:1d::7b X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --fkfcsps3yw5kjzrk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 10.07.2023 18:49:26, Andy Shevchenko wrote: > Prefer struct_size() over open-coded versions. >=20 > Signed-off-by: Andy Shevchenko > --- > include/linux/spi/spi.h | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) >=20 > diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h > index c9479badf38c..9fb8efb068c6 100644 > --- a/include/linux/spi/spi.h > +++ b/include/linux/spi/spi.h > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -1095,6 +1096,8 @@ struct spi_transfer { > * @state: for use by whichever driver currently owns the message > * @resources: for resource management when the spi message is processed > * @prepared: spi_prepare_message was called for the this message > + * @t: for use with spi_message_alloc() when message and transfers have > + * been allocated together > * > * A @spi_message is used to execute an atomic sequence of data transfer= s, > * each represented by a struct spi_transfer. The sequence is "atomic" > @@ -1147,6 +1150,9 @@ struct spi_message { > =20 > /* List of spi_res reources when the spi message is processed */ > struct list_head resources; > + > + /* For embedding transfers into the memory of the message */ > + struct spi_transfer t[]; You might want to use the DECLARE_FLEX_ARRAY helper here. Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung N=C3=BCrnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | --fkfcsps3yw5kjzrk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEDs2BvajyNKlf9TJQvlAcSiqKBOgFAmSsKvgACgkQvlAcSiqK BOgtxwf/Yz15ymm8GOJJtFmUerpE4jpOZcNfOw1mDTpDDgDH+8CXkQfj2uE13kRU xmZmpKSAMlsxxmOIGsv8VL18I9YKzWY9wk4vu5oovzx44NHON+6ivyODkaJdH2w9 kOVb4XiHGF0bhFsC3TJ4HZSUlG3EbFNnc0nuj/IvF6VEoldwbjSR6R5ZR6+EX47u h77RsJnmXXbOKbOseq0nlPxZYkFSR03Hzey7BMzmHYQ93COdGDhQqI0kNbwrkD5F qpdpYHa26+CLsV+iBftiTk/C49nxRM0cvs4xqUDaZU1rzd2tlbhN28dsuGJ8zQL1 T+7Bl7/j5IRqJUJiKB8YUQNVj2KrOg== =a9WN -----END PGP SIGNATURE----- --fkfcsps3yw5kjzrk--