Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754161AbbDGQj5 (ORCPT ); Tue, 7 Apr 2015 12:39:57 -0400 Received: from mail.skyhub.de ([78.46.96.112]:52825 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752542AbbDGQjz (ORCPT ); Tue, 7 Apr 2015 12:39:55 -0400 Date: Tue, 7 Apr 2015 18:37:46 +0200 From: Borislav Petkov To: Steven Rostedt Cc: Daniel Thompson , Thomas Gleixner , Jason Cooper , Russell King , Will Deacon , Catalin Marinas , Marc Zyngier , Stephen Boyd , John Stultz , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Sumit Semwal , Dirk Behme , Daniel Drake , Dmitry Pervushin , Tim Sander , "H. Peter Anvin" , x86@kernel.org Subject: Re: [RESEND PATCH 4.0-rc5 v19 5/6] x86/nmi: Use common printk functions Message-ID: <20150407163746.GA14115@pd.tnic> References: <1427216014-5324-1-git-send-email-daniel.thompson@linaro.org> <1428421083-9137-1-git-send-email-daniel.thompson@linaro.org> <1428421083-9137-6-git-send-email-daniel.thompson@linaro.org> <20150407121942.627d2165@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150407121942.627d2165@gandalf.local.home> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1211 Lines: 43 On Tue, Apr 07, 2015 at 12:19:42PM -0400, Steven Rostedt wrote: > Not sure what the others think, but I hate this polish notation for > compares. One does not say "if zero does not equal > printk_nmi_backtrace_prepare()", they say "if > printk_nmi_backtrace_prepare() does not return zero". > > And the reason for polish notation is to prevent the: > > if (x = 0) > > mistake. Which gcc warns about anyway. Also, this doesn't even pertain > to this code because: > > if (printk_nmi_backtrace_prepare() = 0) > > would fail to compile. I would simply say: err = printk_nmi_backtrace_prepare(); if (err) like sane kernel code does. Besides, there's not a lot of such comparisons in the kernel anyway: $ git grep -E "if\s+\(+[0-9]+\!?=.*" drivers/ide/au1xxx-ide.c:246: if (1==i) but my regex doesn't cover all possible variants, just the single-line ones. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/