Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3DF9C00140 for ; Tue, 2 Aug 2022 12:33:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD0D8810E8; Tue, 2 Aug 2022 14:33:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="ZCOoPddg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6370B84534; Tue, 2 Aug 2022 14:33:19 +0200 (CEST) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C364A80584 for ; Tue, 2 Aug 2022 14:33:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x833.google.com with SMTP id e5so10142308qts.1 for ; Tue, 02 Aug 2022 05:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ThGkhFNG4aQ1lw/osBCJzxSAuWF6cjhj/dBys6eZyIE=; b=ZCOoPddg88kvuC4bLFQzdCYWxaV9R91KIHFgRkqisH43mlNSAcyswC3QGLdGeVCVR8 DwJoZj9Y9L83ninUZbxJqI3pQH740sgVuwu9t3yOsqarq3QJdvnA+7lUAofBMsKyjQS7 HAnMCECItMO/gQoFGxmAVCm7hGUKe6mR8LBt4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ThGkhFNG4aQ1lw/osBCJzxSAuWF6cjhj/dBys6eZyIE=; b=Ne9jwtqp8rqVYlb4RClvSgzpcSqS9GACPkKXstH0ycDGxQtE3HAc+5gPS5YSXEi65o hA9GSObQOvFYu6uWr3g+RJnTjkFSjlDldFVSRsNaVs6zRsrc8zKleXr6uQQl97g1v2aO 794k5rahkzW0+98HxDtN32DEzvTOGb6c67Dva74gY0nDBYhF3GftnnmHTZEXXV7vIkw8 BfDWWDRqfbEqnTqh/IZOumCJ9Jd+/xB9kUvN9c80Q+0ut+o1qvqKQGZX197BaCuRGARC YPWW/1EfWKc/L6uuuk6NLdz35LRyG1syhspQggflOdNdCD/4hApgSBfYPN92R2JNLyQ8 jJ1g== X-Gm-Message-State: AJIora++q+nXGEMwZdClo5BJ2Aqc4qzDVI/v9AOS4ZIrG3Fu0V7T4WIu ZseuucPp8XSXM10E0OVUUjou7/v/zJhY8ars X-Google-Smtp-Source: AGRyM1uhDEMPKiAe2td9cnVaaIZS/mMu+u7G4ShyeeT0Syl1BPmRPwAhrXLD/3A4LyBd+3DNjgSAWg== X-Received: by 2002:a05:622a:190:b0:31f:3999:b949 with SMTP id s16-20020a05622a019000b0031f3999b949mr17701183qtw.444.1659443595327; Tue, 02 Aug 2022 05:33:15 -0700 (PDT) Received: from bill-the-cat.lan (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id bk42-20020a05620a1a2a00b006b89b9024ddsm5595824qkb.24.2022.08.02.05.33.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Aug 2022 05:33:14 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Michal Simek , Patrice Chotard , Patrick Delaunay , Simon Glass Subject: [PATCH] checkpatch.pl: Reword IS_ENABLED() warning Date: Tue, 2 Aug 2022 08:33:13 -0400 Message-Id: <20220802123313.2993824-1-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean While there are good reasons to use 'if (IS_ENABLED(CONFIG_...))' for runtime tests, there's equally good reasons to use '#ifdef CONFIG_...' for build time tests. Reword this message to hopefully avoid confusion. Cc: Simon Glass Signed-off-by: Tom Rini --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index fe13e265a3fe..2d737bdb991b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2621,7 +2621,7 @@ sub u_boot_line { # use if instead of #if if ($realfile =~ /\.c$/ && $line =~ /^\+#if.*CONFIG.*/) { WARN("PREFER_IF", - "Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible\n" . $herecurr); + "Possible runtime #ifdef, see if using 'if (IS_ENABLED(CONFIG...))' instead is possible\n" . $herecurr); } # prefer strl(cpy|cat) over strn(cpy|cat) -- 2.25.1