From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752247AbcBWNfF (ORCPT ); Tue, 23 Feb 2016 08:35:05 -0500 Received: from smtprelay0200.hostedemail.com ([216.40.44.200]:54725 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751880AbcBWNfE (ORCPT ); Tue, 23 Feb 2016 08:35:04 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:69:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2553:2559:2562:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:4605:5007:6261:7875:7903:8660:10004:10400:10848:10967:11026:11232:11658:11914:12043:12291:12296:12438:12517:12519:12555:12683:12740:13148:13149:13180:13229:13230:14093:14097:14659:21080:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:6,LUA_SUMMARY:none X-HE-Tag: star48_4907fc724fb0b X-Filterd-Recvd-Size: 3317 Date: Tue, 23 Feb 2016 08:35:00 -0500 From: Steven Rostedt To: Josh Poimboeuf Cc: Andrew Morton , linux-kernel@vger.kernel.org, Heiko Carstens , Prarit Bhargava Subject: Re: [PATCH] lib/bug.c: use common WARN helper Message-ID: <20160223083500.58da2c45@gandalf.local.home> In-Reply-To: <14cbeea6c0eb49dc17437b2b8f9448e9e8d40236.1456199584.git.jpoimboe@redhat.com> References: <14cbeea6c0eb49dc17437b2b8f9448e9e8d40236.1456199584.git.jpoimboe@redhat.com> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Feb 2016 21:54:17 -0600 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]() Note, the "()" were to denote that it's a function. But as it is a "pS" and not a "ps" which adds the offset, it does make it look funky. > > Reported-by: Chunyu Hu > Signed-off-by: Josh Poimboeuf > --- > Based on linux-next/master. > > include/asm-generic/bug.h | 7 +++++++ > kernel/panic.c | 44 +++++++++++++++++++++++++------------------- > lib/bug.c | 27 +++------------------------ > 3 files changed, 35 insertions(+), 43 deletions(-) > > diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h > index 630dd23..b67a0f9 100644 > --- a/include/asm-generic/bug.h > +++ b/include/asm-generic/bug.h > @@ -81,6 +81,13 @@ extern void warn_slowpath_null(const char *file, const int line); > do { printk(arg); __WARN_TAINT(taint); } while (0) > #endif > > +struct warn_args { > + const char *fmt; > + va_list args; > +}; Just a nit. Nothing using warn_args outside of panic.c, thus you don't need to declare it here. Either add a comment about what these args are for, or simply do: /* Used internally by panic */ struct warn_args; Other than that, the rest looks fine to me. -- Steve > +void __warn(const char *file, int line, void *caller, unsigned taint, > + struct pt_regs *regs, struct warn_args *args); > + > #ifndef WARN_ON > #define WARN_ON(condition) ({ \ > int __ret_warn_on = !!(condition); \