* [PATCH] scsi: fcoe: simplify if-if to if-else
@ 2022-04-08 8:12 Yihao Han
2022-04-19 2:58 ` Martin K. Petersen
2022-04-26 4:00 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Yihao Han @ 2022-04-08 8:12 UTC (permalink / raw)
To: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, linux-kernel
Cc: kernel, Yihao Han
Replace `if (!is_zero_ether_addr(mac))` with `else` for simplification
and add curly brackets according to the kernel coding style:
"Do not unnecessarily use braces where a single statement will do."
...
"This does not apply if only one branch of a conditional statement is
a single statement; in the latter case use braces in both branches"
Please refer to:
https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html
Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
drivers/scsi/fcoe/fcoe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 44ca6110213c..983e00135fea 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -2580,7 +2580,7 @@ static void fcoe_flogi_resp(struct fc_seq *seq, struct fc_frame *fp, void *arg)
/* pre-FIP */
if (is_zero_ether_addr(mac))
fcoe_ctlr_recv_flogi(fip, lport, fp);
- if (!is_zero_ether_addr(mac))
+ else
fcoe_update_src_mac(lport, mac);
done:
fc_lport_flogi_resp(seq, fp, lport);
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: fcoe: simplify if-if to if-else
2022-04-08 8:12 [PATCH] scsi: fcoe: simplify if-if to if-else Yihao Han
@ 2022-04-19 2:58 ` Martin K. Petersen
2022-04-26 4:00 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-04-19 2:58 UTC (permalink / raw)
To: Yihao Han
Cc: Hannes Reinecke, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, linux-kernel, kernel
Yihao,
> Replace `if (!is_zero_ether_addr(mac))` with `else` for simplification
> and add curly brackets according to the kernel coding style:
Applied to 5.19/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: fcoe: simplify if-if to if-else
2022-04-08 8:12 [PATCH] scsi: fcoe: simplify if-if to if-else Yihao Han
2022-04-19 2:58 ` Martin K. Petersen
@ 2022-04-26 4:00 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-04-26 4:00 UTC (permalink / raw)
To: linux-scsi, James E.J. Bottomley, Hannes Reinecke, Yihao Han,
linux-kernel
Cc: Martin K . Petersen, kernel
On Fri, 8 Apr 2022 01:12:37 -0700, Yihao Han wrote:
> Replace `if (!is_zero_ether_addr(mac))` with `else` for simplification
> and add curly brackets according to the kernel coding style:
>
> "Do not unnecessarily use braces where a single statement will do."
>
> ...
>
> [...]
Applied to 5.19/scsi-queue, thanks!
[1/1] scsi: fcoe: simplify if-if to if-else
https://git.kernel.org/mkp/scsi/c/65db22e505c4
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-26 4:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 8:12 [PATCH] scsi: fcoe: simplify if-if to if-else Yihao Han
2022-04-19 2:58 ` Martin K. Petersen
2022-04-26 4:00 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.