On 6/3/26 10:57 AM, Rafael J. Wysocki wrote:
> From: "Rafael J. Wysocki" <[email protected]>
> 
> Eliminate local variable acpi_desc from __acpi_nvdimm_notify() because it
> is redundant (its value is only checked against NULL once and the value
> assigned to it may be checked directly instead) and update the subsequent
> comment to reflect the code change.
> 
> No functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <[email protected]>

Reviewed-by: Dave Jiang <[email protected]>


> ---
>  drivers/acpi/nfit/core.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 01c73be0bd00..aaa84ae7a20e 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -1680,7 +1680,6 @@ static struct nvdimm *acpi_nfit_dimm_by_handle(struct 
> acpi_nfit_desc *acpi_desc,
>  void __acpi_nvdimm_notify(struct device *dev, u32 event)
>  {
>       struct nfit_mem *nfit_mem;
> -     struct acpi_nfit_desc *acpi_desc;
>  
>       dev_dbg(dev->parent, "%s: event: %d\n", dev_name(dev),
>                       event);
> @@ -1691,12 +1690,11 @@ void __acpi_nvdimm_notify(struct device *dev, u32 
> event)
>               return;
>       }
>  
> -     acpi_desc = dev_get_drvdata(dev->parent);
> -     if (!acpi_desc)
> +     if (!dev_get_drvdata(dev->parent))
>               return;
>  
>       /*
> -      * If we successfully retrieved acpi_desc, then we know nfit_mem data
> +      * If the parent's driver data pointer is not NULL, then nfit_mem data
>        * is still valid.
>        */
>       nfit_mem = dev_get_drvdata(dev);


Reply via email to