Skip to contentSkip to conversation

usb: chipidea: tegra: fix flexible_array.cocci warnings

PATCH In review Julia Lawall 2 participants 2 messages Feb 13, 2021 – Feb 25, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: chipidea: tegra: fix flexible_array.cocci warnings

From: kernel test robot <[email protected]>

Zero-length and one-element arrays are deprecated, see Documentation/process/deprecated.rst Flexible-array members should be used instead.

Generated by: scripts/coccinelle/misc/flexible_array.cocci

Fixes fc53d5279094 ("usb: chipidea: tegra: Support host mode")
CC Peter Geis <[email protected]>

---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next
head:   7a1e838d0cdce7d09a0bd81d45c7b5a660e71ac7
commit: fc53d5279094e38e6363506339772a7021da2df8 [64/198] usb: chipidea: tegra: Support host mode

:::::: branch date: 19 hours ago
:::::: commit date: 4 weeks ago

 host.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/chipidea/host.c +1 -1
@@ -32,7 +32,7 @@ struct ehci_ci_priv {
 struct ci_hdrc_dma_aligned_buffer {
 	void *kmalloc_ptr;
 	void *old_xfer_buffer;
-	u8 data[0];
+	u8 data[];
 };
 
 static int ehci_ci_portpower(struct usb_hcd *hcd, int portnum, bool enable)
Reviewed-by on v1 1/1
#1 lore raw

13.02.2021 23:09, Julia Lawall пишет:

Quoted 29 lines

From: kernel test robot <[email protected]>

Zero-length and one-element arrays are deprecated, see Documentation/process/deprecated.rst Flexible-array members should be used instead.

Generated by: scripts/coccinelle/misc/flexible_array.cocci

Fixes fc53d5279094 ("usb: chipidea: tegra: Support host mode")
CC Peter Geis <[email protected]>

---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next
head:   7a1e838d0cdce7d09a0bd81d45c7b5a660e71ac7
commit: fc53d5279094e38e6363506339772a7021da2df8 [64/198] usb: chipidea: tegra: Support host mode

:::::: branch date: 19 hours ago
:::::: commit date: 4 weeks ago

 host.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

drivers/usb/chipidea/host.c struct ehci_ci_priv { · line 38

Quoted 8 lines
drivers/usb/chipidea/host.c +1 -1
@@ -32,7 +32,7 @@ struct ehci_ci_priv {
 struct ci_hdrc_dma_aligned_buffer {
 	void *kmalloc_ptr;
 	void *old_xfer_buffer;
-	u8 data[0];
+	u8 data[];
 };
 
 static int ehci_ci_portpower(struct usb_hcd *hcd, int portnum, bool enable)