Skip to contentSkip to conversation

nvme-apple: return directly instead of else

PATCH Applied Chaitanya Kulkarni 3 participants 5 messages Mar 27, 2023 – Apr 5, 2023

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

PATCH 1/2 nvme-apple: return directly instead of else

There is no need for the else when direct return is used at the end of the function.

---
 drivers/nvme/host/apple.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/apple.c +2 -2
index 5fc5ea196b40..942a3b71a6d5 100644
@@ -209,8 +209,8 @@ static inline struct apple_nvme *queue_to_apple_nvme(struct apple_nvme_queue *q)
 {
 	if (q->is_adminq)
 		return container_of(q, struct apple_nvme, adminq);
-	else
-		return container_of(q, struct apple_nvme, ioq);
+
+	return container_of(q, struct apple_nvme, ioq);
 }
 
 static unsigned int apple_nvme_queue_depth(struct apple_nvme_queue *q)
Signature · 1 line
2.29.0
#1 lore raw

PATCH 2/2 nvme-apple: return directly instead of else

There is no need for the else when direct return is used at the end of the function.

---
 drivers/nvme/host/apple.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/apple.c +2 -2
index 942a3b71a6d5..33601494ae50 100644
@@ -217,8 +217,8 @@ static unsigned int apple_nvme_queue_depth(struct apple_nvme_queue *q)
 {
 	if (q->is_adminq)
 		return APPLE_NVME_AQ_DEPTH;
-	else
-		return APPLE_ANS_MAX_QUEUE_DEPTH;
+
+	return APPLE_ANS_MAX_QUEUE_DEPTH;
 }
 
 static void apple_nvme_rtkit_crashed(void *cookie)
Signature · 1 line
2.29.0
Reviewed-by on v1 2/2
#2 lore raw
Quoted 5 lines · Chaitanya Kulkarni

There is no need for the else when direct return is used at the end of the function.

Is mise le meas/Regards,

Eric Curtin

Quoted 23 lines
---
 drivers/nvme/host/apple.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/apple.c +2 -3
index 942a3b71a6d5..33601494ae50 100644
@@ -217,8 +217,8 @@ static unsigned int apple_nvme_queue_depth(struct apple_nvme_queue *q)
 {
        if (q->is_adminq)
                return APPLE_NVME_AQ_DEPTH;
-       else
-               return APPLE_ANS_MAX_QUEUE_DEPTH;
+
+       return APPLE_ANS_MAX_QUEUE_DEPTH;
 }
 
 static void apple_nvme_rtkit_crashed(void *cookie)
--

2.29.0

Reviewed-by on v1 1/2
#3 lore raw
In reply to Chaitanya Kulkarni
Quoted 5 lines · Chaitanya Kulkarni

There is no need for the else when direct return is used at the end of the function.

Is mise le meas/Regards,

Eric Curtin

Quoted 23 lines
---
 drivers/nvme/host/apple.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/apple.c +2 -3
index 5fc5ea196b40..942a3b71a6d5 100644
@@ -209,8 +209,8 @@ static inline struct apple_nvme *queue_to_apple_nvme(struct apple_nvme_queue *q)
 {
        if (q->is_adminq)
                return container_of(q, struct apple_nvme, adminq);
-       else
-               return container_of(q, struct apple_nvme, ioq);
+
+       return container_of(q, struct apple_nvme, ioq);
 }
 
 static unsigned int apple_nvme_queue_depth(struct apple_nvme_queue *q)
--

2.29.0