All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang@amd.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linux ACPI <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Steven Noonan <steven@valvesoftware.com>
Subject: Re: [PATCH v1 2/2] ACPI: CPPC: Drop redundant local variable from cpc_read()
Date: Thu, 13 Jan 2022 10:39:34 +0800	[thread overview]
Message-ID: <Yd+Q5htH5dit/gIX@amd.com> (raw)
In-Reply-To: <4374346.LvFx2qVVIh@kreacher>

On Thu, Jan 13, 2022 at 02:27:22AM +0800, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> The ret_val local variable in cpc_read() is not necessary, so
> eliminate it.
> 
> No functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Acked-by: Huang Rui <ray.huang@amd.com>

> ---
>  drivers/acpi/cppc_acpi.c |    7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> Index: linux-pm/drivers/acpi/cppc_acpi.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/cppc_acpi.c
> +++ linux-pm/drivers/acpi/cppc_acpi.c
> @@ -915,14 +915,13 @@ int __weak cpc_write_ffh(int cpunum, str
>  
>  static int cpc_read(int cpu, struct cpc_register_resource *reg_res, u64 *val)
>  {
> -	int ret_val = 0;
>  	void __iomem *vaddr = NULL;
>  	int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
>  	struct cpc_reg *reg = &reg_res->cpc_entry.reg;
>  
>  	if (reg_res->type == ACPI_TYPE_INTEGER) {
>  		*val = reg_res->cpc_entry.int_value;
> -		return ret_val;
> +		return 0;
>  	}
>  
>  	*val = 0;
> @@ -968,10 +967,10 @@ static int cpc_read(int cpu, struct cpc_
>  	default:
>  		pr_debug("Error: Cannot read %u bit width from PCC for ss: %d\n",
>  			 reg->bit_width, pcc_ss_id);
> -		ret_val = -EFAULT;
> +		return -EFAULT;
>  	}
>  
> -	return ret_val;
> +	return 0;
>  }
>  
>  static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
> 
> 
> 

      reply	other threads:[~2022-01-13  2:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 18:25 [PATCH v1 0/2] ACPI: CPPC: Fix I/O port reads on big endian and clean up code in cpc_read() Rafael J. Wysocki
2022-01-12 18:26 ` [PATCH v1 1/2] ACPI: CPPC: Fix up I/O port access " Rafael J. Wysocki
2022-01-13  3:00   ` Huang Rui
2022-01-12 18:27 ` [PATCH v1 2/2] ACPI: CPPC: Drop redundant local variable from cpc_read() Rafael J. Wysocki
2022-01-13  2:39   ` Huang Rui [this message]

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=Yd+Q5htH5dit/gIX@amd.com \
    --to=ray.huang@amd.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=steven@valvesoftware.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.