Skip to contentSkip to conversation

hid: intel-ish-hid: ishtp: remove variable rb_count

PATCH Applied Colin Ian King 3 participants 3 messages Oct 20, 2022 – Nov 14, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 hid: intel-ish-hid: ishtp: remove variable rb_count

The variable rb_count is being incremented but it is never referenced, it is redundant and can be removed.

---
V2: Fix commit message.

---
 drivers/hid/intel-ish-hid/ishtp/client.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/hid/intel-ish-hid/ishtp/client.c +0 -3
index df0a825694f5..2d92fc129ce4 100644
@@ -841,7 +841,6 @@ void recv_ishtp_cl_msg(struct ishtp_device *dev,
 	unsigned char *buffer = NULL;
 	struct ishtp_cl_rb *complete_rb = NULL;
 	unsigned long	flags;
-	int	rb_count;
 
 	if (ishtp_hdr->reserved) {
 		dev_err(dev->devc, "corrupted message header.\n");
@@ -855,9 +854,7 @@ void recv_ishtp_cl_msg(struct ishtp_device *dev,
 	}
 
 	spin_lock_irqsave(&dev->read_list_spinlock, flags);
-	rb_count = -1;
 	list_for_each_entry(rb, &dev->read_list.list, list) {
-		++rb_count;
 		cl = rb->cl;
 		if (!cl || !(cl->host_client_id == ishtp_hdr->host_addr &&
 				cl->fw_client_id == ishtp_hdr->fw_addr) ||
Signature · 1 line
2.37.3
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 4 lines · Colin Ian King

The variable rb_count is being incremented but it is never referenced, it is redundant and can be removed.

Quoted 31 lines

---
V2: Fix commit message.
---
 drivers/hid/intel-ish-hid/ishtp/client.c | 3 ---

 1 file changed, 3 deletions(-)
drivers/hid/intel-ish-hid/ishtp/client.c +0 -1
index df0a825694f5..2d92fc129ce4 100644
@@ -841,7 +841,6 @@ void recv_ishtp_cl_msg(struct ishtp_device *dev,
         unsigned char *buffer = NULL;
         struct ishtp_cl_rb *complete_rb = NULL;
         unsigned long   flags;
-       int     rb_count;


        if (ishtp_hdr->reserved) {
                dev_err(dev->devc, "corrupted message header.\n");

drivers/hid/intel-ish-hid/ishtp/client.c +0 -0
@@ -855,9 +854,7 @@ void recv_ishtp_cl_msg(struct ishtp_device *dev,
         }


        spin_lock_irqsave(&dev->read_list_spinlock, flags); -       rb_count = -1;
        list_for_each_entry(rb, &dev->read_list.list, list) { -               ++rb_count;
                cl = rb->cl;
                if (!cl || !(cl->host_client_id == ishtp_hdr-

Quoted 1 line

host_addr &&

                                cl->fw_client_id == ishtp_hdr-

Quoted 1 line

fw_addr) ||

maintainer Applied
#2 lore raw
In reply to Colin Ian King
Quoted 23 lines · Colin Ian King

The variable rb_count is being incremented but it is never referenced, it is redundant and can be removed.

---
V2: Fix commit message.

---
 drivers/hid/intel-ish-hid/ishtp/client.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/hid/intel-ish-hid/ishtp/client.c +0 -1
index df0a825694f5..2d92fc129ce4 100644
@@ -841,7 +841,6 @@ void recv_ishtp_cl_msg(struct ishtp_device *dev,
 	unsigned char *buffer = NULL;
 	struct ishtp_cl_rb *complete_rb = NULL;
 	unsigned long	flags;
-	int	rb_count;
 
 	if (ishtp_hdr->reserved) {
 		dev_err(dev->devc, "corrupted message header.\n");

drivers/hid/intel-ish-hid/ishtp/client.c void recv_ishtp_cl_msg(struct ishtp_device *dev, · line 860

Quoted 9 lines
drivers/hid/intel-ish-hid/ishtp/client.c +0 -2
@@ -855,9 +854,7 @@ void recv_ishtp_cl_msg(struct ishtp_device *dev,
 	}
 
 	spin_lock_irqsave(&dev->read_list_spinlock, flags);
-	rb_count = -1;
 	list_for_each_entry(rb, &dev->read_list.list, list) {
-		++rb_count;
 		cl = rb->cl;
 		if (!cl || !(cl->host_client_id == ishtp_hdr->host_addr &&
 				cl->fw_client_id == ishtp_hdr->fw_addr) ||

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs