Skip to content
  • Ville Syrjälä's avatar
    Sprinkle igt_assert(ptr) after gem_mmap__{cpu,gtt,wc} · 7eaae3c2
    Ville Syrjälä authored
    
    
    Do the following
     ptr = gem_mmap__{cpu,gtt,wc}()
    +igt_assert(ptr);
    
    whenever the code doesn't handle the NULL ptr in any kind of
    specific way.
    
    Makes it easier to move the assert into gem_mmap__{cpu,gtt,wc}() itself.
    
    Mostly done with coccinelle, with some manual cleanups:
    @@
    identifier I;
    @@
    <... when != igt_assert(I)
         when != igt_require(I)
         when != igt_require_f(I, ...)
         when != I != NULL
         when != I == NULL
    (
      I = gem_mmap__gtt(...);
    + igt_assert(I);
    |
      I = gem_mmap__cpu(...);
    + igt_assert(I);
    |
      I = gem_mmap__wc(...);
    + igt_assert(I);
    )
    ...>
    
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Stochastically-reviwewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    7eaae3c2