From: Petri Latvala <petri.latvala@intel.com>
To: Simon Ser <simon.ser@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib/intel_reg: fix shift undefined behaviour
Date: Tue, 16 Apr 2019 13:36:29 +0300 [thread overview]
Message-ID: <20190416103629.GM22949@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20190321102656.23137-1-simon.ser@intel.com>
On Thu, Mar 21, 2019 at 12:26:56PM +0200, Simon Ser wrote:
> 1<<31 (same as 2<<30) is undefined behaviour in C. When compiling with
> GCC and UBSan, it gives this error:
>
> ../tools/intel_reg_decode.c: In function ‘ivb_debug_port’:
> ../tools/intel_reg_decode.c:398:3: error: case label does not reduce to an integer constant
> case PORT_DBG_DRRS_HW_STATE_HIGH:
> ^~~~
>
> This happens because 1<<31 isn't representable as a signed int. Instead,
> use am unsigned int.
>
> Signed-off-by: Simon Ser <simon.ser@intel.com>
With s,am,an, in commit message,
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
prev parent reply other threads:[~2019-04-16 10:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-21 10:26 [igt-dev] [PATCH i-g-t] lib/intel_reg: fix shift undefined behaviour Simon Ser
2019-03-21 11:43 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-03-21 22:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-04-16 10:36 ` Petri Latvala [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=20190416103629.GM22949@platvala-desk.ger.corp.intel.com \
--to=petri.latvala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=simon.ser@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