[Top] [All Lists]

Re: [PATCH] MIPS: Use WARN() in uasm for better diagnostics.

To: David Daney <>
Subject: Re: [PATCH] MIPS: Use WARN() in uasm for better diagnostics.
From: Sergei Shtylyov <>
Date: Tue, 28 Dec 2010 18:44:25 +0300
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: Thunderbird (X11/20090320)

David Daney wrote:

On the off chance that uasm ever warns about overflow, there is no way
to know what the offending instruction is.

Change the printks to WARNs, so we can get a nice stack trace.  It has
the added benefit of being much more noticeable than the short single
line warning message, so is less likely to be ignored.

Signed-off-by: David Daney <>
 arch/mips/mm/uasm.c |   40 ++++++++++++++++------------------------
 1 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/arch/mips/mm/uasm.c b/arch/mips/mm/uasm.c
index 357916d..4008c79 100644
--- a/arch/mips/mm/uasm.c
+++ b/arch/mips/mm/uasm.c
@@ -156,91 +156,83 @@ static struct insn insn_table[] __uasminitdata = {
 static inline __uasminit u32 build_jimm(u32 arg)
-       if (arg & ~((JIMM_MASK) << 2))
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg & ~((JIMM_MASK) << 2),

   Could drop parens around JIMM_MASK while at it...

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>