public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>,
	Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH RESEND 1/2] drm/i915: make device info bitfield flags bools
Date: Fri, 13 May 2016 16:05:49 +0100	[thread overview]
Message-ID: <5735ED4D.50505@linux.intel.com> (raw)
In-Reply-To: <87d1oqf21a.fsf@intel.com>


On 13/05/16 15:47, Jani Nikula wrote:
> On Fri, 13 May 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> On Fri, May 13, 2016 at 03:25:05PM +0100, Tvrtko Ursulin wrote:
>>>
>>> On 13/05/16 15:04, Jani Nikula wrote:
>>>> This is more robust for assignments and comparisons.
>>>>
>>>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>>> ---
>>>>   drivers/gpu/drm/i915/i915_drv.h | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>>>> index d9d07b70f05c..bb0b6f64000e 100644
>>>> --- a/drivers/gpu/drm/i915/i915_drv.h
>>>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>>>> @@ -752,7 +752,7 @@ struct intel_csr {
>>>>   	func(has_ddi) sep \
>>>>   	func(has_fpga_dbg)
>>>>
>>>> -#define DEFINE_FLAG(name) u8 name:1
>>>> +#define DEFINE_FLAG(name) bool name:1
>>>>   #define SEP_SEMICOLON ;
>>>>
>>>>   struct intel_device_info {
>>>>
>>>
>>> The churn virus spreads? :)
>>>
>>> I tried that but it was negatively impacting the compiler. For some
>>> reason it increases .text by 2.5k here. Don't see anything obvious,
>>> would have to look at the code more closely to spot exactly why.
>>
>> Oh, that's not fun. bool:1 holds such promise for a clear explanation of
>> the most common form of bitfield.
>
> Really a bummer, especially since assigning any positive even number to
> unsigned int foo:1 will result in 0.

That is a pretty strong argument to go for this rather than make sure 
all places which set them are correct.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-05-13 15:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 14:04 [PATCH RESEND 1/2] drm/i915: make device info bitfield flags bools Jani Nikula
2016-05-13 14:04 ` [PATCH RESEND 2/2] drm/i915: don't mix bitwise and logical operations for has_snoop Jani Nikula
2016-05-13 15:08   ` Tvrtko Ursulin
2016-05-13 14:25 ` [PATCH RESEND 1/2] drm/i915: make device info bitfield flags bools Tvrtko Ursulin
2016-05-13 14:33   ` Chris Wilson
2016-05-13 14:47     ` Jani Nikula
2016-05-13 15:05       ` Tvrtko Ursulin [this message]
2016-05-16 10:46         ` Dave Gordon
2016-05-16 15:24           ` Jani Nikula
2016-05-13 15:05 ` ✗ Ro.CI.BAT: failure for series starting with [RESEND,1/2] " Patchwork

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=5735ED4D.50505@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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