All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: amd-pmc: Shuffle location of amd_pmc_get_smu_version()
@ 2022-04-18 21:38 Nathan Chancellor
  2022-04-18 22:02 ` Limonciello, Mario
  2022-04-27 14:25 ` Hans de Goede
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2022-04-18 21:38 UTC (permalink / raw)
  To: Shyam Sundar S K, Mario Limonciello, Hans de Goede, Mark Gross
  Cc: platform-driver-x86, linux-kernel, patches, Nathan Chancellor

When CONFIG_DEBUG_FS is disabled, amd_pmc_get_smu_version() is unused:

  drivers/platform/x86/amd-pmc.c:196:12: warning: unused function 'amd_pmc_get_smu_version' [-Wunused-function]
  static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
             ^
  1 warning generated.

Eliminate the warning by moving amd_pmc_get_smu_version() to the
CONFIG_DEBUG_FS block where it is used.

Fixes: b0c07116c894 ("platform/x86: amd-pmc: Avoid reading SMU version at probe time")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/platform/x86/amd-pmc.c | 40 +++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
index 668a1d6c11ee..e266492d3ef7 100644
--- a/drivers/platform/x86/amd-pmc.c
+++ b/drivers/platform/x86/amd-pmc.c
@@ -193,26 +193,6 @@ struct smu_metrics {
 	u64 timecondition_notmet_totaltime[SOC_SUBSYSTEM_IP_MAX];
 } __packed;
 
-static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
-{
-	int rc;
-	u32 val;
-
-	rc = amd_pmc_send_cmd(dev, 0, &val, SMU_MSG_GETSMUVERSION, 1);
-	if (rc)
-		return rc;
-
-	dev->smu_program = (val >> 24) & GENMASK(7, 0);
-	dev->major = (val >> 16) & GENMASK(7, 0);
-	dev->minor = (val >> 8) & GENMASK(7, 0);
-	dev->rev = (val >> 0) & GENMASK(7, 0);
-
-	dev_dbg(dev->dev, "SMU program %u version is %u.%u.%u\n",
-		dev->smu_program, dev->major, dev->minor, dev->rev);
-
-	return 0;
-}
-
 static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp)
 {
 	struct amd_pmc_dev *dev = filp->f_inode->i_private;
@@ -417,6 +397,26 @@ static int s0ix_stats_show(struct seq_file *s, void *unused)
 }
 DEFINE_SHOW_ATTRIBUTE(s0ix_stats);
 
+static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
+{
+	int rc;
+	u32 val;
+
+	rc = amd_pmc_send_cmd(dev, 0, &val, SMU_MSG_GETSMUVERSION, 1);
+	if (rc)
+		return rc;
+
+	dev->smu_program = (val >> 24) & GENMASK(7, 0);
+	dev->major = (val >> 16) & GENMASK(7, 0);
+	dev->minor = (val >> 8) & GENMASK(7, 0);
+	dev->rev = (val >> 0) & GENMASK(7, 0);
+
+	dev_dbg(dev->dev, "SMU program %u version is %u.%u.%u\n",
+		dev->smu_program, dev->major, dev->minor, dev->rev);
+
+	return 0;
+}
+
 static int amd_pmc_idlemask_show(struct seq_file *s, void *unused)
 {
 	struct amd_pmc_dev *dev = s->private;

base-commit: b0c07116c894325d40a218f558047f925e4b3bdb
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] platform/x86: amd-pmc: Shuffle location of amd_pmc_get_smu_version()
  2022-04-18 21:38 [PATCH] platform/x86: amd-pmc: Shuffle location of amd_pmc_get_smu_version() Nathan Chancellor
@ 2022-04-18 22:02 ` Limonciello, Mario
  2022-04-27 14:25 ` Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Limonciello, Mario @ 2022-04-18 22:02 UTC (permalink / raw)
  To: Nathan Chancellor, S-k, Shyam-sundar, Hans de Goede, Mark Gross
  Cc: platform-driver-x86, linux-kernel, patches

