Skip to contentSkip to conversation

pcmcia: remvoe unneeded variable

PATCH In review [email protected] 2 participants 2 messages Nov 16, 2021 Pcmcia

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcmcia: remvoe unneeded variable

From: ran jianping <[email protected]>

Fix the following coccicheck review:
drivers/pcmcia/pcmcia_resource.c:396:5-8: Unneeded variable

Remove unneeded variable used to store return value.

---
 drivers/pcmcia/pcmcia_resource.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pcmcia/pcmcia_resource.c +1 -2
index c1c197292111..d7e0f659d0a7 100644
@@ -393,7 +393,6 @@ int pcmcia_release_configuration(struct pcmcia_device *p_dev)
 static int pcmcia_release_io(struct pcmcia_device *p_dev)
 {
 	struct pcmcia_socket *s = p_dev->socket;
-	int ret = -EINVAL;
 	config_t *c;
 
 	mutex_lock(&s->ops_mutex);
@@ -413,7 +412,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev)
 out:
 	mutex_unlock(&s->ops_mutex);
 
-	return ret;
+	return -EINVAL;
 } /* pcmcia_release_io */
 
 
Signature · 1 line
2.25.1
#1 lore raw

Am Tue, Nov 16, 2021 at 02:33:10AM +0000 schrieb [email protected]:

Quoted 26 lines

From: ran jianping <[email protected]>

Fix the following coccicheck review:
drivers/pcmcia/pcmcia_resource.c:396:5-8: Unneeded variable

Remove unneeded variable used to store return value.

---
 drivers/pcmcia/pcmcia_resource.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pcmcia/pcmcia_resource.c +0 -1
index c1c197292111..d7e0f659d0a7 100644
@@ -393,7 +393,6 @@ int pcmcia_release_configuration(struct pcmcia_device *p_dev)
 static int pcmcia_release_io(struct pcmcia_device *p_dev)
 {
 	struct pcmcia_socket *s = p_dev->socket;
-	int ret = -EINVAL;
 	config_t *c;
 
 	mutex_lock(&s->ops_mutex);

drivers/pcmcia/pcmcia_resource.c static int pcmcia_release_io(struct pcmcia_device *p_dev) · line 416

Quoted 6 lines
drivers/pcmcia/pcmcia_resource.c +1 -1
@@ -413,7 +412,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev)
 out:
 	mutex_unlock(&s->ops_mutex);
 
-	return ret;
+	return -EINVAL;
 } /* pcmcia_release_io */

Thanks for your patch. It truly points out that the return value is unused, and in fact, the sole caller does not check it. Therefore, it seems better to remove the return value altogether, and convert it to type void.

Thanks,
Dominik