lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230710-doze-scared-9f0a2e1a9125-mkl@pengutronix.de>
Date:   Mon, 10 Jul 2023 17:59:55 +0200
From:   Marc Kleine-Budde <mkl@...gutronix.de>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Mark Brown <broonie@...nel.org>,
        Cristian Ciocaltea <cristian.ciocaltea@...labora.com>,
        Yang Yingliang <yangyingliang@...wei.com>,
        Amit Kumar Mahapatra via Alsa-devel 
        <alsa-devel@...a-project.org>,
        Neil Armstrong <neil.armstrong@...aro.org>,
        Tharun Kumar P <tharunkumar.pasumarthi@...rochip.com>,
        Vijaya Krishna Nivarthi <quic_vnivarth@...cinc.com>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>, linux-spi@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-amlogic@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
        linux-rockchip@...ts.infradead.org,
        linux-riscv@...ts.infradead.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-trace-kernel@...r.kernel.org, netdev@...r.kernel.org,
        Richard Cochran <richardcochran@...il.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Heiko Stuebner <heiko@...ech.de>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Max Filippov <jcmvbkbc@...il.com>,
        Fabio Estevam <festevam@...il.com>,
        Jerome Brunet <jbrunet@...libre.com>,
        Kevin Hilman <khilman@...libre.com>,
        Tudor Ambarus <tudor.ambarus@...aro.org>,
        Andy Gross <agross@...nel.org>,
        NXP Linux Team <linux-imx@....com>,
        Alain Volmat <alain.volmat@...s.st.com>,
        Orson Zhai <orsonzhai@...il.com>,
        Radu Pirea <radu_nicolae.pirea@....ro>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Steven Rostedt <rostedt@...dmis.org>,
        Sanjay R Mehta <sanju.mehta@....com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Bjorn Andersson <andersson@...nel.org>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Serge Semin <fancer.lancer@...il.com>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        Palmer Dabbelt <palmer@...belt.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Chunyan Zhang <zhang.lyra@...il.com>,
        Shawn Guo <shawnguo@...nel.org>,
        Claudiu Beznea <claudiu.beznea@...rochip.com>
Subject: Re: [PATCH v2 09/15] spi: Use struct_size() helper

On 10.07.2023 18:49:26, Andy Shevchenko wrote:
> Prefer struct_size() over open-coded versions.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  include/linux/spi/spi.h | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> 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 <linux/minmax.h>
>  #include <linux/mod_devicetable.h>
>  #include <linux/mutex.h>
> +#include <linux/overflow.h>
>  #include <linux/scatterlist.h>
>  #include <linux/slab.h>
>  #include <linux/smp.h>
> @@ -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 transfers,
>   * each represented by a struct spi_transfer.  The sequence is "atomic"
> @@ -1147,6 +1150,9 @@ struct spi_message {
>  
>  	/* 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

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