* [PATCH -next] bnx2x: Remove unnecessary ternary operators
@ 2023-08-01 2:02 Ruan Jinjie
2023-08-01 10:13 ` Simon Horman
0 siblings, 1 reply; 3+ messages in thread
From: Ruan Jinjie @ 2023-08-01 2:02 UTC (permalink / raw)
To: aelior, skalluru, manishc, davem, edumazet, kuba, pabeni, netdev
Cc: ruanjinjie
Ther are a little ternary operators, the true or false judgement
of which is unnecessary in C language semantics.
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
index 542c69822649..8e04552d2216 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
@@ -890,7 +890,7 @@ static void bnx2x_set_one_mac_e2(struct bnx2x *bp,
(struct eth_classify_rules_ramrod_data *)(raw->rdata);
int rule_cnt = rule_idx + 1, cmd = elem->cmd_data.vlan_mac.cmd;
union eth_classify_rule_cmd *rule_entry = &data->rules[rule_idx];
- bool add = (cmd == BNX2X_VLAN_MAC_ADD) ? true : false;
+ bool add = cmd == BNX2X_VLAN_MAC_ADD;
unsigned long *vlan_mac_flags = &elem->cmd_data.vlan_mac.vlan_mac_flags;
u8 *mac = elem->cmd_data.vlan_mac.u.mac.mac;
@@ -1075,7 +1075,7 @@ static void bnx2x_set_one_vlan_e2(struct bnx2x *bp,
int rule_cnt = rule_idx + 1;
union eth_classify_rule_cmd *rule_entry = &data->rules[rule_idx];
enum bnx2x_vlan_mac_cmd cmd = elem->cmd_data.vlan_mac.cmd;
- bool add = (cmd == BNX2X_VLAN_MAC_ADD) ? true : false;
+ bool add = cmd == BNX2X_VLAN_MAC_ADD;
u16 vlan = elem->cmd_data.vlan_mac.u.vlan.vlan;
/* Reset the ramrod data buffer for the first rule */
@@ -1125,7 +1125,7 @@ static void bnx2x_set_one_vlan_mac_e2(struct bnx2x *bp,
int rule_cnt = rule_idx + 1;
union eth_classify_rule_cmd *rule_entry = &data->rules[rule_idx];
enum bnx2x_vlan_mac_cmd cmd = elem->cmd_data.vlan_mac.cmd;
- bool add = (cmd == BNX2X_VLAN_MAC_ADD) ? true : false;
+ bool add = cmd == BNX2X_VLAN_MAC_ADD;
u16 vlan = elem->cmd_data.vlan_mac.u.vlan_mac.vlan;
u8 *mac = elem->cmd_data.vlan_mac.u.vlan_mac.mac;
u16 inner_mac;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] bnx2x: Remove unnecessary ternary operators
2023-08-01 2:02 [PATCH -next] bnx2x: Remove unnecessary ternary operators Ruan Jinjie
@ 2023-08-01 10:13 ` Simon Horman
2023-08-01 10:55 ` Ruan Jinjie
0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2023-08-01 10:13 UTC (permalink / raw)
To: Ruan Jinjie
Cc: aelior, skalluru, manishc, davem, edumazet, kuba, pabeni, netdev
On Tue, Aug 01, 2023 at 10:02:40AM +0800, Ruan Jinjie wrote:
> Ther are a little ternary operators, the true or false judgement
> of which is unnecessary in C language semantics.
>
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
For non-bugfix Networking patches, it is appropriate to
designate the target tree as 'net-next' rather than '-next'.
(For bug fixes 'net' is appropriate).
Link: https://docs.kernel.org/process/maintainer-netdev.html
Otherwise, this looks fine to me.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] bnx2x: Remove unnecessary ternary operators
2023-08-01 10:13 ` Simon Horman
@ 2023-08-01 10:55 ` Ruan Jinjie
0 siblings, 0 replies; 3+ messages in thread
From: Ruan Jinjie @ 2023-08-01 10:55 UTC (permalink / raw)
To: Simon Horman
Cc: aelior, skalluru, manishc, davem, edumazet, kuba, pabeni, netdev
On 2023/8/1 18:13, Simon Horman wrote:
> On Tue, Aug 01, 2023 at 10:02:40AM +0800, Ruan Jinjie wrote:
>> Ther are a little ternary operators, the true or false judgement
>> of which is unnecessary in C language semantics.
>>
>> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
>
> For non-bugfix Networking patches, it is appropriate to
> designate the target tree as 'net-next' rather than '-next'.
> (For bug fixes 'net' is appropriate).
Thank you! I'll fix it in v2.
>
> Link: https://docs.kernel.org/process/maintainer-netdev.html
>
> Otherwise, this looks fine to me.
>
> Reviewed-by: Simon Horman <horms@kernel.org>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-01 10:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-01 2:02 [PATCH -next] bnx2x: Remove unnecessary ternary operators Ruan Jinjie
2023-08-01 10:13 ` Simon Horman
2023-08-01 10:55 ` Ruan Jinjie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).