Skip to contentSkip to conversation

linux/compat.h: Remove debug() from spin_lock_irqsave()

PATCH New Andy Shevchenko 5 participants 8 messages Nov 19, 2020 – Dec 3, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux/compat.h: Remove debug() from spin_lock_irqsave()

It seems nobody tested the debug() option in spin_lock_irqsave(). Currently, when #define DEBUG, it spoils the compiler with

In file included from drivers/usb/dwc3/gadget.c:18:
drivers/usb/dwc3/gadget.c: In function ?dwc3_gadget_set_selfpowered?:
include/log.h:235:4: warning: ?flags? is used uninitialized in this function [-Wuninitialized]

  235 |    printf(pr_fmt(fmt), ##args); \
      |    ^~~~~~
drivers/usb/dwc3/gadget.c:1347:17: note: ?flags? was declared here
 1347 |  unsigned long  flags;
      |                 ^~~~~

and so on...
Drop useless debug() call to make compiler happy.

Fixes 0c06db598367 ("lib, linux: move linux specific defines to linux/compat.h")
Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>
---
 include/linux/compat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/compat.h +1 -1
index 38549baa251d..3d0acbd582ef 100644
@@ -248,7 +248,7 @@ typedef int	wait_queue_head_t;
 #define spin_lock_init(lock) do {} while (0)
 #define spin_lock(lock) do {} while (0)
 #define spin_unlock(lock) do {} while (0)
-#define spin_lock_irqsave(lock, flags) do { debug("%lu\n", flags); } while (0)
+#define spin_lock_irqsave(lock, flags) do {} while (0)
 #define spin_unlock_irqrestore(lock, flags) do { flags = 0; } while (0)
 
 #define DEFINE_MUTEX(...)
Signature · 1 line
2.29.2
#1 lore raw

PATCH 1/1 linux/compat.h: Remove debug() from spin_lock_irqsave()

Update Tom's address

Quoted 40 lines · Andy Shevchenko

It seems nobody tested the debug() option in spin_lock_irqsave(). Currently, when #define DEBUG, it spoils the compiler with

In file included from drivers/usb/dwc3/gadget.c:18:
drivers/usb/dwc3/gadget.c: In function ?dwc3_gadget_set_selfpowered?:
include/log.h:235:4: warning: ?flags? is used uninitialized in this function [-Wuninitialized]

  235 |    printf(pr_fmt(fmt), ##args); \
      |    ^~~~~~
drivers/usb/dwc3/gadget.c:1347:17: note: ?flags? was declared here
 1347 |  unsigned long  flags;
      |                 ^~~~~

and so on...
Drop useless debug() call to make compiler happy.

Fixes 0c06db598367 ("lib, linux: move linux specific defines to linux/compat.h")
Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>
---
 include/linux/compat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/compat.h +1 -2
index 38549baa251d..3d0acbd582ef 100644
@@ -248,7 +248,7 @@ typedef int wait_queue_head_t;
 #define spin_lock_init(lock) do {} while (0)
 #define spin_lock(lock) do {} while (0)
 #define spin_unlock(lock) do {} while (0)
-#define spin_lock_irqsave(lock, flags) do { debug("%lu\n", flags); } while (0)
+#define spin_lock_irqsave(lock, flags) do {} while (0)
 #define spin_unlock_irqrestore(lock, flags) do { flags = 0; } while (0)
 
 #define DEFINE_MUTEX(...)
--

2.29.2

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw

PATCH 1/1 linux/compat.h: Remove debug() from spin_lock_irqsave()

Hi, Andy

Quoted 23 lines · Andy Shevchenko

Update Tom's address

Quoted 19 lines · Andy Shevchenko

It seems nobody tested the debug() option in spin_lock_irqsave(). Currently, when #define DEBUG, it spoils the compiler with

In file included from drivers/usb/dwc3/gadget.c:18:
drivers/usb/dwc3/gadget.c: In function ?dwc3_gadget_set_selfpowered?:
include/log.h:235:4: warning: ?flags? is used uninitialized in this function [-Wuninitialized]

   235 |    printf(pr_fmt(fmt), ##args); \
       |    ^~~~~~
drivers/usb/dwc3/gadget.c:1347:17: note: ?flags? was declared here
  1347 |  unsigned long  flags;
       |                 ^~~~~

and so on...
Drop useless debug() call to make compiler happy.

Fixes 0c06db598367 ("lib, linux: move linux specific defines to linux/compat.h")
Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>
Quoted 21 lines
Quoted 20 lines
---
  include/linux/compat.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/compat.h +1 -2
index 38549baa251d..3d0acbd582ef 100644
@@ -248,7 +248,7 @@ typedef int wait_queue_head_t;
  #define spin_lock_init(lock) do {} while (0)
  #define spin_lock(lock) do {} while (0)
  #define spin_unlock(lock) do {} while (0)
-#define spin_lock_irqsave(lock, flags) do { debug("%lu\n", flags); } while (0)
+#define spin_lock_irqsave(lock, flags) do {} while (0)
  #define spin_unlock_irqrestore(lock, flags) do { flags = 0; } while (0)
 
  #define DEFINE_MUTEX(...)
--

2.29.2

#3 lore raw

PATCH 1/1 linux/compat.h: Remove debug() from spin_lock_irqsave()

In reply to Andy Shevchenko

Hello Andy,

Am 19.11.20 um 21:21 schrieb Andy Shevchenko:

Quoted 27 lines

Update Tom's address

Quoted 23 lines · Andy Shevchenko

It seems nobody tested the debug() option in spin_lock_irqsave(). Currently, when #define DEBUG, it spoils the compiler with

In file included from drivers/usb/dwc3/gadget.c:18:
drivers/usb/dwc3/gadget.c: In function ?dwc3_gadget_set_selfpowered?:
include/log.h:235:4: warning: ?flags? is used uninitialized in this function [-Wuninitialized]

  235 |    printf(pr_fmt(fmt), ##args); \
      |    ^~~~~~
drivers/usb/dwc3/gadget.c:1347:17: note: ?flags? was declared here
 1347 |  unsigned long  flags;
      |                 ^~~~~

and so on...
Drop useless debug() call to make compiler happy.

Fixes 0c06db598367 ("lib, linux: move linux specific defines to linux/compat.h")
Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>
---
 include/linux/compat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks!

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#4 lore raw

PATCH 1/1 linux/compat.h: Remove debug() from spin_lock_irqsave()

In reply to Andy Shevchenko
Quoted 1 line · Andy Shevchenko

Update Tom's address

Tom, should I resend with your address fixed?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#5 lore raw

PATCH 1/1 linux/compat.h: Remove debug() from spin_lock_irqsave()

Quoted 4 lines · Andy Shevchenko
Quoted 1 line · Andy Shevchenko

Update Tom's address

Tom, should I resend with your address fixed?

No, I grab things from patchwork. This is on my TODO list, btw.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201202/f83de589/attachment.sig>
#6 lore raw

PATCH 1/1 linux/compat.h: Remove debug() from spin_lock_irqsave()

Quoted 7 lines · Tom Rini
Quoted 4 lines · Andy Shevchenko
Quoted 1 line · Andy Shevchenko

Update Tom's address

Tom, should I resend with your address fixed?

No, I grab things from patchwork. This is on my TODO list, btw.

Cool, thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw

PATCH 1/1 linux/compat.h: Remove debug() from spin_lock_irqsave()

In reply to Andy Shevchenko
Quoted 15 lines · Andy Shevchenko

It seems nobody tested the debug() option in spin_lock_irqsave(). Currently, when #define DEBUG, it spoils the compiler with

In file included from drivers/usb/dwc3/gadget.c:18:
drivers/usb/dwc3/gadget.c: In function ?dwc3_gadget_set_selfpowered?:
include/log.h:235:4: warning: ?flags? is used uninitialized in this function [-Wuninitialized]

  235 |    printf(pr_fmt(fmt), ##args); \
      |    ^~~~~~
drivers/usb/dwc3/gadget.c:1347:17: note: ?flags? was declared here
 1347 |  unsigned long  flags;
      |                 ^~~~~

and so on...
Drop useless debug() call to make compiler happy.

Quoted 6 lines
Fixes 0c06db598367 ("lib, linux: move linux specific defines to linux/compat.h")
Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201203/eb67f3e2/attachment.sig>