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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F55DEB64D9 for ; Mon, 10 Jul 2023 16:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=C81FAgw4dr73zEfs9j4xWaIuIhmysRDlLMRZuevx7no=; b=LsjAaXggBVqvzBu8e2VHH92tzD 2Zz529nJrV0Ud+vKRO0M3q7gPNJr1s8Cgn0Rptpbk6ilITtcCM7n3r99yFaIYb4SYz4OBKLZeThA2 T33L+vd9ak739yV95QLTxcJ6iyJZXpVMw/Xj3qGNROx3pc5biqElP5lycdcv4tm8wi3vnPEg7EsE/ GOWGs0kEFtYVEeWozOsdhJVOfKNSD7CDiVQG+uu5ovVpfGNpJQB2u0C/3Tna9szsIDFcF8dH/OcUu aHc8OKk+xxtc/mnBwwhR684+IoxknLjZAQH4k4b3UyGzHG4r4lCzAwlRRfXJ0OrQPieVln5IV7trx 4tVNYezA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qItJs-00C8KI-1y; Mon, 10 Jul 2023 16:01:00 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qItJo-00C8Hl-21 for linux-amlogic@lists.infradead.org; Mon, 10 Jul 2023 16:00:59 +0000 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 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-amlogic@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230710_090056_666948_45F2EEBD X-CRM114-Status: GOOD ( 24.67 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============8966731916410216957==" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org --===============8966731916410216957== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fkfcsps3yw5kjzrk" Content-Disposition: inline --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-- --===============8966731916410216957== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic --===============8966731916410216957==--