Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/6] drm/i915/uc: mark structure passed to checker functions as const
Date: Fri, 28 Feb 2020 11:18:46 +0200	[thread overview]
Message-ID: <877e07qdc9.fsf@intel.com> (raw)
In-Reply-To: <20200228022843.1936-3-daniele.ceraolospurio@intel.com>

On Thu, 27 Feb 2020, Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> wrote:
> Follow-up patches will pass const objects from debugfs to some those
> functions, so we need to be ready.
>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gt.h             |  6 +++---
>  drivers/gpu/drm/i915/gt/uc/intel_guc.h         | 10 +++++-----
>  drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h      |  2 +-
>  .../gpu/drm/i915/gt/uc/intel_guc_submission.h  |  6 +++---
>  drivers/gpu/drm/i915/gt/uc/intel_huc.h         |  8 ++++----
>  drivers/gpu/drm/i915/gt/uc/intel_uc.h          |  2 +-
>  drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h       | 18 +++++++++---------
>  7 files changed, 26 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.h b/drivers/gpu/drm/i915/gt/intel_gt.h
> index 4fac043750aa..f9fbe645478d 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt.h
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.h
> @@ -18,17 +18,17 @@ struct drm_i915_private;
>  		  ##__VA_ARGS__);					\
>  } while (0)
>  
> -static inline struct intel_gt *uc_to_gt(struct intel_uc *uc)
> +static inline struct intel_gt *uc_to_gt(const struct intel_uc *uc)
>  {
>  	return container_of(uc, struct intel_gt, uc);
>  }
>  
> -static inline struct intel_gt *guc_to_gt(struct intel_guc *guc)
> +static inline struct intel_gt *guc_to_gt(const struct intel_guc *guc)
>  {
>  	return container_of(guc, struct intel_gt, uc.guc);
>  }
>  
> -static inline struct intel_gt *huc_to_gt(struct intel_huc *huc)
> +static inline struct intel_gt *huc_to_gt(const struct intel_huc *huc)
>  {
>  	return container_of(huc, struct intel_gt, uc.huc);
>  }

Not fond of the fact that these cast the const away. If you can return
const also, fine, but const in, non-const out is not fine.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-02-28  9:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28  2:28 [Intel-gfx] [PATCH 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
2020-02-28  2:28 ` [Intel-gfx] [PATCH 1/6] drm/i915/guc: drop stage_pool debugfs Daniele Ceraolo Spurio
2020-02-28  2:28 ` [Intel-gfx] [PATCH 2/6] drm/i915/uc: mark structure passed to checker functions as const Daniele Ceraolo Spurio
2020-02-28  9:18   ` Jani Nikula [this message]
2020-02-29  0:20     ` Daniele Ceraolo Spurio
2020-03-04  9:56       ` Jani Nikula
2020-02-28  2:28 ` [Intel-gfx] [PATCH 3/6] drm/i915/huc: make "support huc" reflect HW capabilities Daniele Ceraolo Spurio
2020-02-28  2:28 ` [Intel-gfx] [PATCH 4/6] drm/i915/debugfs: move uC printers and update debugfs file names Daniele Ceraolo Spurio
     [not found]   ` <be6dd380-e87b-9ac7-0185-c3c46e40240b@intel.com>
2020-03-11 23:38     ` Daniele Ceraolo Spurio
2020-02-28  2:28 ` [Intel-gfx] [PATCH 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT Daniele Ceraolo Spurio
2020-02-28  9:24   ` Jani Nikula
2020-03-03  1:52   ` Andi Shyti
2020-03-03 22:13     ` Daniele Ceraolo Spurio
2020-03-05 18:02       ` Andi Shyti
2020-03-05 23:10         ` Daniele Ceraolo Spurio
2020-02-28  2:28 ` [Intel-gfx] [PATCH 6/6] drm/i915/uc: do not free err log on uc_fini Daniele Ceraolo Spurio
2020-02-28  5:54 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Re-org uC debugfs files and move them under GT Patchwork
2020-02-28  5:58 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-02-28  6:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-02-29 16:42 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=877e07qdc9.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox