All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Andi Shyti <andi.shyti@linux.intel.com>,
	Intel GFX <intel-gfx@lists.freedesktop.org>,
	DRI Devel <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Fix use of static in macro mismatch
Date: Wed, 11 May 2022 11:58:21 +0300	[thread overview]
Message-ID: <87pmkkigya.fsf@intel.com> (raw)
In-Reply-To: <20220510140447.80200-1-andi.shyti@linux.intel.com>

On Tue, 10 May 2022, Andi Shyti <andi.shyti@linux.intel.com> wrote:
> The INTEL_GT_RPS_SYSFS_ATTR was creating to different structures
> but. When called with the "static" keyword this is affecting only
> the first structure, while the second is created as non static.
>
> Move the static keyword inside the macros to affect both the
> structures.
>
> Reported-by: Jani Nikula <jani.nikula@linux.intel.com>
> Fixes: 56a709cf77468 ("drm/i915/gt: Create per-tile RPS sysfs interfaces")
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c
> index e92990d514b24..f76b6cf8040ec 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c
> @@ -457,22 +457,23 @@ static ssize_t vlv_rpe_freq_mhz_show(struct device *dev,
>  }
>  
>  #define INTEL_GT_RPS_SYSFS_ATTR(_name, _mode, _show, _store) \
> -	struct device_attribute dev_attr_gt_##_name = __ATTR(gt_##_name, _mode, _show, _store); \
> -	struct device_attribute dev_attr_rps_##_name = __ATTR(rps_##_name, _mode, _show, _store)
> +	static struct device_attribute dev_attr_gt_##_name = __ATTR(gt_##_name, _mode, _show, _store); \
> +	static struct device_attribute dev_attr_rps_##_name = __ATTR(rps_##_name, _mode, _show, _store)
>  
>  #define INTEL_GT_RPS_SYSFS_ATTR_RO(_name)				\
>  		INTEL_GT_RPS_SYSFS_ATTR(_name, 0444, _name##_show, NULL)
>  #define INTEL_GT_RPS_SYSFS_ATTR_RW(_name)				\
>  		INTEL_GT_RPS_SYSFS_ATTR(_name, 0644, _name##_show, _name##_store)
>  
> -static INTEL_GT_RPS_SYSFS_ATTR_RO(act_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RO(cur_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RW(boost_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RO(RP0_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RO(RP1_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RO(RPn_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RW(max_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RW(min_freq_mhz);
> +/* The below macros generate static structures */
> +INTEL_GT_RPS_SYSFS_ATTR_RO(act_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RO(cur_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RW(boost_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RO(RP0_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RO(RP1_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RO(RPn_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RW(max_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RW(min_freq_mhz);
>  
>  static DEVICE_ATTR_RO(vlv_rpe_freq_mhz);

-- 
Jani Nikula, Intel Open Source Graphics Center

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Andi Shyti <andi.shyti@linux.intel.com>,
	Intel GFX <intel-gfx@lists.freedesktop.org>,
	DRI Devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/gt: Fix use of static in macro mismatch
Date: Wed, 11 May 2022 11:58:21 +0300	[thread overview]
Message-ID: <87pmkkigya.fsf@intel.com> (raw)
In-Reply-To: <20220510140447.80200-1-andi.shyti@linux.intel.com>

On Tue, 10 May 2022, Andi Shyti <andi.shyti@linux.intel.com> wrote:
> The INTEL_GT_RPS_SYSFS_ATTR was creating to different structures
> but. When called with the "static" keyword this is affecting only
> the first structure, while the second is created as non static.
>
> Move the static keyword inside the macros to affect both the
> structures.
>
> Reported-by: Jani Nikula <jani.nikula@linux.intel.com>
> Fixes: 56a709cf77468 ("drm/i915/gt: Create per-tile RPS sysfs interfaces")
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c
> index e92990d514b24..f76b6cf8040ec 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c
> @@ -457,22 +457,23 @@ static ssize_t vlv_rpe_freq_mhz_show(struct device *dev,
>  }
>  
>  #define INTEL_GT_RPS_SYSFS_ATTR(_name, _mode, _show, _store) \
> -	struct device_attribute dev_attr_gt_##_name = __ATTR(gt_##_name, _mode, _show, _store); \
> -	struct device_attribute dev_attr_rps_##_name = __ATTR(rps_##_name, _mode, _show, _store)
> +	static struct device_attribute dev_attr_gt_##_name = __ATTR(gt_##_name, _mode, _show, _store); \
> +	static struct device_attribute dev_attr_rps_##_name = __ATTR(rps_##_name, _mode, _show, _store)
>  
>  #define INTEL_GT_RPS_SYSFS_ATTR_RO(_name)				\
>  		INTEL_GT_RPS_SYSFS_ATTR(_name, 0444, _name##_show, NULL)
>  #define INTEL_GT_RPS_SYSFS_ATTR_RW(_name)				\
>  		INTEL_GT_RPS_SYSFS_ATTR(_name, 0644, _name##_show, _name##_store)
>  
> -static INTEL_GT_RPS_SYSFS_ATTR_RO(act_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RO(cur_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RW(boost_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RO(RP0_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RO(RP1_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RO(RPn_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RW(max_freq_mhz);
> -static INTEL_GT_RPS_SYSFS_ATTR_RW(min_freq_mhz);
> +/* The below macros generate static structures */
> +INTEL_GT_RPS_SYSFS_ATTR_RO(act_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RO(cur_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RW(boost_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RO(RP0_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RO(RP1_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RO(RPn_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RW(max_freq_mhz);
> +INTEL_GT_RPS_SYSFS_ATTR_RW(min_freq_mhz);
>  
>  static DEVICE_ATTR_RO(vlv_rpe_freq_mhz);

-- 
Jani Nikula, Intel Open Source Graphics Center

  parent reply	other threads:[~2022-05-11  8:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 14:04 [Intel-gfx] [PATCH] drm/i915/gt: Fix use of static in macro mismatch Andi Shyti
2022-05-10 14:04 ` Andi Shyti
2022-05-10 16:28 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-05-10 16:47 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-10 19:42 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-05-11  8:58 ` Jani Nikula [this message]
2022-05-11  8:58   ` [PATCH] " Jani Nikula

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=87pmkkigya.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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 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.