Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nilawar, Badal" <badal.nilawar@intel.com>
To: Karthik Poosa <karthik.poosa@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: <anshuman.gupta@intel.com>, <rodrigo.vivi@intel.com>,
	<lucas.demarchi@intel.com>
Subject: Re: [PATCH v6 1/4] drm/xe: Define XE_REG_IS_VALID
Date: Thu, 4 Apr 2024 18:36:10 +0530	[thread overview]
Message-ID: <3a33ab35-2a92-482d-8ba4-b74e08df52e8@intel.com> (raw)
In-Reply-To: <20240404100827.1109447-2-karthik.poosa@intel.com>



On 04-04-2024 15:38, Karthik Poosa wrote:
> Add macro to check if struct xe_reg has valid address.
> 
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Badal Nilawar <badal.nilawar@intel.com>
> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
> ---
>   drivers/gpu/drm/xe/regs/xe_reg_defs.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/regs/xe_reg_defs.h b/drivers/gpu/drm/xe/regs/xe_reg_defs.h
> index c89ef2b79a3f..42078643be6b 100644
> --- a/drivers/gpu/drm/xe/regs/xe_reg_defs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_reg_defs.h
> @@ -131,4 +131,6 @@ struct xe_reg_mcr {
>   				 .__reg = XE_REG_INITIALIZER(r_,  ##__VA_ARGS__, .mcr = 1)	\
>   				 })
>   
> +#define XE_REG_IS_VALID(r)	((r.addr) ? true : false From patch 2 intention of adding this is to abstract the use of struct 
xe_reg. Since this is macro I don't think this is real abstraction. How 
about using inline function instead of macro?

inline bool xe_reg_is_valid(struct xe_reg)
{
	return (r.raw ? true : false);
}

Badal
> +
>   #endif

  reply	other threads:[~2024-04-04 13:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 10:08 [PATCH v6 0/4] drm/xe/hwmon: Update xe hwmon with couple of fixes Karthik Poosa
2024-04-04 10:04 ` ✓ CI.Patch_applied: success for drm/xe/hwmon: Update xe hwmon with couple of fixes (rev6) Patchwork
2024-04-04 10:04 ` ✓ CI.checkpatch: " Patchwork
2024-04-04 10:06 ` ✓ CI.KUnit: " Patchwork
2024-04-04 10:08 ` [PATCH v6 1/4] drm/xe: Define XE_REG_IS_VALID Karthik Poosa
2024-04-04 13:06   ` Nilawar, Badal [this message]
2024-04-04 13:11     ` Lucas De Marchi
2024-04-04 10:08 ` [PATCH v6 2/4] drm/xe/hwmon: Update xe_hwmon_get_reg to return struct xe_reg Karthik Poosa
2024-04-04 10:08 ` [PATCH v6 3/4] drm/xe/hwmon: Update xe_hwmon_process_reg Karthik Poosa
2024-04-05  7:28   ` Riana Tauro
2024-04-04 10:08 ` [PATCH v6 4/4] drm/xe/hwmon: Cast to output precision before multiplying operands Karthik Poosa
2024-04-04 10:18 ` ✓ CI.Build: success for drm/xe/hwmon: Update xe hwmon with couple of fixes (rev6) Patchwork
2024-04-04 10:20 ` ✓ CI.Hooks: " Patchwork
2024-04-04 10:22 ` ✓ CI.checksparse: " 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=3a33ab35-2a92-482d-8ba4-b74e08df52e8@intel.com \
    --to=badal.nilawar@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=karthik.poosa@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox