Re: [PATCH v3 1/2] drm/i915/gt: Split intel-gtt functions by arch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 29 Mar 2022, Casey Bowman <casey.g.bowman@xxxxxxxxx> wrote:
> +/* Stubs for non-x86 platforms */
> +#else
> +static inline void intel_gt_gmch_gen5_chipset_flush(struct intel_gt *gt)
> +{
> +}
> +static inline int intel_gt_gmch_gen5_probe(struct i915_ggtt *ggtt)
> +{
> +	/* No HW should be probed for this case yet, return fail */
> +	return -1;
> +}
> +static inline int intel_gt_gmch_gen6_probe(struct i915_ggtt *ggtt)
> +{
> +	/* No HW should be probed for this case yet, return fail */
> +	return -1;
> +}
> +static inline int intel_gt_gmch_gen8_probe(struct i915_ggtt *ggtt)
> +{
> +	/* No HW should be probed for this case yet, return fail */
> +	return -1;
> +}
> +static inline int intel_gt_gmch_gen5_enable_hw(struct drm_i915_private *i915)
> +{
> +	/* No HW should be enabled for this case yet, return fail */
> +	return -1;
> +}
> +#endif

Never use magic -1 for negative errno returns. That's -EPERM and not
what you mean. -ENODEV or -EINVAL are better here.

(As an exception, returning -1 is *maybe* fine for functions that return
an index or something, and have zero chance of propagating to somewhere
that actually interprets the number as a negative errno.)

BR,
Jani.

-- 
Jani Nikula, Intel Open Source Graphics Center



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux