From: Jani Nikula <jani.nikula@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Silence smatch for cmdparser
Date: Wed, 25 Jan 2017 13:16:17 +0200 [thread overview]
Message-ID: <87y3xz4cfy.fsf@intel.com> (raw)
In-Reply-To: <20170120214530.1062-2-chris@chris-wilson.co.uk>
On Fri, 20 Jan 2017, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> drivers/gpu/drm/i915/i915_cmd_parser.c:808:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:811:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:814:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:808:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:811:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:814:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:808:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:811:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:814:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:808:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:811:23: error: not an lvalue
> drivers/gpu/drm/i915/i915_cmd_parser.c:814:23: error: not an lvalue
I don't understand the error, but the change is sane
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
> If we move the shift into each case not only do we kill the warning from
> smatch, but we shrink the code slightly:
>
> text data bss dec hex filename
> 1267906 20587 3168 1291661 13b58d before
> 1267890 20587 3168 1291645 13b57d after
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_cmd_parser.c | 13 +++----------
> 1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
> index 420bbc220f35..650ee34f5786 100644
> --- a/drivers/gpu/drm/i915/i915_cmd_parser.c
> +++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
> @@ -800,22 +800,15 @@ struct cmd_node {
> */
> static inline u32 cmd_header_key(u32 x)
> {
> - u32 shift;
> -
> switch (x >> INSTR_CLIENT_SHIFT) {
> default:
> case INSTR_MI_CLIENT:
> - shift = STD_MI_OPCODE_SHIFT;
> - break;
> + return x >> STD_MI_OPCODE_SHIFT;
> case INSTR_RC_CLIENT:
> - shift = STD_3D_OPCODE_SHIFT;
> - break;
> + return x >> STD_3D_OPCODE_SHIFT;
> case INSTR_BC_CLIENT:
> - shift = STD_2D_OPCODE_SHIFT;
> - break;
> + return x >> STD_2D_OPCODE_SHIFT;
> }
> -
> - return x >> shift;
> }
>
> static int init_hash_table(struct intel_engine_cs *engine,
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-01-25 11:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 21:45 [PATCH 1/2] drm/i915: Squelch smatch warning for statement with no effect Chris Wilson
2017-01-20 21:45 ` [PATCH 2/2] drm/i915: Silence smatch for cmdparser Chris Wilson
2017-01-25 9:04 ` Chris Wilson
2017-01-25 11:16 ` Jani Nikula [this message]
2017-01-20 22:24 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Squelch smatch warning for statement with no effect Patchwork
2017-01-25 11:25 ` [PATCH 1/2] " Jani Nikula
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=87y3xz4cfy.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.