All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: kernel-janitors@vger.kernel.org
Subject: Re: [Kernel-janitors] [PATCH] IO-APIC debug message reduction at
Date: Wed, 07 Jul 2004 00:25:59 +0000	[thread overview]
Message-ID: <20040707002559.GB16690@conectiva.com.br> (raw)
In-Reply-To: <1089145628.2957.9.camel@tigger>

[-- Attachment #1: Type: text/plain, Size: 2541 bytes --]

Em Tue, Jul 06, 2004 at 09:27:08PM +0100, Mark Broadbent escreveu:
> Hi All,
> 
> Below is a patch that reduces the amount of debug information given out
> by the IO-APIC initialisation.
> 
> Comments welcome, please be gentle as this is my first patch.
> 
> Thanks
> Mark
 
comments: 

> --- linux-2.6.7/arch/i386/kernel/io_apic.c	2004-07-06 21:07:29.000000000 +0100
> +++ linux/arch/i386/kernel/io_apic.c	2004-07-06 21:15:26.000000000 +0100
> @@ -84,6 +84,17 @@
>  #define vector_to_irq(vector)	(vector)
>  #endif
>  
> +#define IOAPIC_QUIET   (0)
> +#define IOAPIC_VERBOSE (1)
> +#define IOAPIC_DEBUG   (2)

What is the point of those parens?

> +
> +/*
> + * Define the default level of output to be very little
> + * This can be turned up by using apic=verbose for more
> + * information and apic=debug for _lots_ of information.
> + */
> +static int ioapic_verbosity = 0;
> +

no need to init static variables to zero, not doing so has the advantage of
moving this variable to the .bss kernel section.

>  /*
>   * The common case is 1:1 IRQ<->pin mappings. Sometimes there are
>   * shared ISA-space IRQs, so we have to support them. We are super
> @@ -734,6 +745,26 @@
>  
>  __setup("noapic", ioapic_setup);
>  
> +static int __init ioapic_set_verbosity(char *str)
> +{
> +	if (strcmp("debug", str) == 0)
> +	{
> +		ioapic_verbosity = IOAPIC_DEBUG;
> +	}

follow kernel coding style:

if (condition) {
	j--;
	bleh();
} else if (condition) {
	i++;
	blah();
}

Also why the braces?

> +	else if (strcmp("verbose", str) == 0)
> +	{
> +		ioapic_verbosity = IOAPIC_VERBOSE;
> +	}
> +	else
> +	{
> +		printk(KERN_WARNING "IO-APIC Verbosity level %s not recognised, use ioapic=verbose or ioapic=debug", str);
> +	}
> +
> +	return 0;
> +}
> +
> +__setup("ioapic=", ioapic_set_verbosity);
> +
>  static int __init ioapic_pirq_setup(char *str)
>  {
>  	int i, max;
> @@ -745,13 +776,16 @@
>  		pirq_entries[i] = -1;
>  
>  	pirqs_enabled = 1;
> -	printk(KERN_INFO "PIRQ redirection, working around broken MP-BIOS.\n");
> +
> +	if (ioapic_verbosity > IOAPIC_QUIET)
> +		printk(KERN_INFO "PIRQ redirection, working around broken MP-BIOS.\n");

Humm, why not having something like ioapic_printk(), just like all the
dprintk in lots of places instead of testing ioapic_verbosity all the time,
polluting kernel sources? Sure, there are some places where directly
testing against ioapic_verbosity is better, like on a function that only
prints information... wait, this is the definition of ioapic_printk() :-)

Stopping here.

Regards,

- Arnaldo

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

  reply	other threads:[~2004-07-07  0:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-06 20:27 [Kernel-janitors] [PATCH] IO-APIC debug message reduction at Mark Broadbent
2004-07-07  0:25 ` Arnaldo Carvalho de Melo [this message]
2004-07-07 20:29 ` Re: [Kernel-janitors] [PATCH] IO-APIC debug message reducti Mark Broadbent
2004-07-07 21:03 ` Randy.Dunlap
2004-07-07 21:11 ` Luiz Fernando N. Capitulino
2004-07-08 18:45 ` Mark Broadbent
2004-07-08 23:09 ` Jeff Garzik
2004-07-10  0:56 ` Mark Broadbent
2004-07-11 10:38 ` maximilian attems
2004-07-13 19:20 ` Mark Broadbent
2004-07-13 19:27 ` Jeff Garzik
2004-07-14  5:24 ` Randy.Dunlap
2004-07-14  8:04 ` Mark Broadbent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040707002559.GB16690@conectiva.com.br \
    --to=acme@conectiva.com.br \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.