Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7e5766fa9431602ef0e56ceae900d0cce3a78b96
Commit:     7e5766fa9431602ef0e56ceae900d0cce3a78b96
Parent:     099d575aaf3dcf4c9c1e0b53c7b17c5faddb1b59
Author:     David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 29 00:36:09 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 31 15:30:52 2007 -0700

    [SPARC64]: Fix build failure when CONFIG_BUG is disabled.
    
    When CONFIG_BUG is turned off, the standard trick of:
    
        switch (x) {
        case X:
        ...
        case Y:
        ...
        default:
                BUG();
        };
    
    to mark impossible cases does not work because BUG() evalutes
    to nothing and thus GCC just sees a fallthrough code path.
    
    Add an explicit KERN_ERR log message and a do_exit() to trap
    this case.
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 arch/sparc64/mm/tsb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/sparc64/mm/tsb.c b/arch/sparc64/mm/tsb.c
index 7ff0a02..a3e6e4b 100644
--- a/arch/sparc64/mm/tsb.c
+++ b/arch/sparc64/mm/tsb.c
@@ -182,7 +182,9 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned 
long tsb_idx, unsign
                break;
 
        default:
-               BUG();
+               printk(KERN_ERR "TSB[%s:%d]: Impossible TSB size %lu, killing 
process.\n",
+                      current->comm, current->pid, tsb_bytes);
+               do_exit(SIGSEGV);
        };
        tte |= pte_sz_bits(page_sz);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to