bcma: use bcma_debug and pr_cont in MIPS driver
Rafał Miłecki
maintainerPATCH 1/1 bcma: use bcma_debug and pr_cont in MIPS driver
From: Rafał Miłecki <[email protected]>
Using bcma_debug gives a device-specific prefix for messages and pr_cont is a common helper for continuing a line.
--- drivers/bcma/driver_mips.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/bcma/driver_mips.c +4 -3
@@ -184,10 +184,11 @@ static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq) {int i;static const char *irq_name[] = {"2(S)" ,"3" ,"4" ,"5" ,"6" ,"D" ,"I" }; - printk(KERN_DEBUG KBUILD_MODNAME ": core 0x%04x, irq :", dev->id.id); + +bcma_debug (dev->bus,"core 0x%04x, irq :" , dev->id.id);for (i =0 ; i <=6 ; i++) -printk (" %s%s" , irq_name[i], i == irq ?"*" :" " ); -printk ("\n" ); +pr_cont (" %s%s" , irq_name[i], i == irq ?"*" :" " ); +pr_cont ("\n" ); }static void bcma_core_mips_dump_irq (struct bcma_bus *bus)
Signature · 1 line
2.11.0
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Using
bcma_debuggives a device-specific prefix for messages andpr_contis a common helper for continuing a line.Signed-off-by Rafał Miłecki <[email protected]>
Quoted 24 lines
--- drivers/bcma/driver_mips.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/bcma/driver_mips.c +4
-3@@ -184,10 +184,11 @@ static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq) {int i;static const char *irq_name[] = {"2(S)" ,"3" ,"4" ,"5" ,"6" ,"D" ,"I" }; - printk(KERN_DEBUG KBUILD_MODNAME ": core 0x%04x, irq :", dev->id.id); + +bcma_debug (dev->bus,"core 0x%04x, irq :" , dev->id.id);for (i =0 ; i <=6 ; i++) -printk (" %s%s" , irq_name[i], i == irq ?"*" :" " ); -printk ("\n" ); +pr_cont (" %s%s" , irq_name[i], i == irq ?"*" :" " ); +pr_cont ("\n" ); }static void bcma_core_mips_dump_irq (struct bcma_bus *bus)
Quoted 7 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Using
bcma_debuggives a device-specific prefix for messages andpr_contis a common helper for continuing a line.Signed-off-by Rafał Miłecki <[email protected]>Acked-by Hauke Mehrtens <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
66cc04424960 bcma: use bcma_debug and pr_cont in MIPS driver
Signature · 3 lines
https://patchwork.kernel.org/patch/10008245/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 32 lines · Hauke Mehrtens
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Using
bcma_debuggives a device-specific prefix for messages andpr_contis a common helper for continuing a line.Signed-off-by Rafał Miłecki <[email protected]>Acked-by Hauke Mehrtens <[email protected]>Quoted 22 lines
--- drivers/bcma/driver_mips.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/bcma/driver_mips.c +4
-3@@ -184,10 +184,11 @@ static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq) {int i;static const char *irq_name[] = {"2(S)" ,"3" ,"4" ,"5" ,"6" ,"D" ,"I" }; - printk(KERN_DEBUG KBUILD_MODNAME ": core 0x%04x, irq :", dev->id.id); + +bcma_debug (dev->bus,"core 0x%04x, irq :" , dev->id.id);for (i =0 ; i <=6 ; i++) -printk (" %s%s" , irq_name[i], i == irq ?"*" :" " ); -printk ("\n" ); +pr_cont (" %s%s" , irq_name[i], i == irq ?"*" :" " ); +pr_cont ("\n" ); }
Quoted 2 lines
drivers/bcma/driver_mips.c static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq) · line 194
Quoted 2 lines
drivers/bcma/driver_mips.c +0
-0static void bcma_core_mips_dump_irq (struct bcma_bus *bus)
This isn't the same code as it depends on #define DEBUG and will not output the first line in most cases.
I'd suggest a nack.
Perhaps it'd be better to use a temporary and avoid the pr_cont uses like:
{
int i;
static const char *irq_name[] = {"2(S)", "3", "4", "5", "6", "D", "I"};
char interrupts[20];
char *ints = interrupts;
for (i = 0; i < ARRAY_SIZE(irq_name), i++)
ints += sprintf(ints, " %s%c", irq_name[i], i == irq ? '*' : ' ');
bcma_debug(dev->bus, "core 0x04x, irq: %s\n", dev->id.id, interrupts);
}Quoted 5 lines · Joe Perches
Quoted 4 lines · Hauke Mehrtens
Quoted 3 lines · On 10/16/2017 02:54 PM, Rafa=C5=82 Mi=C5=82ecki wrote:
From: Rafa=C5=82 Mi=C5=82ecki <[email protected]>
=20
Usingbcma_debuggives a device-specific prefix for messages and pr_co=
nt
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
is a common helper for continuing a line.
=20Signed-off-by Rafa=C5=82 Mi=C5=82ecki <[email protected]>=20
Acked-by Hauke Mehrtens <[email protected]>=20
Quoted 9 lines
Quoted 9 lines
drivers/bcma/driver_mips.c static void bcma_core_mips_print_irq(struct bcma=
Quoted 9 lines
--- drivers/bcma/driver_mips.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)=20
drivers/bcma/driver_mips.c +0
-0@@ -184,10 +184,11 @@ static void bcma_core_mips_print_irq(struct bcma=
_device *dev, unsigned int irq)
Quoted 3 lines
Quoted 3 lines
drivers/bcma/driver_mips.c static void bcma_core_mips_print_irq(struct bcma= · line 186
Quoted 3 lines
drivers/bcma/driver_mips.c +0
-0{int i; static const char *irq_name[] =3D {"2(S)", "3", "4", "5", "6", "D", =
"I"};
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
drivers/bcma/driver_mips.c +2
-1- printk(KERN_DEBUG KBUILD_MODNAME ": core 0x%04x, irq :", dev->id.id); + +bcma_debug (dev->bus,"core 0x%04x, irq :" , dev->id.id); for (i =3D 0; i <=3D 6; i++)Quoted 8 lines
Quoted 8 lines
drivers/bcma/driver_mips.c +2
-2- printk(" %s%s", irq_name[i], i =3D=3D irq ? "*" : " "); -printk ("\n" ); + pr_cont(" %s%s", irq_name[i], i =3D=3D irq ? "*" : " "); +pr_cont ("\n" ); }=20=20
static voidbcma_core_mips_dump_irq(struct bcma_bus *bus)
=20This isn't the same code as it depends on #define DEBUG and will not output the first line in most cases.
Quoted 1 line
I'd suggest a nack.
Too late, I already applied this. Please submit a followup patch if something needs to be changed.
--=20
Kalle Valo
Quoted 33 lines · Joe Perches
Quoted 32 lines · Hauke Mehrtens
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Using
bcma_debuggives a device-specific prefix for messages andpr_contis a common helper for continuing a line.Signed-off-by Rafał Miłecki <[email protected]>Acked-by Hauke Mehrtens <[email protected]>Quoted 22 lines
--- drivers/bcma/driver_mips.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/bcma/driver_mips.c +4
-3@@ -184,10 +184,11 @@ static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq) {int i;static const char *irq_name[] = {"2(S)" ,"3" ,"4" ,"5" ,"6" ,"D" ,"I" }; - printk(KERN_DEBUG KBUILD_MODNAME ": core 0x%04x, irq :", dev->id.id); + +bcma_debug (dev->bus,"core 0x%04x, irq :" , dev->id.id);for (i =0 ; i <=6 ; i++) -printk (" %s%s" , irq_name[i], i == irq ?"*" :" " ); -printk ("\n" ); +pr_cont (" %s%s" , irq_name[i], i == irq ?"*" :" " ); +pr_cont ("\n" ); }
Quoted 5 lines
Quoted 2 lines
drivers/bcma/driver_mips.c static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq) · line 194
Quoted 2 lines
drivers/bcma/driver_mips.c +0
-0static void bcma_core_mips_dump_irq (struct bcma_bus *bus)This isn't the same code as it depends on #define DEBUG and will not output the first line in most cases.
Oh, I didn't think about bcma_debug (pr_debug) being no_printk indeed. AFAIU it will indeed make pr_cont default to the KERN_DEFAULT.
I'll try to test your code today or tomorrow, thanks!