lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-Id: <20231005195812.549776-14-mkl@pengutronix.de> Date: Thu, 5 Oct 2023 21:57:48 +0200 From: Marc Kleine-Budde <mkl@...gutronix.de> To: netdev@...r.kernel.org Cc: davem@...emloft.net, kuba@...nel.org, linux-can@...r.kernel.org, kernel@...gutronix.de, Marc Kleine-Budde <mkl@...gutronix.de> Subject: [PATCH net-next 13/37] can: at91_can: at91_irq_tx(): remove one level of indention Improve code readability by removing one level of indention. If a mailbox is not ready, continue the loop early. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-3-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de> --- drivers/net/can/at91_can.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index 367ccf109652..966980d4b5dd 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c @@ -844,15 +844,14 @@ static void at91_irq_tx(struct net_device *dev, u32 reg_sr) * parked in the echo queue. */ reg_msr = at91_read(priv, AT91_MSR(mb)); - if (likely(reg_msr & AT91_MSR_MRDY && - ~reg_msr & AT91_MSR_MABT)) { - /* _NOTE_: subtract AT91_MB_TX_FIRST offset from mb! */ - dev->stats.tx_bytes += - can_get_echo_skb(dev, - mb - get_mb_tx_first(priv), - NULL); - dev->stats.tx_packets++; - } + if (unlikely(!(reg_msr & AT91_MSR_MRDY && + ~reg_msr & AT91_MSR_MABT))) + continue; + + /* _NOTE_: subtract AT91_MB_TX_FIRST offset from mb! */ + dev->stats.tx_bytes += + can_get_echo_skb(dev, mb - get_mb_tx_first(priv), NULL); + dev->stats.tx_packets++; } /* restart queue if we don't have a wrap around but restart if -- 2.40.1
Powered by blists - more mailing lists