net: chelsio: cxgb4: Use str_plural() in mem_intr_handler()
Subsystems (3)
PATCH 1/1 net: chelsio: cxgb4: Use str_plural() in mem_intr_handler()
Replace the manual ternary "s" pluralization with str_plural() to simplify the code.
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +2 -1
@@ -33,6 +33,7 @@*/ #include <linux/delay.h> +#include <linux/string_choices.h> #include "cxgb4.h" #include "t4_regs.h" #include "t4_values.h"
@@ -4867,7 +4868,7 @@ static void mem_intr_handler(struct adapter *adapter, int idx)if (printk_ratelimit ())dev_warn (adapter->pdev_dev,"%u %s correctable ECC data error%s\n" , - cnt, name[idx], cnt >1 ?"s" :"" ); + cnt, name[idx],str_plural (cnt)); }if (v &ECC_UE_INT_CAUSE_F ) dev_alert(adapter->pdev_dev,
Quoted 5 lines · Thorsten Blum
Replace the manual ternary "s" pluralization with
str_plural()to simplify the code.Signed-off-by Thorsten Blum <[email protected]>---
Thank you.
Reviewed-by Potnuri Bharat Teja <[email protected]>
Quoted 24 lines
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +2
-1@@ -33,6 +33,7 @@*/ #include <linux/delay.h> +#include <linux/string_choices.h> #include "cxgb4.h" #include "t4_regs.h" #include "t4_values.h" @@ -4867,7 +4868,7 @@ static void mem_intr_handler(struct adapter *adapter, int idx)if (printk_ratelimit ())dev_warn (adapter->pdev_dev,"%u %s correctable ECC data error%s\n" , - cnt, name[idx], cnt >1 ?"s" :"" ); + cnt, name[idx],str_plural (cnt)); }if (v &ECC_UE_INT_CAUSE_F ) dev_alert(adapter->pdev_dev,
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 7 lines · On Sat, 4 Jul 2026 14:10:11 +0200 you wrote:
Replace the manual ternary "s" pluralization with
str_plural()to simplify the code.Signed-off-by Thorsten Blum <[email protected]>--- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Here is the summary with links:
- [net-next] net: chelsio: cxgb4: Use str_plural() in mem_intr_handler()
https://git.kernel.org/netdev/net-next/c/d5d7554052f3
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html