Skip to content

Commit fa0c366

Browse files
javiercarrascocruzlag-linaro
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 6b10f1c commit fa0c366

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mfd/omap-usb-tll.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@
9898

9999
struct usbtll_omap {
100100
void __iomem *base;
101-
int nch; /* num. of channels */
102-
struct clk *ch_clk[]; /* must be the last member */
101+
int nch;
102+
struct clk *ch_clk[] __counted_by(nch);
103103
};
104104

105105
/*-------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)