All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: support more uppercase $logFunctions
@ 2015-03-19  6:21 Tom Van Braeckel
  2015-03-19  8:26 ` [PATCH v2] " Tom Van Braeckel
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Van Braeckel @ 2015-03-19  6:21 UTC (permalink / raw)
  To: apw, joe; +Cc: linux-kernel

Add support for uppercase logging function names (so that they may
exceed 80 cols) and regroup the matched expressions more logically.

Previously, WARN, WARN_RATELIMIT, WARN_ONCE were already supported but
many other uppercase logging functions were not and this caused
unfixable checkpatch warnings (an example: drivers/bluetooth/btusb.c)

Care was taken to avoid being overly broad by adding uppercase logging
functions that do not exist (such as VDBG) or by making everything case
insensitive.

Care was also taken to make sure that previously supported expressions
are still matched (such as WARN*) unless they do not exist anywhere in
the codebase (such as WARN_once or WARN_ratelimited).

Signed-off-by: Tom Van Braeckel <tomvanbraeckel@gmail.com>
---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d124359..c5d1388 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -351,8 +351,8 @@ our $typeTypedefs = qr{(?x:
 
 our $logFunctions = qr{(?x:
 	printk(?:_ratelimited|_once|)|
-	(?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
-	WARN(?:_RATELIMIT|_ONCE|)|
+	(?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont)(?:_ratelimited|_once|)|
+	(?:[A-Z0-9]+_){1,2}(?:EMERG|ALERT|CRIT|ERR|WARNING|WARN|NOTICE|INFO|DEBUG|DBG|DEVEL)(?:_RATELIMIT|_ONCE|)|
 	panic|
 	MODULE_[A-Z_]+|
 	seq_vprintf|seq_printf|seq_puts
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] checkpatch: support more uppercase $logFunctions
  2015-03-19  6:21 [PATCH] checkpatch: support more uppercase $logFunctions Tom Van Braeckel
@ 2015-03-19  8:26 ` Tom Van Braeckel
  2015-03-19  9:13   ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Van Braeckel @ 2015-03-19  8:26 UTC (permalink / raw)
  To: apw, joe; +Cc: linux-kernel, Tom Van Braeckel

Add support for uppercase logging function names (so that they may
exceed 80 cols) and regroup the matched expressions more logically.

Previously, WARN, WARN_RATELIMIT, WARN_ONCE were already supported but
many other uppercase logging functions were not and this caused
unfixable checkpatch warnings (an example: drivers/bluetooth/btusb.c)

Care was taken to avoid being overly broad by adding uppercase logging
functions that do not exist (such as VDBG) or by making everything case
insensitive.

Care was also taken to make sure that previously supported expressions
are still matched (such as WARN_RATELIMIT and WARN_ONCE).

