diff options
| author | Jani Nikula <jani.nikula@intel.com> | 2025-06-09 12:40:46 +0300 | 
|---|---|---|
| committer | Jani Nikula <jani.nikula@intel.com> | 2025-06-09 12:40:46 +0300 | 
| commit | 34c55367af96f62e89221444f04487440ebc6487 (patch) | |
| tree | fdb36ba67d7dea09455b55037e26043b7e051ef9 /include/linux/xarray.h | |
| parent | 7247efca0dcbc8ac6147db9200ed1549c0662465 (diff) | |
| parent | 19272b37aa4f83ca52bdf9c16d5d81bdd1354494 (diff) | |
| download | linux-34c55367af96f62e89221444f04487440ebc6487.tar.xz | |
Merge drm/drm-next into drm-intel-next
Sync to v6.16-rc1, among other things to get the fixed size GENMASK_U*()
and BIT_U*() macros.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'include/linux/xarray.h')
| -rw-r--r-- | include/linux/xarray.h | 24 | 
1 files changed, 15 insertions, 9 deletions
diff --git a/include/linux/xarray.h b/include/linux/xarray.h index 78eede109b1a..be850174e802 100644 --- a/include/linux/xarray.h +++ b/include/linux/xarray.h @@ -965,10 +965,12 @@ static inline int __must_check xa_alloc_irq(struct xarray *xa, u32 *id,   * Must only be operated on an xarray initialized with flag XA_FLAGS_ALLOC set   * in xa_init_flags().   * + * Note that callers interested in whether wrapping has occurred should + * use __xa_alloc_cyclic() instead. + *   * Context: Any context.  Takes and releases the xa_lock.  May sleep if   * the @gfp flags permit. - * Return: 0 if the allocation succeeded without wrapping.  1 if the - * allocation succeeded after wrapping, -ENOMEM if memory could not be + * Return: 0 if the allocation succeeded, -ENOMEM if memory could not be   * allocated or -EBUSY if there are no free entries in @limit.   */  static inline int xa_alloc_cyclic(struct xarray *xa, u32 *id, void *entry, @@ -981,7 +983,7 @@ static inline int xa_alloc_cyclic(struct xarray *xa, u32 *id, void *entry,  	err = __xa_alloc_cyclic(xa, id, entry, limit, next, gfp);  	xa_unlock(xa); -	return err; +	return err < 0 ? err : 0;  }  /** @@ -1002,10 +1004,12 @@ static inline int xa_alloc_cyclic(struct xarray *xa, u32 *id, void *entry,   * Must only be operated on an xarray initialized with flag XA_FLAGS_ALLOC set   * in xa_init_flags().   * + * Note that callers interested in whether wrapping has occurred should + * use __xa_alloc_cyclic() instead. + *   * Context: Any context.  Takes and releases the xa_lock while   * disabling softirqs.  May sleep if the @gfp flags permit. - * Return: 0 if the allocation succeeded without wrapping.  1 if the - * allocation succeeded after wrapping, -ENOMEM if memory could not be + * Return: 0 if the allocation succeeded, -ENOMEM if memory could not be   * allocated or -EBUSY if there are no free entries in @limit.   */  static inline int xa_alloc_cyclic_bh(struct xarray *xa, u32 *id, void *entry, @@ -1018,7 +1022,7 @@ static inline int xa_alloc_cyclic_bh(struct xarray *xa, u32 *id, void *entry,  	err = __xa_alloc_cyclic(xa, id, entry, limit, next, gfp);  	xa_unlock_bh(xa); -	return err; +	return err < 0 ? err : 0;  }  /** @@ -1039,10 +1043,12 @@ static inline int xa_alloc_cyclic_bh(struct xarray *xa, u32 *id, void *entry,   * Must only be operated on an xarray initialized with flag XA_FLAGS_ALLOC set   * in xa_init_flags().   * + * Note that callers interested in whether wrapping has occurred should + * use __xa_alloc_cyclic() instead. + *   * Context: Process context.  Takes and releases the xa_lock while   * disabling interrupts.  May sleep if the @gfp flags permit. - * Return: 0 if the allocation succeeded without wrapping.  1 if the - * allocation succeeded after wrapping, -ENOMEM if memory could not be + * Return: 0 if the allocation succeeded, -ENOMEM if memory could not be   * allocated or -EBUSY if there are no free entries in @limit.   */  static inline int xa_alloc_cyclic_irq(struct xarray *xa, u32 *id, void *entry, @@ -1055,7 +1061,7 @@ static inline int xa_alloc_cyclic_irq(struct xarray *xa, u32 *id, void *entry,  	err = __xa_alloc_cyclic(xa, id, entry, limit, next, gfp);  	xa_unlock_irq(xa); -	return err; +	return err < 0 ? err : 0;  }  /**  | 
