* [PATCH net-next v2] octeontx2: Remove unnecessary ternary operators
@ 2023-08-01 11:26 Ruan Jinjie
2023-08-01 11:57 ` [EXT] " Sunil Kovvuri Goutham
2023-08-02 19:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Ruan Jinjie @ 2023-08-01 11:26 UTC (permalink / raw)
To: sgoutham, lcherian, gakula, jerinj, hkelam, sbhatta, davem,
edumazet, kuba, pabeni, richardcochran, netdev
Cc: ruanjinjie
There are a little ternary operators, the true or false judgement
of which is unnecessary in C language semantics. So remove it
to clean Code.
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei•com>
Reviewed-by: Simon Horman <horms@kernel•org>
---
v2:
- Fix the subject prefix and commit message issue.
---
drivers/net/ethernet/marvell/octeontx2/af/ptp.c | 4 ++--
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c
index 0ee420a489fc..c55c2c441a1a 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c
@@ -61,12 +61,12 @@ static const struct pci_device_id ptp_id_table[];
static bool is_ptp_dev_cnf10kb(struct ptp *ptp)
{
- return (ptp->pdev->subsystem_device == PCI_SUBSYS_DEVID_CNF10K_B_PTP) ? true : false;
+ return ptp->pdev->subsystem_device == PCI_SUBSYS_DEVID_CNF10K_B_PTP;
}
static bool is_ptp_dev_cn10k(struct ptp *ptp)
{
- return (ptp->pdev->device == PCI_DEVID_CN10K_PTP) ? true : false;
+ return ptp->pdev->device == PCI_DEVID_CN10K_PTP;
}
static bool cn10k_ptp_errata(struct ptp *ptp)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index 9551b422622a..61f62a6ec662 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -2027,7 +2027,7 @@ u16 otx2_select_queue(struct net_device *netdev, struct sk_buff *skb,
#endif
int txq;
- qos_enabled = (netdev->real_num_tx_queues > pf->hw.tx_queues) ? true : false;
+ qos_enabled = netdev->real_num_tx_queues > pf->hw.tx_queues;
if (unlikely(qos_enabled)) {
/* This smp_load_acquire() pairs with smp_store_release() in
* otx2_qos_root_add() called from htb offload root creation
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [EXT] [PATCH net-next v2] octeontx2: Remove unnecessary ternary operators
2023-08-01 11:26 [PATCH net-next v2] octeontx2: Remove unnecessary ternary operators Ruan Jinjie
@ 2023-08-01 11:57 ` Sunil Kovvuri Goutham
2023-08-02 19:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Sunil Kovvuri Goutham @ 2023-08-01 11:57 UTC (permalink / raw)
To: Ruan Jinjie, Linu Cherian, Geethasowjanya Akula,
Jerin Jacob Kollanukkaran, Hariprasad Kelam,
Subbaraya Sundeep Bhatta, davem@davemloft•net,
edumazet@google•com, kuba@kernel•org, pabeni@redhat•com,
richardcochran@gmail•com, netdev@vger•kernel.org
>
> External Email
>
> ----------------------------------------------------------------------
> There are a little ternary operators, the true or false judgement of which is
> unnecessary in C language semantics. So remove it to clean Code.
>
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei•com>
> Reviewed-by: Simon Horman <horms@kernel•org>
> ---
> v2:
> - Fix the subject prefix and commit message issue.
> ---
Reviewed-by: Sunil Goutham <sgoutham@marvell•com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] octeontx2: Remove unnecessary ternary operators
2023-08-01 11:26 [PATCH net-next v2] octeontx2: Remove unnecessary ternary operators Ruan Jinjie
2023-08-01 11:57 ` [EXT] " Sunil Kovvuri Goutham
@ 2023-08-02 19:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-02 19:20 UTC (permalink / raw)
To: Ruan Jinjie
Cc: sgoutham, lcherian, gakula, jerinj, hkelam, sbhatta, davem,
edumazet, kuba, pabeni, richardcochran, netdev
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel•org>:
On Tue, 1 Aug 2023 19:26:38 +0800 you wrote:
> There are a little ternary operators, the true or false judgement
> of which is unnecessary in C language semantics. So remove it
> to clean Code.
>
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei•com>
> Reviewed-by: Simon Horman <horms@kernel•org>
>
> [...]
Here is the summary with links:
- [net-next,v2] octeontx2: Remove unnecessary ternary operators
https://git.kernel.org/netdev/net-next/c/c7606d49e609
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-02 19:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-01 11:26 [PATCH net-next v2] octeontx2: Remove unnecessary ternary operators Ruan Jinjie
2023-08-01 11:57 ` [EXT] " Sunil Kovvuri Goutham
2023-08-02 19:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox