All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Corey Minyard <cminyard@mvista.com>,
	openipmi-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 03/10] ipmi_si: Utilize temporary variable to hold device pointer
Date: Fri, 2 Apr 2021 08:45:55 -0500	[thread overview]
Message-ID: <20210402134555.GR507977@minyard.net> (raw)
In-Reply-To: <20210330181649.66496-3-andriy.shevchenko@linux.intel.com>

On Tue, Mar 30, 2021 at 09:16:42PM +0300, Andy Shevchenko wrote:
> By one of the previous clean up change we got a temporary variable to hold
> a device pointer. It can be utilized in other calls in the ->probe() and
> save a bit of LOCs.

The description here isn't accurate, there is no previous change where a
temporary variable comes in.  This change adds the temporary variable.

This change is ok, but doesn't add much value.

-corey

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/char/ipmi/ipmi_si_platform.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/char/ipmi/ipmi_si_platform.c b/drivers/char/ipmi/ipmi_si_platform.c
> index 009563073d30..954c297b459b 100644
> --- a/drivers/char/ipmi/ipmi_si_platform.c
> +++ b/drivers/char/ipmi/ipmi_si_platform.c
> @@ -309,6 +309,7 @@ static int find_slave_address(struct si_sm_io *io, int slave_addr)
>  
>  static int acpi_ipmi_probe(struct platform_device *pdev)
>  {
> +	struct device *dev = &pdev->dev;
>  	struct si_sm_io io;
>  	acpi_handle handle;
>  	acpi_status status;
> @@ -318,21 +319,20 @@ static int acpi_ipmi_probe(struct platform_device *pdev)
>  	if (!si_tryacpi)
>  		return -ENODEV;
>  
> -	handle = ACPI_HANDLE(&pdev->dev);
> +	handle = ACPI_HANDLE(dev);
>  	if (!handle)
>  		return -ENODEV;
>  
>  	memset(&io, 0, sizeof(io));
>  	io.addr_source = SI_ACPI;
> -	dev_info(&pdev->dev, "probing via ACPI\n");
> +	dev_info(dev, "probing via ACPI\n");
>  
>  	io.addr_info.acpi_info.acpi_handle = handle;
>  
>  	/* _IFT tells us the interface type: KCS, BT, etc */
>  	status = acpi_evaluate_integer(handle, "_IFT", NULL, &tmp);
>  	if (ACPI_FAILURE(status)) {
> -		dev_err(&pdev->dev,
> -			"Could not find ACPI IPMI interface type\n");
> +		dev_err(dev, "Could not find ACPI IPMI interface type\n");
>  		return -EINVAL;
>  	}
>  
> @@ -349,10 +349,11 @@ static int acpi_ipmi_probe(struct platform_device *pdev)
>  	case 4: /* SSIF, just ignore */
>  		return -ENODEV;
>  	default:
> -		dev_info(&pdev->dev, "unknown IPMI type %lld\n", tmp);
> +		dev_info(dev, "unknown IPMI type %lld\n", tmp);
>  		return -EINVAL;
>  	}
>  
> +	io.dev = dev;
>  	io.regsize = DEFAULT_REGSIZE;
>  	io.regshift = 0;
>  
> @@ -376,9 +377,7 @@ static int acpi_ipmi_probe(struct platform_device *pdev)
>  
>  	io.slave_addr = find_slave_address(&io, io.slave_addr);
>  
> -	io.dev = &pdev->dev;
> -
> -	dev_info(io.dev, "%pR regsize %d spacing %d irq %d\n",
> +	dev_info(dev, "%pR regsize %d spacing %d irq %d\n",
>  		 res, io.regsize, io.regspacing, io.irq);
>  
>  	request_module("acpi_ipmi");
> -- 
> 2.30.2
> 

  reply	other threads:[~2021-04-02 13:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 18:16 [PATCH v1 01/10] ipmi_si: Switch to use platform_get_mem_or_io() Andy Shevchenko
2021-03-30 18:16 ` [PATCH v1 02/10] ipmi_si: Remove bogus err_free label Andy Shevchenko
2021-03-30 18:16 ` [PATCH v1 03/10] ipmi_si: Utilize temporary variable to hold device pointer Andy Shevchenko
2021-04-02 13:45   ` Corey Minyard [this message]
2021-03-30 18:16 ` [PATCH v1 04/10] ipmi_si: Use proper ACPI macros to check error code for failures Andy Shevchenko
2021-03-30 18:16 ` [PATCH v1 05/10] ipmi_si: Introduce panic_event_str array Andy Shevchenko
2021-04-02 13:48   ` Corey Minyard
2021-03-30 18:16 ` [PATCH v1 06/10] ipmi_si: Reuse si_to_str array in ipmi_hardcode_init_one() Andy Shevchenko
2021-04-02 13:53   ` Corey Minyard
2021-03-30 18:16 ` [PATCH v1 07/10] ipmi_si: Get rid of ->addr_source_cleanup() Andy Shevchenko
2021-03-30 18:16 ` [PATCH v1 08/10] ipmi_si: Use strstrip() to remove surrounding spaces Andy Shevchenko
2021-03-30 18:16 ` [PATCH v1 09/10] ipmi_si: Drop redundant check before calling put_device() Andy Shevchenko
2021-03-30 18:16 ` [PATCH v1 10/10] ipmi_si: Join string literals back Andy Shevchenko
2021-04-02 13:57 ` [PATCH v1 01/10] ipmi_si: Switch to use platform_get_mem_or_io() Corey Minyard

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=20210402134555.GR507977@minyard.net \
    --to=minyard@acm.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=cminyard@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    /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.