From: Javier Carrasco Date: Thu, 20 Jun 2024 21:22:33 +0000 (+0200) Subject: mfd: omap-usb-tll: Annotate struct usbtll_omap with __counted_by X-Git-Tag: v6.11-rc1~147^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa0c3667d0bf41442927f79d4453b52a265ab601;p=thirdparty%2Fkernel%2Flinux.git mfd: omap-usb-tll: Annotate struct usbtll_omap with __counted_by Use the __counted_by compiler attribute for the "struct clk *ch_clk[]" flexible array member to improve the results of array bound sanitizers. The comments for the variables are no longer needed as it is now clear what is what. Signed-off-by: Javier Carrasco Link: https://lore.kernel.org/r/20240620-omap-usb-tll-counted_by-v1-1-77797834bb9a@gmail.com Signed-off-by: Lee Jones --- diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c index b6303ddb013b0..a091e5b0f21da 100644 --- a/drivers/mfd/omap-usb-tll.c +++ b/drivers/mfd/omap-usb-tll.c @@ -98,8 +98,8 @@ struct usbtll_omap { void __iomem *base; - int nch; /* num. of channels */ - struct clk *ch_clk[]; /* must be the last member */ + int nch; + struct clk *ch_clk[] __counted_by(nch); }; /*-------------------------------------------------------------------------*/