Skip to contentSkip to conversation

scsi: fnic: Remove unnecessary else and unnecessary break in FDLS

PATCH New Karan Tilak Kumar 1 participant 3 messages Jan 6, 2025

Subsystems (2)
lore
Share & tools
lore

Karan Tilak Kumar

author maintainer
#0 lore raw

PATCH 1/3 scsi: fnic: Remove unnecessary else and unnecessary break in FDLS

Incorporate review comments from Martin:
Remove unnecessary else and unnecessary break to fix warnings in the FDLS code.

---
 drivers/scsi/fnic/fdls_disc.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
drivers/scsi/fnic/fdls_disc.c +6 -10
index 2534af2fff53..2513a82a8915 100644
@@ -2776,23 +2776,19 @@ fdls_process_tgt_prli_rsp(struct fnic_iport_s *iport,
 			/*Retry Plogi again from the timer routine. */
 			tport->flags |= FNIC_FDLS_RETRY_FRAME;
 			return;
-		} else {
-			FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
-						 "PRLI returned ELS_LS_RJT from target: 0x%x",
-						 tgt_fcid);
-
-			fdls_tgt_logout(iport, tport);
-			fdls_delete_tport(iport, tport);
-			return;
 		}
-		break;
+		FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
+					 "PRLI returned ELS_LS_RJT from target: 0x%x",
+					 tgt_fcid);
 
+		fdls_tgt_logout(iport, tport);
+		fdls_delete_tport(iport, tport);
+		return;
 	default:
 		atomic64_inc(&iport->iport_stats.tport_prli_misc_rejects);
 		FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
 					 "PRLI not accepted from target: 0x%x", tgt_fcid);
 		return;
-		break;
 	}
 
 	FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
Signature · 1 line
2.47.1
author maintainer
#1 lore raw

PATCH 2/3 scsi: fnic: Remove extern definition from .c files

Implement review comments from Martin:
Remove extern definition of fnic_fip_queue from .c files

---
 drivers/scsi/fnic/fip.c      | 2 --
 drivers/scsi/fnic/fip.h      | 2 ++
 drivers/scsi/fnic/fnic_fcs.c | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/fnic/fip.c +0 -2
index 161075e3bb95..aaf5f768a9bd 100644
@@ -7,8 +7,6 @@
 #include "fip.h"
 #include <linux/etherdevice.h>
 
-extern struct workqueue_struct *fnic_fip_queue;
-
 #define FIP_FNIC_RESET_WAIT_COUNT 15
 
 /**
drivers/scsi/fnic/fip.h +2 -0
index c62993c76dc7..79fee7628870 100644
@@ -131,6 +131,8 @@ void fnic_fcoe_start_flogi(struct fnic *fnic);
 void fnic_fcoe_process_cvl(struct fnic *fnic, struct fip_header *fiph);
 void fnic_vlan_discovery_timeout(struct fnic *fnic);
 
+extern struct workqueue_struct *fnic_fip_queue;
+
 #ifdef FNIC_DEBUG
 static inline void
 fnic_debug_dump_fip_frame(struct fnic *fnic, struct ethhdr *eth,
drivers/scsi/fnic/fnic_fcs.c +0 -1
index 471d4a7553bf..1e8cd64f9a5c 100644
@@ -27,7 +27,6 @@
 
 #define MAX_RESET_WAIT_COUNT    64
 
-extern struct workqueue_struct *fnic_fip_queue;
 struct workqueue_struct *fnic_event_queue;
 
 static uint8_t FCOE_ALL_FCF_MAC[6] = FC_FCOE_FLOGI_MAC;
Signature · 1 line
2.47.1
author maintainer
#2 lore raw

PATCH 3/3 scsi: fnic: Remove unnecessary else to fix warning in FDLS FIP

In reply to Karan Tilak Kumar

Implement review comments from Martin:
Remove unnecessary else from fip.c to fix a warning.

---
 drivers/scsi/fnic/fip.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/scsi/fnic/fip.c +8 -9
index aaf5f768a9bd..7bb85949033f 100644
@@ -154,16 +154,15 @@ void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct fip_header *fiph)
 			vlan->state = FIP_VLAN_AVAIL;
 			list_add_tail(&vlan->list, &fnic->vlan_list);
 			break;
-		} else {
-			FNIC_FIP_DBG(KERN_INFO, fnic->host,
-				     fnic->fnic_num,
-				     "Invalid descriptor type(%x) in VLan response\n",
-				     vlan_desc->fd_desc.fip_dtype);
-			/*
-			 * Note : received a type=2 descriptor here i.e. FIP
-			 * MAC Address Descriptor
-			 */
 		}
+		FNIC_FIP_DBG(KERN_INFO, fnic->host,
+			     fnic->fnic_num,
+			     "Invalid descriptor type(%x) in VLan response\n",
+			     vlan_desc->fd_desc.fip_dtype);
+		/*
+		 * Note : received a type=2 descriptor here i.e. FIP
+		 * MAC Address Descriptor
+		 */
 		cur_desc += vlan_desc->fd_desc.fip_dlen;
 		desc_len -= vlan_desc->fd_desc.fip_dlen;
 	}
Signature · 1 line
2.47.1