[PATCH] drivers/applicom:Remove redundant ret variable in ac_read function

Zhu Jun posted 1 patch 1 month, 2 weeks ago
drivers/char/applicom.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] drivers/applicom:Remove redundant ret variable in ac_read function
Posted by Zhu Jun 1 month, 2 weeks ago
Removed the unused variable 'ret' from the ac_read function

Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
 drivers/char/applicom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index ea25caf35346..ba512d8dffba 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -536,7 +536,6 @@ static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_
 	unsigned long flags;
 	unsigned int i;
 	unsigned char tmp;
-	int ret = 0;
 	DECLARE_WAITQUEUE(wait, current);
 #ifdef DEBUG
 	int loopcount=0;
@@ -567,7 +566,7 @@ static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_
 
 				/* Got a packet for us */
 				memset(&st_loc, 0, sizeof(st_loc));
-				ret = do_ac_read(i, buf, &st_loc, &mailbox);
+				do_ac_read(i, buf, &st_loc, &mailbox);
 				spin_unlock_irqrestore(&apbs[i].mutex, flags);
 				set_current_state(TASK_RUNNING);
 				remove_wait_queue(&FlagSleepRec, &wait);
-- 
2.17.1
Re: [PATCH] drivers/applicom:Remove redundant ret variable in ac_read function
Posted by Greg KH 1 month, 2 weeks ago
On Tue, Oct 08, 2024 at 12:48:18AM -0700, Zhu Jun wrote:
> Removed the unused variable 'ret' from the ac_read function
> 
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
> ---
>  drivers/char/applicom.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
> index ea25caf35346..ba512d8dffba 100644
> --- a/drivers/char/applicom.c
> +++ b/drivers/char/applicom.c
> @@ -536,7 +536,6 @@ static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_
>  	unsigned long flags;
>  	unsigned int i;
>  	unsigned char tmp;
> -	int ret = 0;
>  	DECLARE_WAITQUEUE(wait, current);
>  #ifdef DEBUG
>  	int loopcount=0;
> @@ -567,7 +566,7 @@ static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_
>  
>  				/* Got a packet for us */
>  				memset(&st_loc, 0, sizeof(st_loc));
> -				ret = do_ac_read(i, buf, &st_loc, &mailbox);
> +				do_ac_read(i, buf, &st_loc, &mailbox);

Why not check that this worked properly instead?  Can you test this
change?  Why make this change if you can not?

thanks,

greg k-h