From: Casey Bowman <casey.g.bowman@intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
<intel-gfx@lists.freedesktop.org>
Cc: thomas.hellstrom@linux.intel.com, chris@chris-wilson.co.uk,
lucas.demarchi@intel.com
Subject: Re: [Intel-gfx] [PATCH v3 1/2] drm/i915/gt: Split intel-gtt functions by arch
Date: Wed, 30 Mar 2022 09:32:55 -0700 [thread overview]
Message-ID: <904b27d6-d4ad-c032-5bc0-e4de2c8e2fb2@intel.com> (raw)
In-Reply-To: <874k3fd9tx.fsf@intel.com>
On 3/30/22 03:16, Jani Nikula wrote:
> 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.
>
Thanks for pointing this out, the error codes slipped my mind when
creating these stubs. I'll fix that.
Regards,
Casey
next prev parent reply other threads:[~2022-03-30 16:33 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
2022-03-30 16:32 ` Casey Bowman [this message]
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=904b27d6-d4ad-c032-5bc0-e4de2c8e2fb2@intel.com \
--to=casey.g.bowman@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--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.