diff mbox series

scsi: qla4xxx: Remove unneeded return variable

Message ID 1612423057-72018-1-git-send-email-yang.lee@linux.alibaba.com (mailing list archive)
State Changes Requested
Headers show
Series scsi: qla4xxx: Remove unneeded return variable | expand

Commit Message

Yang Li Feb. 4, 2021, 7:17 a.m. UTC
This patch removes unneeded return variables, using only
'0' instead.
It fixes the following warning detected by coccinelle:
./drivers/scsi/qla4xxx/ql4_os.c:3642:5-7: Unneeded variable: "rc".
Return "0" on line 3741

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/scsi/qla4xxx/ql4_os.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Johannes Thumshirn Feb. 4, 2021, 9:35 a.m. UTC | #1
On 04/02/2021 08:20, Yang Li wrote:
> This patch removes unneeded return variables, using only
> '0' instead.
> It fixes the following warning detected by coccinelle:
> ./drivers/scsi/qla4xxx/ql4_os.c:3642:5-7: Unneeded variable: "rc".
> Return "0" on line 3741
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  drivers/scsi/qla4xxx/ql4_os.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
> index a4b014e..ed92534 100644
> --- a/drivers/scsi/qla4xxx/ql4_os.c
> +++ b/drivers/scsi/qla4xxx/ql4_os.c
> @@ -3639,7 +3639,6 @@ static int qla4xxx_copy_to_fwddb_param(struct iscsi_bus_flash_session *sess,
>  				       struct dev_db_entry *fw_ddb_entry)
>  {
>  	uint16_t options;
> -	int rc = 0;
>  
>  	options = le16_to_cpu(fw_ddb_entry->options);
>  	SET_BITVAL(conn->is_fw_assigned_ipv6,  options, BIT_11);
> @@ -3738,7 +3737,7 @@ static int qla4xxx_copy_to_fwddb_param(struct iscsi_bus_flash_session *sess,
>  
>  	COPY_ISID(fw_ddb_entry->isid, sess->isid);
>  
> -	return rc;
> +	return 0;
>  }
>  
>  static void qla4xxx_copy_to_sess_conn_params(struct iscsi_conn *conn,
> 

None of the callers checks the return value anyways so you can do:
- static int qla4xxx_copy_to_fwddb_param(struct iscsi_bus_flash_session *sess,
+ static void qla4xxx_copy_to_fwddb_param(struct iscsi_bus_flash_session *sess,
diff mbox series

Patch

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index a4b014e..ed92534 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -3639,7 +3639,6 @@  static int qla4xxx_copy_to_fwddb_param(struct iscsi_bus_flash_session *sess,
 				       struct dev_db_entry *fw_ddb_entry)
 {
 	uint16_t options;
-	int rc = 0;
 
 	options = le16_to_cpu(fw_ddb_entry->options);
 	SET_BITVAL(conn->is_fw_assigned_ipv6,  options, BIT_11);
@@ -3738,7 +3737,7 @@  static int qla4xxx_copy_to_fwddb_param(struct iscsi_bus_flash_session *sess,
 
 	COPY_ISID(fw_ddb_entry->isid, sess->isid);
 
-	return rc;
+	return 0;
 }
 
 static void qla4xxx_copy_to_sess_conn_params(struct iscsi_conn *conn,