public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Stephen Boyd <swboyd@chromium.org>
Cc: Michal Marek <michal.lkml@markovi.net>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>
Subject: Re: [PATCH] drm/i915: Silence build error with UBSAN
Date: Tue, 16 Oct 2018 14:48:13 +0300	[thread overview]
Message-ID: <87murekt8i.fsf@intel.com> (raw)
In-Reply-To: <153968444736.22931.7687263957265816381@skylake-alporthouse-com>

On Tue, 16 Oct 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Jani Nikula (2018-10-16 10:59:42)
>> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
>> index f27dbe26bcc1..897d5a557d88 100644
>> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
>> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
>> @@ -461,12 +461,14 @@ static void intel_engine_init_batch_pool(struct intel_engine_cs *engine)
>>         i915_gem_batch_pool_init(&engine->batch_pool, engine);
>>  }
>>  
>> +#define IS_POWER_OF_2(n) ((n) != 0 && ((n) & ((n) - 1)) == 0)
>> +
>>  static void intel_engine_init_execlist(struct intel_engine_cs *engine)
>>  {
>>         struct intel_engine_execlists * const execlists = &engine->execlists;
>>  
>>         execlists->port_mask = 1;
>> -       BUILD_BUG_ON_NOT_POWER_OF_2(execlists_num_ports(execlists));
>> +       GEM_BUG_ON(!IS_POWER_OF_2(execlists_num_ports(execlists)));
>
> That should be happy with is_power_of_2() from log2.h

D'oh. Thanks. I was sure there was one, I looked for it, but my git
greps were all upper case. :/

I'll spin a new version, along with the other clang build fix.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

      reply	other threads:[~2018-10-16 11:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 20:34 [PATCH] drm/i915: Silence build error with UBSAN Stephen Boyd
2018-10-16  9:59 ` Jani Nikula
2018-10-16 10:07   ` Chris Wilson
2018-10-16 11:48     ` Jani Nikula [this message]

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=87murekt8i.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=rodrigo.vivi@intel.com \
    --cc=swboyd@chromium.org \
    --cc=yamada.masahiro@socionext.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