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] [day] [month] [year] [list]
Message-ID: <90882536d8307a58b6e5787225c07335689bd490.camel@mediatek.com>
Date: Wed, 24 Sep 2025 02:21:19 +0000
From: Jjian Zhou (周建) <Jjian.Zhou@...iatek.com>
To: "jassisinghbrar@...il.com" <jassisinghbrar@...il.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
	"wenst@...omium.org" <wenst@...omium.org>, "devicetree@...r.kernel.org"
	<devicetree@...r.kernel.org>, "conor+dt@...nel.org" <conor+dt@...nel.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@...iatek.com>, "robh@...nel.org"
	<robh@...nel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "matthias.bgg@...il.com"
	<matthias.bgg@...il.com>, "krzk+dt@...nel.org" <krzk+dt@...nel.org>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Subject: Re: [PATCH v5 2/2] mailbox: mediatek: Add mtk-vcp-mailbox driver

On Tue, 2025-09-23 at 08:11 -0500, Jassi Brar wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Tue, Sep 23, 2025 at 1:46 AM Jjian Zhou (周建) <
> Jjian.Zhou@...iatek.com> wrote:
> > 
> > On Thu, 2025-09-18 at 18:50 -0500, Jassi Brar wrote:
> > > External email : Please do not click links or open attachments
> > > until
> > > you have verified the sender or the content.
> > > 
> > > 
> > > On Thu, Aug 21, 2025 at 9:12 PM Jjian Zhou <
> > > jjian.zhou@...iatek.com>
> > > wrote:
> > > 
> > > .....
> > > 
> > > > +#include <linux/module.h>
> > > > +#include <linux/of.h>
> > > > +#include <linux/platform_device.h>
> > > > +#include <linux/slab.h>
> > > > +
> > > > +struct mtk_vcp_mbox_priv {
> > > 
> > > Maybe 'mtk_vcp_mbox' is a more appropriate name ?
> > > 
> > > > +       void __iomem *base;
> > > > +       struct device *dev;
> > > > +       struct mbox_controller mbox;
> > > > +       const struct mtk_vcp_mbox_cfg *cfg;
> > > > +       struct mtk_ipi_info ipi_recv;
> > > 
> > > Maybe also have "struct mbox_chan chan[1]; " so that you don't
> > > have
> > > to
> > > allocate one during the probe.
> > > Also if you have  "struct mbox_controller mbox;" as the first
> > > member,
> > > you could simply typecast that to get this structure.
> > > Something like "struct mpfs_mbox" in mailbox-mpfs.c
> > > 
> > 
> > 
> > ERROR:FLEXIBLE_ARRAY: Use C99 flexible arrays - see
> > 
https://urldefense.com/v3/__https://docs.kernel.org/process/deprecated.html*zero-length-and-one-element-arrays__;Iw!!CTRNKA9wMg0ARbw!kLlX71HetZwXMZ9UmdtvMEKKykbZINIUNVW5nLVfoztdkSJMlaa3QfbzZxGKIkSgqmHHc2Lvfwpj4URsOVCtekNCFh5L$
> > #81: FILE: drivers/mailbox/mtk-vcp-mailbox.c:24:
> > +       struct mbox_chan chans[1];
> > +};
> > 
> > Can we ignore this error?
> > 
> 
> It seems single element style is deprecated. While we know what we
> are
> doing, let us placate that error by
>        struct mbox_chan mch;
>        struct mbox_chan chans[];
> and set  chans = &mch

Do you have any specific considerations for suggesting this approach?
Wo
uld it be sufficient to just define a 'struct mbox_chan chans'?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