From: Jani Nikula <jani.nikula@linux.intel.com>
To: Casey Bowman <casey.g.bowman@intel.com>, intel-gfx@lists.freedesktop.org
Cc: thomas.hellstrom@linux.intel.com, lucas.demarchi@intel.com,
chris@chris-wilson.co.uk
Subject: Re: [Intel-gfx] [PATCH v3 1/2] drm/i915/gt: Split intel-gtt functions by arch
Date: Wed, 30 Mar 2022 13:16:26 +0300 [thread overview]
Message-ID: <874k3fd9tx.fsf@intel.com> (raw)
In-Reply-To: <20220329235830.1025100-2-casey.g.bowman@intel.com>
On Tue, 29 Mar 2022, Casey Bowman <casey.g.bowman@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
next prev parent reply other threads:[~2022-03-30 10:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-29 23:58 [Intel-gfx] [PATCH v3 0/2] Splitting intel-gtt calls for non-x86 platforms Casey Bowman
2022-03-29 23:58 ` [Intel-gfx] [PATCH v3 1/2] drm/i915/gt: Split intel-gtt functions by arch Casey Bowman
2022-03-30 9:55 ` Tvrtko Ursulin
2022-03-30 10:23 ` Jani Nikula
2022-03-30 16:31 ` Casey Bowman
2022-03-30 16:42 ` Casey Bowman
2022-03-30 17:25 ` Jani Nikula
2022-03-30 18:36 ` Casey Bowman
2022-03-30 10:16 ` Jani Nikula [this message]
2022-03-30 16:32 ` Casey Bowman
2022-03-29 23:58 ` [Intel-gfx] [PATCH v3 2/2] drm/i915: Require INTEL_GTT to depend on X86 Casey Bowman
2022-03-30 0:27 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Splitting intel-gtt calls for non-x86 platforms (rev3) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874k3fd9tx.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=casey.g.bowman@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=thomas.hellstrom@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.