Skip to content

Commit a46334e

Browse files
committed
arm: Update UNUSED()
Change arm definition of UNUSED() for gcc/clang builds to cast arg to void. Enable -Wunused-parameter warning for ARM non-GHS toolchains. Fix unused parameter warnings where argc is unused. In cases where corresponding argv[] is used, first return ERROR if argc is less than last element accessed in argv[]. Signed-off-by: Peter Barada <peter.barada@gmail.com>
1 parent 6d092be commit a46334e

File tree

18 files changed

+76
-9
lines changed

18 files changed

+76
-9
lines changed

arch/arm/src/common/Toolchain.defs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ else
405405
ARCHOPTIMIZATION += -Wall
406406
endif
407407

408-
ARCHOPTIMIZATION += -Wshadow -Wundef
408+
ARCHOPTIMIZATION += -Wshadow -Wundef -Wunused-parameter
409409

410410
ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),y)
411411
ARCHOPTIMIZATION += -nostdlib

boards/arm/stm32h7/linum-stm32h753bi/src/stm32_usb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ static int usbhost_waiter(int argc, char *argv[])
9191
{
9292
struct usbhost_hubport_s *hport;
9393

94+
UNUSED(argc);
95+
UNUSED(argv);
96+
9497
uinfo("Running\n");
9598
for (; ; )
9699
{

boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ static int usbhost_waiter(int argc, char *argv[])
9191
{
9292
struct usbhost_hubport_s *hport;
9393

94+
UNUSED(argc);
95+
UNUSED(argv);
96+
9497
uinfo("Running\n");
9598
for (; ; )
9699
{

boards/arm/stm32h7/nucleo-h743zi2/src/stm32_usb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ static int usbhost_waiter(int argc, char *argv[])
9191
{
9292
struct usbhost_hubport_s *hport;
9393

94+
UNUSED(argc);
95+
UNUSED(argv);
96+
9497
uinfo("Running\n");
9598
for (; ; )
9699
{

boards/arm/stm32h7/nucleo-h745zi/src/stm32_usb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ static int usbhost_waiter(int argc, char *argv[])
9191
{
9292
struct usbhost_hubport_s *hport;
9393

94+
UNUSED(argc);
95+
UNUSED(argv);
96+
9497
uinfo("Running\n");
9598
for (; ; )
9699
{

boards/arm/stm32h7/openh743i/src/stm32_usb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ static int usbhost_waiter(int argc, char *argv[])
7878
{
7979
struct usbhost_hubport_s *hport;
8080

81+
UNUSED(argc);
82+
UNUSED(argv);
83+
8184
uinfo("Running\n");
8285
for (; ; )
8386
{

boards/arm/stm32h7/stm32h745i-disco/src/stm32_usb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ static int usbhost_waiter(int argc, char *argv[])
9191
{
9292
struct usbhost_hubport_s *hport;
9393

94+
UNUSED(argc);
95+
UNUSED(argv);
96+
9497
uinfo("Running\n");
9598
for (; ; )
9699
{

boards/arm/stm32h7/stm32h747i-disco/src/stm32_usb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ static int usbhost_waiter(int argc, char *argv[])
9191
{
9292
struct usbhost_hubport_s *hport;
9393

94+
UNUSED(argc);
95+
UNUSED(argv);
96+
9497
uinfo("Running\n");
9598
for (; ; )
9699
{

boards/arm/stm32h7/stm32h750b-dk/src/stm32_usb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ static int usbhost_waiter(int argc, char *argv[])
8989
{
9090
struct usbhost_hubport_s *hport;
9191

92+
UNUSED(argc);
93+
UNUSED(argv);
94+
9295
uinfo("Running\n");
9396
for (; ; )
9497
{

boards/arm/stm32h7/weact-stm32h743/src/stm32_usb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ static int usbhost_waiter(int argc, char *argv[])
9191
{
9292
struct usbhost_hubport_s *hport;
9393

94+
UNUNSED(argc);
95+
UNUSED(argv);
96+
9497
uinfo("Running\n");
9598
for (; ; )
9699
{

0 commit comments

Comments
 (0)