Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1677073pxb; Thu, 7 Oct 2021 12:40:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGVMIfr0p9J7C+OXNjxT2tJYclHoF6dhVA/pXiJR2M2z1g5dOxMWQgGUGwttBAcC5hBJmZ X-Received: by 2002:a65:664f:: with SMTP id z15mr1210036pgv.252.1633635609637; Thu, 07 Oct 2021 12:40:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633635609; cv=none; d=google.com; s=arc-20160816; b=WZJZnXbCXqJVzMXsTpIvVPZVkDBsWk1z9Bzw5NCGhdGQLjggXHR7FZ7PJLvRPozUsV yput8ArnuL2nHjrp71mJ9oyFIA6VFWz89tvYfyBfk+ZhItWNuls7VdBKyyLjhoccM8sE P6Wl23l5LnFAnLgddYujDZFBvKeCkY2RiUf/Ipxy7O7IJvdSzBtafmS8UWdfgq7EBI9w WBEZ+uFxGTXrZpTUYzGW1SeA57qf/mhzw7AwGI/AorJ265iU/Yit3EnLujanREoQoIgH ExwcLuL956XfUmDzEuWpm7nZPQNb29Zl5O1x1+1XIp0DzmELyQm4yreQXihh+uy403tA 6Iog== 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:dkim-filter; bh=2ictrqXAcs0/Jf+501IU2xn9Ag6+SYGQ2GB1JSMdfsk=; b=kqR7BMWIkvIlDgCTQHij/lBWc+hm4Uc8Co/qlWMOkiqSWOwVxdv1vpPwa4C8AQyyw3 S7g+AenJdS6LhYdOKL4V6KaLPbsTeM5P13vVgTi8YKWqTDjAybtsmjtntpH5e+MuoPU2 ISWPiPvUkF8AxDFlEvMX5/leH7U+GFmFACNro90fR2ojvzmp1amfviP2GRl0na67LK2k 15e4P9YHylDAuacIfsfgUbyayFbmZyK22S7de4k3slU+8E20m4xKZ1Q7Z6eWtpNqIhlW tUtQ/6QXmmFCp7L7xo2SKo7KYvDOOaWzSiNTV0JFjP9VPRSKxa5ewmt5Cr1nDI/nP9t+ Dh6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=XMZHChvU; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y16si281415plh.288.2021.10.07.12.39.56; Thu, 07 Oct 2021 12:40:09 -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=@nifty.com header.s=dec2015msa header.b=XMZHChvU; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241852AbhJGPwc (ORCPT + 99 others); Thu, 7 Oct 2021 11:52:32 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:25997 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241765AbhJGPwb (ORCPT ); Thu, 7 Oct 2021 11:52:31 -0400 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 197FoM6r007339 for ; Fri, 8 Oct 2021 00:50:23 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 197FoM6r007339 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1633621823; bh=2ictrqXAcs0/Jf+501IU2xn9Ag6+SYGQ2GB1JSMdfsk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=XMZHChvUbi0/x64LrjBMjBDD8xRAZzR0gb9nQmJ4eBWHB+eJXeRdTWOM7lOGE2Pbk o+ybVG6MvojCUYxmsOrO94dutpJ4TF5r27EIaAkutr5R3xWYp8zutrKW4eVr2BHbXe mP5ktpD991UXujzbHoZ6Ra21/WrPvbgBxukVk2oyt8XoQSh9g2pKYyi0DJlsJzuGHt 0bxzEgLKc3uBh/UYnUCmgBcQm6nt585LAM+9mMvnvVTghIR6ziEIvqTz3mtKrKI0ZI LW/ME6rITE8b9ySgQKetVBIGyjHa14nmpY4LAdpDrwxkCxPfJDynCs04O1B6pkhPsD qxfwCnglWwjSQ== X-Nifty-SrcIP: [209.85.214.177] Received: by mail-pl1-f177.google.com with SMTP id x8so4168318plv.8 for ; Thu, 07 Oct 2021 08:50:23 -0700 (PDT) X-Gm-Message-State: AOAM531RWrj1r7Za4oO2J4Yj35gzjM2xFjsJHKhh7dqAUVRuOsofI9Q4 HPtcieEp6ZhTpIwJl/XN0Flo4VHOfcKlOjgIFrc= X-Received: by 2002:a17:90a:4414:: with SMTP id s20mr5636167pjg.144.1633621822196; Thu, 07 Oct 2021 08:50:22 -0700 (PDT) MIME-Version: 1.0 References: <20211005171728.3147094-1-lucas.demarchi@intel.com> In-Reply-To: <20211005171728.3147094-1-lucas.demarchi@intel.com> From: Masahiro Yamada Date: Fri, 8 Oct 2021 00:49:44 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] drm/i915: remove IS_ACTIVE To: Lucas De Marchi Cc: intel-gfx , dri-devel , Linux Kernel Mailing List , Dan Carpenter , Steven Price , Chris Wilson , Andrzej Hajda , Jani Nikula Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 6, 2021 at 2:21 AM Lucas De Marchi wrote: > > When trying to bring IS_ACTIVE to linux/kconfig.h I thought it wouldn't > provide much value just encapsulating it in a boolean context. So I also > added the support for handling undefined macros as the IS_ENABLED() > counterpart. However the feedback received from Masahiro Yamada was that > it is too ugly, not providing much value. And just wrapping in a boolean > context is too dumb - we could simply open code it. > > As detailed in commit babaab2f4738 ("drm/i915: Encapsulate kconfig > constant values inside boolean predicates"), the IS_ACTIVE macro was > added to workaround a compilation warning. However after checking again > our current uses of IS_ACTIVE it turned out there is only > 1 case in which it triggers a warning in clang (due > -Wconstant-logical-operand) and 2 in smatch. All the others > can simply use the shorter version, without wrapping it in any macro. > > So here I'm dialing all the way back to simply removing the macro. That > single case hit by clang can be changed to make the constant come first, > so it doesn't think it's mask: > > - if (context && CONFIG_DRM_I915_FENCE_TIMEOUT) > + if (CONFIG_DRM_I915_FENCE_TIMEOUT && context) > > As talked with Dan Carpenter, that logic will be added in smatch as > well, so it will also stop warning about it. > > Signed-off-by: Lucas De Marchi > Acked-by: Jani Nikula Reviewed-by: Masahiro Yamada -- Best Regards Masahiro Yamada