[Public]



> -----Original Message-----
> From: Nathan Chancellor <nathan@kernel.org>
> Sent: Monday, April 18, 2022 16:38
> To: S-k, Shyam-sundar <Shyam-sundar.S-k@amd.com>; Limonciello, Mario
> <Mario.Limonciello@amd.com>; Hans de Goede <hdegoede@redhat.com>;
> Mark Gross <markgross@kernel.org>
> Cc: platform-driver-x86@vger.kernel.org; linux-kernel@vger.kernel.org;
> patches@lists.linux.dev; Nathan Chancellor <nathan@kernel.org>
> Subject: [PATCH] platform/x86: amd-pmc: Shuffle location of
> amd_pmc_get_smu_version()
> 
> When CONFIG_DEBUG_FS is disabled, amd_pmc_get_smu_version() is unused:
> 
>   drivers/platform/x86/amd-pmc.c:196:12: warning: unused function
> 'amd_pmc_get_smu_version' [-Wunused-function]
>   static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
>              ^
>   1 warning generated.
> 
> Eliminate the warning by moving amd_pmc_get_smu_version() to the
> CONFIG_DEBUG_FS block where it is used.
> 
> Fixes: b0c07116c894 ("platform/x86: amd-pmc: Avoid reading SMU version at
> probe time")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

> ---
>  drivers/platform/x86/amd-pmc.c | 40 +++++++++++++++++-----------------
>  1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
> index 668a1d6c11ee..e266492d3ef7 100644
> --- a/drivers/platform/x86/amd-pmc.c
> +++ b/drivers/platform/x86/amd-pmc.c
> @@ -193,26 +193,6 @@ struct smu_metrics {
>  	u64 timecondition_notmet_totaltime[SOC_SUBSYSTEM_IP_MAX];
>  } __packed;
> 
> -static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
> -{
> -	int rc;
> -	u32 val;
> -
> -	rc = amd_pmc_send_cmd(dev, 0, &val, SMU_MSG_GETSMUVERSION,
> 1);
> -	if (rc)
> -		return rc;
> -
> -	dev->smu_program = (val >> 24) & GENMASK(7, 0);
> -	dev->major = (val >> 16) & GENMASK(7, 0);
> -	dev->minor = (val >> 8) & GENMASK(7, 0);
> -	dev->rev = (val >> 0) & GENMASK(7, 0);
> -
> -	dev_dbg(dev->dev, "SMU program %u version is %u.%u.%u\n",
> -		dev->smu_program, dev->major, dev->minor, dev->rev);
> -
> -	return 0;
> -}
> -
>  static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp)
>  {
>  	struct amd_pmc_dev *dev = filp->f_inode->i_private;
> @@ -417,6 +397,26 @@ static int s0ix_stats_show(struct seq_file *s, void
> *unused)
>  }
>  DEFINE_SHOW_ATTRIBUTE(s0ix_stats);
> 
> +static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
> +{
> +	int rc;
> +	u32 val;
> +
> +	rc = amd_pmc_send_cmd(dev, 0, &val, SMU_MSG_GETSMUVERSION,
> 1);
> +	if (rc)
> +		return rc;
> +
> +	dev->smu_program = (val >> 24) & GENMASK(7, 0);
> +	dev->major = (val >> 16) & GENMASK(7, 0);
> +	dev->minor = (val >> 8) & GENMASK(7, 0);
> +	dev->rev = (val >> 0) & GENMASK(7, 0);
> +
> +	dev_dbg(dev->dev, "SMU program %u version is %u.%u.%u\n",
> +		dev->smu_program, dev->major, dev->minor, dev->rev);
> +
> +	return 0;
> +}
> +
>  static int amd_pmc_idlemask_show(struct seq_file *s, void *unused)
>  {
>  	struct amd_pmc_dev *dev = s->private;
> 
> base-commit: b0c07116c894325d40a218f558047f925e4b3bdb
> --
> 2.36.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: amd-pmc: Shuffle location of amd_pmc_get_smu_version()
  2022-04-18 21:38 [PATCH] platform/x86: amd-pmc: Shuffle location of amd_pmc_get_smu_version() Nathan Chancellor
  2022-04-18 22:02 ` Limonciello, Mario
@ 2022-04-27 14:25 ` Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2022-04-27 14:25 UTC (permalink / raw)
  To: Nathan Chancellor, Shyam Sundar S K, Mario Limonciello, Mark Gross
  Cc: platform-driver-x86, linux-kernel, patches

Hi,

On 4/18/22 23:38, Nathan Chancellor wrote:
> When CONFIG_DEBUG_FS is disabled, amd_pmc_get_smu_version() is unused:
> 
>   drivers/platform/x86/amd-pmc.c:196:12: warning: unused function 'amd_pmc_get_smu_version' [-Wunused-function]
>   static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
>              ^
>   1 warning generated.
> 
> Eliminate the warning by moving amd_pmc_get_smu_version() to the
> CONFIG_DEBUG_FS block where it is used.
> 
> Fixes: b0c07116c894 ("platform/x86: amd-pmc: Avoid reading SMU version at probe time")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans



> ---
>  drivers/platform/x86/amd-pmc.c | 40 +++++++++++++++++-----------------
>  1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
> index 668a1d6c11ee..e266492d3ef7 100644
> --- a/drivers/platform/x86/amd-pmc.c
> +++ b/drivers/platform/x86/amd-pmc.c
> @@ -193,26 +193,6 @@ struct smu_metrics {
>  	u64 timecondition_notmet_totaltime[SOC_SUBSYSTEM_IP_MAX];
>  } __packed;
>  
> -static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
> -{
> -	int rc;
> -	u32 val;
> -
> -	rc = amd_pmc_send_cmd(dev, 0, &val, SMU_MSG_GETSMUVERSION, 1);
> -	if (rc)
> -		return rc;
> -
> -	dev->smu_program = (val >> 24) & GENMASK(7, 0);
> -	dev->major = (val >> 16) & GENMASK(7, 0);
> -	dev->minor = (val >> 8) & GENMASK(7, 0);
> -	dev->rev = (val >> 0) & GENMASK(7, 0);
> -
> -	dev_dbg(dev->dev, "SMU program %u version is %u.%u.%u\n",
> -		dev->smu_program, dev->major, dev->minor, dev->rev);
> -
> -	return 0;
> -}
> -
>  static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp)
>  {
>  	struct amd_pmc_dev *dev = filp->f_inode->i_private;
> @@ -417,6 +397,26 @@ static int s0ix_stats_show(struct seq_file *s, void *unused)
>  }
>  DEFINE_SHOW_ATTRIBUTE(s0ix_stats);
>  
> +static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
> +{
> +	int rc;
> +	u32 val;
> +
> +	rc = amd_pmc_send_cmd(dev, 0, &val, SMU_MSG_GETSMUVERSION, 1);
> +	if (rc)
> +		return rc;
> +
> +	dev->smu_program = (val >> 24) & GENMASK(7, 0);
> +	dev->major = (val >> 16) & GENMASK(7, 0);
> +	dev->minor = (val >> 8) & GENMASK(7, 0);
> +	dev->rev = (val >> 0) & GENMASK(7, 0);
> +
> +	dev_dbg(dev->dev, "SMU program %u version is %u.%u.%u\n",
> +		dev->smu_program, dev->major, dev->minor, dev->rev);
> +
> +	return 0;
> +}
> +
>  static int amd_pmc_idlemask_show(struct seq_file *s, void *unused)
>  {
>  	struct amd_pmc_dev *dev = s->private;
> 
> base-commit: b0c07116c894325d40a218f558047f925e4b3bdb


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-27 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 21:38 [PATCH] platform/x86: amd-pmc: Shuffle location of amd_pmc_get_smu_version() Nathan Chancellor
2022-04-18 22:02 ` Limonciello, Mario
2022-04-27 14:25 ` Hans de Goede

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.