[Intel-gfx] [PATCH v3 1/2] drm/i915/gt: Split intel-gtt functions by arch
Jani Nikula
jani.nikula at linux.intel.com
Wed Mar 30 10:16:26 UTC 2022
On Tue, 29 Mar 2022, Casey Bowman <casey.g.bowman at intel.com> 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
More information about the Intel-gfx
mailing list