Signed-off-by: Tom Van Braeckel <tomvanbraeckel@gmail.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d124359..18d1ffa 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -352,7 +352,7 @@ our $typeTypedefs = qr{(?x:
 our $logFunctions = qr{(?x:
 	printk(?:_ratelimited|_once|)|
 	(?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
-	WARN(?:_RATELIMIT|_ONCE|)|
+	(?:[A-Z0-9]+_){1,2}(?:EMERG|ALERT|CRIT|ERR|WARNING|WARN|NOTICE|INFO|DEBUG|DBG|DEVEL)(?:_RATELIMIT|_ONCE|)|
 	panic|
 	MODULE_[A-Z_]+|
 	seq_vprintf|seq_printf|seq_puts
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] checkpatch: support more uppercase $logFunctions
  2015-03-19  8:26 ` [PATCH v2] " Tom Van Braeckel
@ 2015-03-19  9:13   ` Joe Perches
  2015-03-19  9:57     ` Tom Van Braeckel
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2015-03-19  9:13 UTC (permalink / raw)
  To: Tom Van Braeckel; +Cc: apw, linux-kernel

On Thu, 2015-03-19 at 09:26 +0100, Tom Van Braeckel wrote:
> Add support for uppercase logging function names (so that they may
> exceed 80 cols) and regroup the matched expressions more logically.
> 
> Previously, WARN, WARN_RATELIMIT, WARN_ONCE were already supported but
> many other uppercase logging functions were not and this caused
> unfixable checkpatch warnings (an example: drivers/bluetooth/btusb.c)

I think BT_DBG is a poor macro as it's just

#define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__)

and I'd rather see a treewide sed for that to pr_debug



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] checkpatch: support more uppercase $logFunctions
  2015-03-19  9:13   ` Joe Perches
@ 2015-03-19  9:57     ` Tom Van Braeckel
  2015-03-19 15:02       ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Van Braeckel @ 2015-03-19  9:57 UTC (permalink / raw)
  To: Joe Perches; +Cc: Robo Bot, linux-kernel

>> unfixable checkpatch warnings (an example: drivers/bluetooth/btusb.c)
>
> I think BT_DBG is a poor macro as it's just
>
> #define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__)
>
> and I'd rather see a treewide sed for that to pr_debug

Indeed, I also think that BT_DBG() is a poor macro and that it should
be fixed tree-wide. I might even do it myself, in a separate patch.

The reason for DBG being in the current patch is to match other *_DBG()
log functions that make more sense, such as NS_DBG().

As for the btusb.c example case, this patch allows us to fix the
"quoted string split across lines" warning caused by the BT_INFO()
macro. The fix will be to not to split the quoted string, which will
be allowed when BT_INFO() is recognized as a log function.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] checkpatch: support more uppercase $logFunctions
  2015-03-19  9:57     ` Tom Van Braeckel
@ 2015-03-19 15:02       ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2015-03-19 15:02 UTC (permalink / raw)
  To: Tom Van Braeckel; +Cc: Andy Whitcroft, linux-kernel

On Thu, 2015-03-19 at 10:57 +0100, Tom Van Braeckel wrote:
> >> unfixable checkpatch warnings (an example: drivers/bluetooth/btusb.c)
> >
> > I think BT_DBG is a poor macro as it's just
> >
> > #define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__)
> >
> > and I'd rather see a treewide sed for that to pr_debug
> 
> Indeed, I also think that BT_DBG() is a poor macro and that it should
> be fixed tree-wide. I might even do it myself, in a separate patch.
> 
> The reason for DBG being in the current patch is to match other *_DBG()
> log functions that make more sense, such as NS_DBG().
> 
> As for the btusb.c example case, this patch allows us to fix the
> "quoted string split across lines" warning caused by the BT_INFO()
> macro. The fix will be to not to split the quoted string, which will
> be allowed when BT_INFO() is recognized as a log function.

The list of in-tree things this matches is long
and far too many are not logging functions

ABIT_UGURU_DEBUG
ACPI_BIOS_WARNING
ACPI_INFO
ACPI_WARNING
ADMA_LL_DBG
AFUD_READ_INFO
ALLOW_DEBUG
ALX_ISR_ALERT
AML_UART_ERR
APPTAG_ERR
ASC_DBG
ATA_ERR
AT_DMA_ERR
ATH_DBG_WARN
AUX_DBG
AUX_ERR
AX_SPR_ERR
BLOCK_PRTY_INFO
BMAC_HOST_INFO
BOND_AD_INFO
BOND_ALB_INFO
BT_DBG
BT_ERR
BT_INFO
CACHE_OP_ERR
CANINTF_ERR
CAUSE_DEBUG
CH_ALERT
CH_DBG
CH_ERR
CHNL_STS_ERR
CH_WARN
CISR_PAR_ERR
CL_LOCK_DEBUG
CLOCK_INFO
CL_PAGE_DEBUG
CMD_ERR
COH_DBG
CPIA_MODULE_DEBUG
CPSW_DEBUG
CSW_PARITY_ERR
CTCM_PR_DEBUG
DAT_ERR
DAVINCI_EMAC_DEBUG
DBG_EM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R
RXS_ERR
RX_STATUS_ERR
SITD_STS_ERR
SLAVE_AD_INFO
SLAVE_TLB_INFO
SLINK_ERR
SMC_DEBUG
SMSC_WARN
SN_PCIDEV_INFO
SORT_CRIT
SPDIF_ERR
SPI_ERR
SR_CRIT
SR_TX_ERR
SSIF_DEFAULT_DEBUG
STK_INFO
STK_WARNING
STS_ERR
SYS_CFGSTAT_ERR
TCAM_ERR
TDMC_INTR_DBG
THERMAL_ALERT
TLAN_DBG
TTM_DEBUG
TXC_DEBUG
TX_CS_DBG
TX_DESC_INFO
TX_INFO
TX_STA_ERR
UDC_DEBUG
UDC_ISO_ERR
ULPI_INFO
ULTRASTOR_DEBUG
URB_DBG
URXD_ERR
USB_DEVICE_INFO
USB_INTERFACE_INFO
USB_STS_ERR
US_DEBUG
UVC_STREAM_ERR
UW_ERR
V_CQ_ERR
VELOCITY_DBG
VMON_OV_WARNING
VMON_UV_WARNING
VREG_INFO
V_UNMAPPED_ERR
WUSBINTR_HOST_ERR
WUSBSTS_HOST_ERR
XENBUS_EXIST_ERR
XE_PARITY_ERR
XMAC_HOST_INFO
ZAURUS_PXA_INFO
ZAURUS_STRONGARM_INFO
ZMII_DBG



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-19 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19  6:21 [PATCH] checkpatch: support more uppercase $logFunctions Tom Van Braeckel
2015-03-19  8:26 ` [PATCH v2] " Tom Van Braeckel
2015-03-19  9:13   ` Joe Perches
2015-03-19  9:57     ` Tom Van Braeckel
2015-03-19 15:02       ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.