All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: benjamin.widawsky@intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: drm/i915: Track GEN6 page table usage
Date: Mon, 23 Mar 2015 18:54:32 +0300	[thread overview]
Message-ID: <20150323155431.GA24038@mwanda> (raw)

Hello Ben Widawsky,

The patch 678d96fbb3b5: "drm/i915: Track GEN6 page table usage" from
Mar 16, 2015, leads to the following static checker warning:

	drivers/gpu/drm/i915/i915_gem_gtt.c:363 alloc_pt_single()
	error: passing non negative 1 to ERR_PTR

drivers/gpu/drm/i915/i915_gem_gtt.c
   292  
   293  /**
   294   * i915_dma_map_single() - Create a dma mapping for a page table/dir/etc.
   295   * @px: Page table/dir/etc to get a DMA map for
   296   * @dev:        drm device
   297   *
   298   * Page table allocations are unified across all gens. They always require a
   299   * single 4k allocation, as well as a DMA mapping. If we keep the structs
   300   * symmetric here, the simple macro covers us for every page table type.
   301   *
   302   * Return: 0 if success.
   303   */
   304  #define i915_dma_map_single(px, dev) \
   305          i915_dma_map_page_single((px)->page, (dev), &(px)->daddr)
   306  
   307  static inline int i915_dma_map_page_single(struct page *page,
   308                                             struct drm_device *dev,
   309                                             dma_addr_t *daddr)
   310  {
   311          struct device *device = &dev->pdev->dev;
   312  
   313          *daddr = dma_map_page(device, page, 0, 4096, PCI_DMA_BIDIRECTIONAL);
   314          return dma_mapping_error(device, *daddr);
                       ^^^^^^^^^^^^^^^^^
This function returns 1 on failure but the callers expect a negative
error code.

   315  }

regards,
dan carpenter
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2015-03-23 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 15:54 Dan Carpenter [this message]
2015-03-24  9:11 ` drm/i915: Track GEN6 page table usage Daniel Vetter

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=20150323155431.GA24038@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=benjamin.widawsky@intel.com \
    --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.