From: Dan Carpenter <dan.carpenter@oracle.com>
To: Michel Thierry <michel.thierry@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH 2/5] drm/i915: i915_dma_map_single returns positive error codes
Date: Tue, 24 Mar 2015 18:57:13 +0300 [thread overview]
Message-ID: <20150324155713.GG16501@mwanda> (raw)
In-Reply-To: <1427211983-26284-3-git-send-email-michel.thierry@intel.com>
On Tue, Mar 24, 2015 at 03:46:20PM +0000, Michel Thierry wrote:
> i915_dma_map_single relies on dma_mapping_error, which returns positive
> error codes. Found by static checker.
>
> Introduced by commit 678d96fbb3b5995a2fdff2bca5e1ab4a40b7e968
> ("drm/i915: Track GEN6 page table usage").
>
Please give me reporter credit so I can justify my paycheck to my boss.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Cc: Dan Carpenter <dan.carpenter@oracle.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 645c363..79ade6f 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -348,7 +348,7 @@ static struct i915_page_table_entry *alloc_pt_single(struct drm_device *dev)
> goto fail_page;
>
> ret = i915_dma_map_single(pt, dev);
> - if (ret)
> + if (ret != 0)
Heh. What is this? :P You just added a double negative. Just change
to return negative error codes on failure.
regards,
dan carpenter
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-24 15:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-24 15:46 [PATCH 0/5] Finish gen6/7 ppgtt dynamic page allocations Michel Thierry
2015-03-24 15:46 ` [PATCH 1/5] drm/i915: Prevent out of range pt in gen6_for_each_pde Michel Thierry
2015-03-24 15:46 ` [PATCH 2/5] drm/i915: i915_dma_map_single returns positive error codes Michel Thierry
2015-03-24 15:57 ` Dan Carpenter [this message]
2015-03-24 16:03 ` Dan Carpenter
2015-03-24 16:22 ` Michel Thierry
2015-03-24 16:44 ` [PATCH v2] drm/i915: Fix i915_dma_map_single positive error code Michel Thierry
2015-03-24 16:54 ` Daniel Vetter
2015-03-24 21:11 ` shuang.he
2015-03-24 17:06 ` [PATCH v3] " Michel Thierry
2015-03-24 21:10 ` shuang.he
2015-03-24 15:46 ` [PATCH 3/5] drm/i915: Remove unnecessary gen6_ppgtt_unmap_pages Michel Thierry
2015-03-24 15:46 ` [PATCH 4/5] drm/i915: Finish gen6/7 dynamic page table allocation Michel Thierry
2015-03-24 15:46 ` [PATCH 5/5] drm/i915: Add dynamic page trace events Michel Thierry
2015-03-24 19:03 ` shuang.he
2015-03-26 15:43 ` [PATCH 0/5] Finish gen6/7 ppgtt dynamic page allocations Mika Kuoppala
2015-03-27 8:26 ` Daniel Vetter
2015-03-27 15:01 ` Mika Kuoppala
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=20150324155713.GG16501@mwanda \
--to=dan.carpenter@oracle.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=michel.thierry@intel.com \
--cc=mika.kuoppala@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