All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once
Date: Wed, 26 Jun 2013 20:47:27 +0200	[thread overview]
Message-ID: <20130626184727.GJ7171@linux-mips.org> (raw)
In-Reply-To: <1372023524-17333-1-git-send-email-aaro.koskinen@iki.fi>

On Mon, Jun 24, 2013 at 12:38:43AM +0300, Aaro Koskinen wrote:

> When booting a new board for the first time, the console is flooded with
> "Unknown board" messages. This is not really helpful. Board type is not
> going to change after the boot, so it's sufficient to print the warning
> only once.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
> 
> 	v2: Adjust indentation.
> 
>  arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
> index 7c64977..9838c0e 100644
> --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
> +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
> @@ -31,6 +31,8 @@
>   * network ports from the rest of the cvmx-helper files.
>   */
>  
> +#include <linux/printk.h>
> +
>  #include <asm/octeon/octeon.h>
>  #include <asm/octeon/cvmx-bootinfo.h>
>  
> @@ -184,9 +186,8 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
>  	}
>  
>  	/* Some unknown board. Somebody forgot to update this function... */
> -	cvmx_dprintf
> -	    ("cvmx_helper_board_get_mii_address: Unknown board type %d\n",
> -	     cvmx_sysinfo_get()->board_type);
> +	pr_warn_once("%s: Unknown board type %d\n", __func__,
> +		     cvmx_sysinfo_get()->board_type);

David,

cvmx_dprintf() is a function frequently invoked from the OCTEON code.
I'm wondering.  Right now it's defined as:

#if CVMX_ENABLE_DEBUG_PRINTS
#define cvmx_dprintf        printk
#else
#define cvmx_dprintf(...)   {}
#endif

That is, there isn't even a severity level being used and the define
CVMX_ENABLE_DEBUG_PRINTS to control cvmx_dprintf is way to similar to
what CONFIG_DYNAMIC_DEBUG rsp. a simple #define DEBUG do.  And the
no-debug variant of cvmx_dprintf isn't correct in presence of side
effects of arguments.

So I propose to just replace cvmx_dprintf with pr_debug.  What do you
think?

  Ralf

  parent reply	other threads:[~2013-06-26 18:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-23 21:38 [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Aaro Koskinen
2013-06-23 21:38 ` [PATCH v2 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite Aaro Koskinen
2013-06-24 18:48   ` David Daney
2013-06-28 21:41     ` Aaro Koskinen
2013-06-24 18:52 ` [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once David Daney
2013-06-24 22:04   ` Aaro Koskinen
2013-06-24 22:33     ` David Daney
2013-06-24 23:06       ` Aaro Koskinen
2013-06-24 23:24         ` David Daney
2013-06-26 18:47 ` Ralf Baechle [this message]
2013-06-28 22:58   ` Aaro Koskinen

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=20130626184727.GJ7171@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=linux-mips@linux-mips.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.