public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Gordon <david.s.gordon@intel.com>
To: Dave Airlie <airlied@gmail.com>,
	David Binderman <linuxdev.baldrick@gmail.com>,
	"Vetter, Daniel" <daniel.vetter@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	David Airlie <airlied@linux.ie>,
	dcb314@hotmail.com,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Intel-gfx] include/drm/i915_drm.h:96: possible bad bitmask ?
Date: Tue, 9 Aug 2016 17:01:15 +0100	[thread overview]
Message-ID: <c0208430-72a0-d267-a71e-4d65781b28f6@intel.com> (raw)
In-Reply-To: <CAPM=9twf3k8KD4vcQAF67o27_yMJr1SVpiApA8WCvmVVM_vkGw@mail.gmail.com>

On 09/08/16 03:59, Dave Airlie wrote:
> On 8 August 2016 at 19:40, Daniel Vetter <daniel@ffwll.ch> wrote:
>> On Mon, Aug 08, 2016 at 10:31:32AM +0100, David Binderman wrote:
>>> Hello there,
>>>
>>> Recent versions of gcc say this:
>>>
>>> include/drm/i915_drm.h:96:34: warning: result of ‘65535 << 20’
>>> requires 37 bits to represent, but ‘int’ only has 32 bits
>>> [-Wshift-overflow=]
>>>
>>> Source code is
>>>
>>> #define   INTEL_BSM_MASK (0xFFFF << 20)
>>>
>>> Maybe something like
>>>
>>> #define   INTEL_BSM_MASK (0xFFFFUL<< 20)
>>>
>>> might be better.
>>
>> Yup. Care to bake this into a patch (with s-o-b and everything per
>> Documentation/SubmittingPatches) so I can apply it?
>
> Why would you want to apply a clearly incorrect patch :-)
>
> INTEL_BSM_MASK is used in one place, on a 32-bit number
>
> I'm not sure what it needs to be, but a 64-bit number it doesn't.
>
> Dave.

I found two uses, but in both cases it's masking a value read
from a 32-bit PCI register, so it can just be (-(1 << 20)).

.Dave.

      reply	other threads:[~2016-08-09 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08  9:31 include/drm/i915_drm.h:96: possible bad bitmask ? David Binderman
2016-08-08  9:40 ` [Intel-gfx] " Daniel Vetter
2016-08-09  2:59   ` Dave Airlie
2016-08-09 16:01     ` Dave Gordon [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=c0208430-72a0-d267-a71e-4d65781b28f6@intel.com \
    --to=david.s.gordon@intel.com \
    --cc=airlied@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dcb314@hotmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxdev.baldrick@gmail.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