diff mbox

[-next] HID: intel_ish-hid: Convert list_for_each to entry variant

Message ID 1471793398-24008-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Aug. 21, 2016, 3:29 p.m. UTC
convert list_for_each() to list_for_each_entry() where
applicable.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
 drivers/hid/intel-ish-hid/ishtp/bus.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Srinivas Pandruvada Aug. 26, 2016, 6:58 p.m. UTC | #1
On Sun, 2016-08-21 at 15:29 +0000, Wei Yongjun wrote:
> convert list_for_each() to list_for_each_entry() where
> applicable.
> 
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/hid/intel-ish-hid/ishtp/bus.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c
> b/drivers/hid/intel-ish-hid/ishtp/bus.c
> index 0183eac..8a1bb8c 100644
> --- a/drivers/hid/intel-ish-hid/ishtp/bus.c
> +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
> @@ -380,11 +380,9 @@ static struct ishtp_cl_device
> *ishtp_bus_add_device(struct ishtp_device *dev,
>  	struct ishtp_cl_device *device;
>  	int status;
>  	unsigned long flags;
> -	struct list_head *pos;
>  
>  	spin_lock_irqsave(&dev->device_list_lock, flags);
> -	list_for_each(pos, &dev->device_list) {
> -		device = list_entry(pos, struct ishtp_cl_device,
> device_link);
> +	list_for_each_entry(device, &dev->device_list, device_link)
> {
>  		if (!strcmp(name, dev_name(&device->dev))) {
>  			device->fw_client = &dev->fw_clients[
>  				dev->fw_client_presentation_num -
> 1];
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index 0183eac..8a1bb8c 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -380,11 +380,9 @@  static struct ishtp_cl_device *ishtp_bus_add_device(struct ishtp_device *dev,
 	struct ishtp_cl_device *device;
 	int status;
 	unsigned long flags;
-	struct list_head *pos;
 
 	spin_lock_irqsave(&dev->device_list_lock, flags);
-	list_for_each(pos, &dev->device_list) {
-		device = list_entry(pos, struct ishtp_cl_device, device_link);
+	list_for_each_entry(device, &dev->device_list, device_link) {
 		if (!strcmp(name, dev_name(&device->dev))) {
 			device->fw_client = &dev->fw_clients[
 				dev->fw_client_presentation_num - 1];