✗ CI.checkpatch: warning for series starting with [v1,1/1] drm/xe: fix the ERR_PTR() returned on failure to allocate tiny pt

Patchwork patchwork at emeril.freedesktop.org
Mon Nov 25 12:06:01 UTC 2024


== Series Details ==

Series: series starting with [v1,1/1] drm/xe: fix the ERR_PTR() returned on failure to allocate tiny pt
URL   : https://patchwork.freedesktop.org/series/141746/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
30ab6715fc09baee6cc14cb3c89ad8858688d474
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 6ef1c04fad1e1eaaa2547847b07f90231a842293
Author: Mirsad Todorovac <mtodorovac69 at gmail.com>
Date:   Thu Nov 21 22:20:58 2024 +0100

    drm/xe: fix the ERR_PTR() returned on failure to allocate tiny pt
    
    Running coccinelle spatch gave the following warning:
    
    ./drivers/gpu/drm/xe/tests/xe_migrate.c:226:5-11: inconsistent IS_ERR and PTR_ERR on line 228.
    
    The code reports PTR_ERR(pt) when IS_ERR(tiny) is checked:
    
    → 211         pt = xe_bo_create_pin_map(xe, tile, m->q->vm, XE_PAGE_SIZE,
      212                                   ttm_bo_type_kernel,
      213                                   XE_BO_FLAG_VRAM_IF_DGFX(tile) |
      214                                   XE_BO_FLAG_PINNED);
      215         if (IS_ERR(pt)) {
      216                 KUNIT_FAIL(test, "Failed to allocate fake pt: %li\n",
      217                            PTR_ERR(pt));
      218                 goto free_big;
      219         }
      220
      221         tiny = xe_bo_create_pin_map(xe, tile, m->q->vm,
    → 222                                     2 * SZ_4K,
      223                                     ttm_bo_type_kernel,
      224                                     XE_BO_FLAG_VRAM_IF_DGFX(tile) |
      225                                     XE_BO_FLAG_PINNED);
    → 226         if (IS_ERR(tiny)) {
    → 227                 KUNIT_FAIL(test, "Failed to allocate fake pt: %li\n",
    → 228                            PTR_ERR(pt));
      229                 goto free_pt;
      230         }
    
    Now, the IS_ERR(tiny) and the corresponding PTR_ERR(pt) do not match.
    
    Returning PTR_ERR(tiny), as the last failed function call, seems logical.
    
    Fixes: dd08ebf6c3525 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
    Cc: Matthew Brost <matthew.brost at intel.com>
    Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
    Cc: Matthew Auld <matthew.auld at intel.com>
    Cc: Matt Roper <matthew.d.roper at intel.com>
    Cc: "Thomas Hellström" <thomas.hellstrom at linux.intel.com>
    Cc: Francois Dugast <francois.dugast at intel.com>
    Cc: Lucas De Marchi <lucas.demarchi at intel.com>
    Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
    Cc: Philippe Lecluse <philippe.lecluse at intel.com>
    Cc: Nirmoy Das <nirmoy.das at intel.com>
    Cc: Jani Nikula <jani.nikula at intel.com>
    Cc: José Roberto de Souza <jose.souza at intel.com>
    Cc: David Airlie <airlied at gmail.com>
    Cc: Maxime Ripard <mripard at kernel.org>
    Cc: Faith Ekstrand <faith.ekstrand at collabora.com>
    Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
    Cc: Simona Vetter <simona at ffwll.ch>
    Cc: Mauro Carvalho Chehab <mchehab at kernel.org>
    Cc: Thomas Zimmermann <tzimmermann at suse.de>
    Cc: Akshata Jahagirdar <akshata.jahagirdar at intel.com>
    Cc: David Kershner <david.kershner at intel.com>
    Cc: intel-xe at lists.freedesktop.org
    Cc: dri-devel at lists.freedesktop.org
    Cc: linux-kernel at vger.kernel.org
    Signed-off-by: Mirsad Todorovac <mtodorovac69 at gmail.com>
+ /mt/dim checkpatch b21f1413ea1860e80fd278112e820e6dadfc9df9 drm-intel
6ef1c04fad1e drm/xe: fix the ERR_PTR() returned on failure to allocate tiny pt
-:32: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#32: 
→ 227                 KUNIT_FAIL(test, "Failed to allocate fake pt: %li\n",

-:41: WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")'
#41: 
Fixes: dd08ebf6c3525 ("drm/xe: Introduce a new DRM driver for Intel GPUs")

total: 0 errors, 2 warnings, 0 checks, 10 lines checked




More information about the Intel-xe mailing list