From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752150AbcBWNNs (ORCPT ); Tue, 23 Feb 2016 08:13:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51411 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751526AbcBWNNr (ORCPT ); Tue, 23 Feb 2016 08:13:47 -0500 Message-ID: <56CC5B0A.5080107@redhat.com> Date: Tue, 23 Feb 2016 08:13:46 -0500 From: Prarit Bhargava User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Josh Poimboeuf , Andrew Morton CC: linux-kernel@vger.kernel.org, Steven Rostedt , Heiko Carstens Subject: Re: [PATCH] lib/bug.c: use common WARN helper References: <14cbeea6c0eb49dc17437b2b8f9448e9e8d40236.1456199584.git.jpoimboe@redhat.com> In-Reply-To: <14cbeea6c0eb49dc17437b2b8f9448e9e8d40236.1456199584.git.jpoimboe@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 23 Feb 2016 13:13:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/22/2016 10:54 PM, Josh Poimboeuf wrote: > The traceoff_on_warning option doesn't have any effect on s390, powerpc, > arm64, parisc, and sh because there are two different types of WARN > implementations: > > 1) The above mentioned architectures treat WARN() as a special case of a > BUG() exception. They handle warnings in report_bug() in lib/bug.c. > > 2) All other architectures just call warn_slowpath_*() directly. Their > warnings are handled in warn_slowpath_common() in kernel/panic.c. > > Support traceoff_on_warning on all architectures and prevent any future > divergence by using a single common function to emit the warning. > > Also remove the '()' from '%pS()', because the parentheses look funky: > > [ 45.607629] WARNING: at /root/warn_mod/warn_mod.c:17 .init_dummy+0x20/0x40 [warn_mod]() > > Reported-by: Chunyu Hu > Signed-off-by: Josh Poimboeuf > - > - print_modules(); > - show_regs(regs); > - print_oops_end_marker(); > - /* Just a warning, don't kill lockdep. */ > - add_taint(BUG_GET_TAINT(bug), LOCKDEP_STILL_OK); > + __warn(file, line, (void *)bugaddr, BUG_GET_TAINT(bug), regs, > + NULL); > + ^^^ minor minor minor nit: extra line here. Not a big deal but change it if anyone else complains. Other than that ... Acked-and-tested-by: Prarit Bhargava P. > return BUG_TRAP_TYPE_WARN; > } > >