Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757580Ab3GYWPt (ORCPT ); Thu, 25 Jul 2013 18:15:49 -0400 Received: from hydra.sisk.pl ([212.160.235.94]:40489 "EHLO hydra.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756803Ab3GYWPp (ORCPT ); Thu, 25 Jul 2013 18:15:45 -0400 From: "Rafael J. Wysocki" To: Lv Zheng Cc: "Rafael J. Wysocki" , Len Brown , Corey Minyard , Zhao Yakui , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, openipmi-developer@lists.sourceforge.net Subject: Re: [PATCH 08/13] ACPI/IPMI: Cleanup several acpi_ipmi_device members Date: Fri, 26 Jul 2013 00:25:50 +0200 Message-ID: <1882662.xsnVH6Carz@vostro.rjw.lan> User-Agent: KMail/4.9.5 (Linux/3.10.0+; KDE/4.9.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5245 Lines: 145 On Tuesday, July 23, 2013 04:10:06 PM Lv Zheng wrote: > This is a trivial patch: > 1. Deletes a member of the acpi_ipmi_device - smi_data which is not > actually used. > 2. Updates a member of the acpi_ipmi_device - pnp_dev which is only used > by dev_warn() invocations, so changes it to struct device. > > Signed-off-by: Lv Zheng > Reviewed-by: Huang Ying > --- > drivers/acpi/acpi_ipmi.c | 30 ++++++++++++++---------------- > 1 file changed, 14 insertions(+), 16 deletions(-) > > diff --git a/drivers/acpi/acpi_ipmi.c b/drivers/acpi/acpi_ipmi.c > index 0ee1ea6..7f93ffd 100644 > --- a/drivers/acpi/acpi_ipmi.c > +++ b/drivers/acpi/acpi_ipmi.c > @@ -63,11 +63,10 @@ struct acpi_ipmi_device { > struct list_head tx_msg_list; > spinlock_t tx_msg_lock; > acpi_handle handle; > - struct pnp_dev *pnp_dev; > + struct device *dev; > ipmi_user_t user_interface; > int ipmi_ifnum; /* IPMI interface number */ > long curr_msgid; > - struct ipmi_smi_info smi_data; > atomic_t refcnt; > }; > > @@ -132,7 +131,7 @@ static struct ipmi_driver_data driver_data = { > }; > > static struct acpi_ipmi_device * > -ipmi_dev_alloc(int iface, struct ipmi_smi_info *smi_data, acpi_handle handle) > +ipmi_dev_alloc(int iface, struct device *pdev, acpi_handle handle) Why is the second arg called pdev? > { > struct acpi_ipmi_device *ipmi_device; > int err; > @@ -148,14 +147,13 @@ ipmi_dev_alloc(int iface, struct ipmi_smi_info *smi_data, acpi_handle handle) > spin_lock_init(&ipmi_device->tx_msg_lock); > > ipmi_device->handle = handle; > - ipmi_device->pnp_dev = to_pnp_dev(get_device(smi_data->dev)); > - memcpy(&ipmi_device->smi_data, smi_data, sizeof(struct ipmi_smi_info)); > + ipmi_device->dev = get_device(pdev); > ipmi_device->ipmi_ifnum = iface; > > err = ipmi_create_user(iface, &driver_data.ipmi_hndlrs, > ipmi_device, &user); > if (err) { > - put_device(smi_data->dev); > + put_device(pdev); > kfree(ipmi_device); > return NULL; > } > @@ -175,7 +173,7 @@ acpi_ipmi_dev_get(struct acpi_ipmi_device *ipmi_device) > static void ipmi_dev_release(struct acpi_ipmi_device *ipmi_device) > { > ipmi_destroy_user(ipmi_device->user_interface); > - put_device(ipmi_device->smi_data.dev); > + put_device(ipmi_device->dev); > kfree(ipmi_device); > } > > @@ -263,7 +261,7 @@ static int acpi_format_ipmi_request(struct acpi_ipmi_msg *tx_msg, > buffer = (struct acpi_ipmi_buffer *)value; > /* copy the tx message data */ > if (buffer->length > ACPI_IPMI_MAX_MSG_LENGTH) { > - dev_WARN_ONCE(&tx_msg->device->pnp_dev->dev, true, > + dev_WARN_ONCE(tx_msg->device->dev, true, > "Unexpected request (msg len %d).\n", > buffer->length); > return -EINVAL; > @@ -382,11 +380,11 @@ static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) > struct acpi_ipmi_device *ipmi_device = user_msg_data; > int msg_found = 0; > struct acpi_ipmi_msg *tx_msg; > - struct pnp_dev *pnp_dev = ipmi_device->pnp_dev; > + struct device *dev = ipmi_device->dev; > unsigned long flags; > > if (msg->user != ipmi_device->user_interface) { > - dev_warn(&pnp_dev->dev, > + dev_warn(dev, > "Unexpected response is returned. returned user %p, expected user %p\n", > msg->user, ipmi_device->user_interface); > goto out_msg; > @@ -404,7 +402,7 @@ static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) > spin_unlock_irqrestore(&ipmi_device->tx_msg_lock, flags); > > if (!msg_found) { > - dev_warn(&pnp_dev->dev, > + dev_warn(dev, > "Unexpected response (msg id %ld) is returned.\n", > msg->msgid); > goto out_msg; > @@ -412,7 +410,7 @@ static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) > > /* copy the response data to Rx_data buffer */ > if (msg->msg.data_len > ACPI_IPMI_MAX_MSG_LENGTH) { > - dev_WARN_ONCE(&pnp_dev->dev, true, > + dev_WARN_ONCE(dev, true, > "Unexpected response (msg len %d).\n", > msg->msg.data_len); > goto out_comp; > @@ -431,7 +429,7 @@ out_msg: > static void ipmi_register_bmc(int iface, struct device *dev) > { > struct acpi_ipmi_device *ipmi_device, *temp; > - struct pnp_dev *pnp_dev; > + struct device *pdev; And here? > int err; > struct ipmi_smi_info smi_data; > acpi_handle handle; > @@ -445,11 +443,11 @@ static void ipmi_register_bmc(int iface, struct device *dev) > handle = smi_data.addr_info.acpi_info.acpi_handle; > if (!handle) > goto err_ref; > - pnp_dev = to_pnp_dev(smi_data.dev); > + pdev = smi_data.dev; > > - ipmi_device = ipmi_dev_alloc(iface, &smi_data, handle); > + ipmi_device = ipmi_dev_alloc(iface, pdev, handle); > if (!ipmi_device) { > - dev_warn(&pnp_dev->dev, "Can't create IPMI user interface\n"); > + dev_warn(pdev, "Can't create IPMI user interface\n"); > goto err_ref; > } > > -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/