Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3686948pxf; Mon, 22 Mar 2021 12:24:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMPJjl3MdxNfm0GEvMVVLFiY7l3m+LxNPPP44KvG36f4fU5DyMO6SyJwm1j7A6smVoC0dy X-Received: by 2002:a17:906:1494:: with SMTP id x20mr1308655ejc.101.1616441093616; Mon, 22 Mar 2021 12:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616441093; cv=none; d=google.com; s=arc-20160816; b=rbHL4atMlLKWURc1X+EYdD7r8mfdUbgUty/r6wFxff80Jxn6X2SxBOKc0CXi66CjCk kcThdDavHp3YZRmAYCvDIF+/Y3iExtrqGc6YumEQ03x3KkIgRXRZNdtPB3n38vH3MHq0 brMwmbkGbF5hfRaaeWLxLJTWkbgIiVyN+y31EhflVmDvoSTy0yUF4pNU94KvsFe3AjZf pZh8pOFU3YIUi9rjFQrlhywvYmrOIyqJTqam4LSAv2ug1LtLP6am41rNuy4GNbJaVvIP eZGgazYShYuA506TzniJ55X/SQAelhTROLXbbXgxfAcs9xPbMYhh3BxQdPwZSQ5xI4Gz k9sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cLy5RBMbVv+7pgZZbo/ExjQRPvzPQKaVh0hhl1CwHas=; b=AX20wdd0zHeOMYiceg8qLXlRG+59g9HEmLGc7F27DutJE+mDut4eklkpkjN6uZC0iH 4wQwq4N1u6sFnDiB0roTCdRjf77xN10A99cnrIMrdH7Q6DFTclDZCZTItrlOgz5qpjRm aS1F7GOPKQq1Wdu6AnrXkBPZ/k8ZvSYCwQytLvY1A8j890zRmzIt9gxO8U27Mw0QuacN SRJ2bt4dXt0ELj51zgQX0J9Byb7BbJVOYdQL2UYo19gzBa0AW09vzELqMI3STfuvkDRK rV/HwTzERPgpoEnsvEHUlGc/dOkG2SaRha3uqV3LuIP11YJ8XsAVRtwZmcaqLZUEcaop YosA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=K2riKvcA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u8si11895121ejf.255.2021.03.22.12.24.30; Mon, 22 Mar 2021 12:24:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=K2riKvcA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231438AbhCVTXI (ORCPT + 99 others); Mon, 22 Mar 2021 15:23:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbhCVTWm (ORCPT ); Mon, 22 Mar 2021 15:22:42 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 730E3C061574 for ; Mon, 22 Mar 2021 12:22:41 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id g20so11797860qkk.1 for ; Mon, 22 Mar 2021 12:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cLy5RBMbVv+7pgZZbo/ExjQRPvzPQKaVh0hhl1CwHas=; b=K2riKvcAmdu/6NO7DSJFQtQ2uYZUr7E5HDWpXE31+ZFW8NxoYeo8HJgbdTPWvJx2uk WY9Pi6gT4xhXUayqnk8iDMB8EC3rLJl0XcimZpWlq6TcZVvPcjyvQQkXJ7x+kuOoQtIp KcD5qL+JutHFOFev+kfSzRWannf7vB/GeqbPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cLy5RBMbVv+7pgZZbo/ExjQRPvzPQKaVh0hhl1CwHas=; b=pZi3JjA8dgMfAc5i5rfeNKdVaWSQ1SJBI2c1+SnoWYweP6C+h5RUuYwd6L14tFHYDP wA4csxN+MPFw2m2Kh8l+c7ZU+/LCS2x0Ox5HfFBZUhYrZm/0mv1Of7Lp71tM5b8mF0/C GZ99/H1pXjGlYrD5hIT0IA0UpSGskU1Vdpw8gJ9m1MLENeyj+hGYqGEt1dGTvsr8tpCa YYr3U5zldf33dg5h6ybXnihavGPCiia0Hr25eWH+n40NlpBuBEDAQsFSP0BhjPRf9lNY DF0qzHyZl92FeSRBe77IzGp7uMI0HPqf4ESOTrTCCJFZlCTBukBCH8Rk3PEtN5aSn7ZG mfuw== X-Gm-Message-State: AOAM5303S/eHQeVkoLzsOiHTz5d0vmtKKJRLelWtvs55Qjw3vOJOwinD gWExgx5UwZnVUL6Nzpryxq6FQ0QiR8SRSg== X-Received: by 2002:a37:a0d1:: with SMTP id j200mr1673411qke.426.1616440960302; Mon, 22 Mar 2021 12:22:40 -0700 (PDT) Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com. [209.85.219.169]) by smtp.gmail.com with ESMTPSA id q2sm11562304qkq.59.2021.03.22.12.22.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Mar 2021 12:22:39 -0700 (PDT) Received: by mail-yb1-f169.google.com with SMTP id x189so433523ybg.5 for ; Mon, 22 Mar 2021 12:22:39 -0700 (PDT) X-Received: by 2002:a25:ab54:: with SMTP id u78mr194252ybi.276.1616440959152; Mon, 22 Mar 2021 12:22:39 -0700 (PDT) MIME-Version: 1.0 References: <20210322164308.827846-1-arnd@kernel.org> In-Reply-To: From: Doug Anderson Date: Mon, 22 Mar 2021 12:22:27 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kgdb: fix gcc-11 warning on indentation To: Arnd Bergmann Cc: Jason Wessel , Daniel Thompson , Greg Kroah-Hartman , Ingo Molnar , Christian Brauner , kgdb-bugreport@lists.sourceforge.net, LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Mar 22, 2021 at 11:19 AM Arnd Bergmann wrote: > > On Mon, Mar 22, 2021 at 6:07 PM Doug Anderson wrote: > > On Mon, Mar 22, 2021 at 9:43 AM Arnd Bergmann wrote: > > > > > > -#define v1printk(a...) do { \ > > > - if (verbose) \ > > > - printk(KERN_INFO a); \ > > > - } while (0) > > > -#define v2printk(a...) do { \ > > > - if (verbose > 1) \ > > > - printk(KERN_INFO a); \ > > > - touch_nmi_watchdog(); \ > > > - } while (0) > > > -#define eprintk(a...) do { \ > > > - printk(KERN_ERR a); \ > > > - WARN_ON(1); \ > > > - } while (0) > > > +#define v1printk(a...) do { \ > > > > nit: In addition to the indentation change you're also lining up the > > backslashes. Is that just personal preference, or is there some > > official recommendation in the kernel? I don't really have a strong > > opinion either way (IMO each style has its advantages). > > I don't think there is an official recommendation, I just think the > style is more common, and it helped my figure out what the > indentation should look like in this case. OK, makes sense. I just wasn't sure if there was some standard that I wasn't aware of. Given that you have to touch all these lines anyway then making them all pretty like this seems fine to me. > > > + if (verbose) \ > > > + printk(KERN_INFO a); \ > > > +} while (0) > > > +#define v2printk(a...) do { \ > > > + if (verbose > 1) \ > > > + printk(KERN_INFO a); \ > > > + touch_nmi_watchdog(); \ > > > > This touch_nmi_watchdog() is pretty wonky. I guess maybe the > > assumption is that the "verbose level 2" prints are so chatty that the > > printing might prevent us from touching the NMI watchdog in the way > > that we normally do and thus we need an extra one here? > > > > ...but, in that case, I think the old code was _wrong_ and that the > > intention was that the touch_nmi_watchdog() should only be if "verose > > > 1" as the indentation implied. There doesn't feel like a reason to > > touch the watchdog if we're not doing anything slow. > > No idea. It was like this in Jason's original version from 2008. Yeah, I noticed the same. I'd be curious what Daneil (or Jason if he's reading) says. I suppose i could always wait until your patch lands and then send a new patch that puts it inside the "if" statement and we can debate it then. -Doug