lkml.org 
[lkml]   [2016]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 12/14] GPU-DRM-OMAP: Move a variable assignment in omap_gem_attach_pages()
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Wed, 21 Sep 2016 17:42:28 +0200

    Move one assignment for the local variable "npages" so that its setting
    will only be performed after a call of the function "drm_gem_get_pages"
    succeeded by this function.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    ---
    drivers/gpu/drm/omapdrm/omap_gem.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
    index 26f1212..3c49ad9 100644
    --- a/drivers/gpu/drm/omapdrm/omap_gem.c
    +++ b/drivers/gpu/drm/omapdrm/omap_gem.c
    @@ -243,7 +243,7 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj)
    struct drm_device *dev = obj->dev;
    struct omap_gem_object *omap_obj = to_omap_bo(obj);
    struct page **pages;
    - int npages = obj->size >> PAGE_SHIFT;
    + int npages;
    int i, ret;
    dma_addr_t *addrs;

    @@ -255,6 +255,8 @@ static int omap_gem_attach_pages(struct drm_gem_object *obj)
    return PTR_ERR(pages);
    }

    + npages = obj->size >> PAGE_SHIFT;
    +
    /* for non-cached buffers, ensure the new pages are clean because
    * DSS, GPU, etc. are not cache coherent:
    */
    --
    2.10.0
    \
     
     \ /
      Last update: 2016-09-23 00:00    [W:3.858 / U:0.288 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site