| Message ID | 33ec8080594f9f4ef1d50e36497339c9a6897393.1793027261.git.d@ilvokhin.com |
|---|---|
| State | New |
| Headers | show |
| Series | treewide: switch to __nonnull_args() macro | expand |
On Wed, 28 Oct 2026, Andi Shyti <andi.shyti@kernel.org> wrote: > Hi Dmitry, > > On Wed, Oct 28, 2026 at 08:19:44AM +0000, Dmitry Ilvokhin wrote: >> Commit 22302af28d3f ("cleanup: Annotate guard constructors with >> nonnull") added the macro __nonnull_args() to wrap raw compiler >> attribute. >> >> Replace __attribute__((nonnull)) with __nonnull_args() to standardize >> nonnull attribute usage across the tree and keep the attribute's quirks >> in one place rather than open-coded at every call site. >> >> Suggested-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> >> Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> > > Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Pushed this patch to drm-intel-next, thanks for the patch and review. BR, Jani.
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h index a2f4b6758a65..648d0b4139cf 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h @@ -127,7 +127,7 @@ __deprecated struct drm_gem_object * drm_gem_object_lookup(struct drm_file *file, u32 handle); -__attribute__((nonnull)) +__nonnull_args() static inline struct drm_i915_gem_object * i915_gem_object_get(struct drm_i915_gem_object *obj) { @@ -135,7 +135,7 @@ i915_gem_object_get(struct drm_i915_gem_object *obj) return obj; } -__attribute__((nonnull)) +__nonnull_args() static inline void i915_gem_object_put(struct drm_i915_gem_object *obj) { diff --git a/drivers/gpu/drm/i915/i915_request.h b/drivers/gpu/drm/i915/i915_request.h index b09135301f39..f559203c332d 100644 --- a/drivers/gpu/drm/i915/i915_request.h +++ b/drivers/gpu/drm/i915/i915_request.h @@ -437,12 +437,12 @@ void i915_request_cancel(struct i915_request *rq, int error); long i915_request_wait_timeout(struct i915_request *rq, unsigned int flags, long timeout) - __attribute__((nonnull(1))); + __nonnull_args(1); long i915_request_wait(struct i915_request *rq, unsigned int flags, long timeout) - __attribute__((nonnull(1))); + __nonnull_args(1); #define I915_WAIT_INTERRUPTIBLE BIT(0) #define I915_WAIT_PRIORITY BIT(1) /* small priority bump for the request */ #define I915_WAIT_ALL BIT(2) /* used by i915_gem_object_wait() */
Commit 22302af28d3f ("cleanup: Annotate guard constructors with nonnull") added the macro __nonnull_args() to wrap raw compiler attribute. Replace __attribute__((nonnull)) with __nonnull_args() to standardize nonnull attribute usage across the tree and keep the attribute's quirks in one place rather than open-coded at every call site. Suggested-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> --- drivers/gpu/drm/i915/gem/i915_gem_object.h | 4 ++-- drivers/gpu/drm/i915/i915_request.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)