Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Lucas De Marchi <lucas.demarchi@intel.com>
Cc: dri-devel@lists.freedesktop.org,
	Masahiro Yamada <masahiroy@kernel.org>,
	Steven Price <steven.price@arm.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	intel-gfx@lists.freedesktop.org, "Sarvela\,
	Tomi P" <tomi.p.sarvela@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: remove IS_ACTIVE
Date: Fri, 01 Oct 2021 12:57:13 +0300	[thread overview]
Message-ID: <87bl49t6di.fsf@intel.com> (raw)
In-Reply-To: <163308055415.8412.14215483004176995847@build.alporthouse.com>

On Fri, 01 Oct 2021, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Lucas De Marchi (2021-10-01 08:40:41)
>> 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 would potentially trigger a warning. All the others
>>   can simply use the shorter version, without wrapping it in any macro.
>> And even that single one didn't trigger any warning in gcc 10.3.
>> 
>> So here I'm dialing all the way back to simply removing the macro. If it
>> triggers warnings in future we may change the few cases to check for > 0
>> or != 0. Another possibility would be to use the great "not not
>> operator" for all positive checks, which would allow us to maintain
>> consistency.  However let's try first the simplest form though, hopefully
>> we don't hit broken compilers spitting a warning:
>
> You didn't prevent the compilation warning this re-introduces.
>
> drivers/gpu/drm/i915/i915_config.c:11 i915_fence_context_timeout() warn: should this be a bitwise op?
> drivers/gpu/drm/i915/i915_request.c:1679 i915_request_wait() warn: should this be a bitwise op?

Looks like that's a Smatch warning. The immediate fix would be to just
add the != 0 in the relevant places. But this is stuff that's just going
to get broken again unless we add Smatch to CI. Most people aren't
running it on a regular basis.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

  parent reply	other threads:[~2021-10-01  9:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01  7:40 [Intel-gfx] [PATCH] drm/i915: remove IS_ACTIVE Lucas De Marchi
2021-10-01  7:46 ` Jani Nikula
2021-10-01  9:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
     [not found] ` <163308055415.8412.14215483004176995847@build.alporthouse.com>
2021-10-01  9:57   ` Jani Nikula [this message]
2021-10-01 16:17     ` [Intel-gfx] [PATCH] " Lucas De Marchi
2021-10-04 20:52     ` Lucas De Marchi
2021-10-05  6:19       ` Dan Carpenter
2021-10-05  7:13         ` Lucas De Marchi
2021-10-01 10:51 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " Patchwork
2021-10-01 12:48 ` [Intel-gfx] [PATCH] " kernel test robot
2021-10-01 22:07 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: remove IS_ACTIVE (rev2) Patchwork
2021-10-02  5:47 ` [Intel-gfx] [PATCH] drm/i915: remove IS_ACTIVE kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl49t6di.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=a.hajda@samsung.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=masahiroy@kernel.org \
    --cc=steven.price@arm.com \
    --cc=tomi.p.sarvela@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox