Re: [ovs-dev] [PATCH net-next 6/8] net/openvswitch: Use max() to simplify the code
Aaron Conole <[email protected]> Mon, 26 Aug 2024 13:58:19 -0400
| Newsgroups | org.kernel.vger.dccp,org.kernel.vger.linux-wireless,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
Hongbo Li via dev <[email protected]> writes: > Let's use max() to simplify the code and fix the > Coccinelle/coccicheck warning reported by minmax.cocci. > > Signed-off-by: Hongbo Li <[email protected]> > --- Reviewed-by: Aaron Conole <[email protected]> > net/openvswitch/vport.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c > index 8732f6e51ae5..859208df65ea 100644 > --- a/net/openvswitch/vport.c > +++ b/net/openvswitch/vport.c > @@ -534,7 +534,7 @@ static int packet_length(const struct sk_buff *skb, > * account for 802.1ad. e.g. is_skb_forwardable(). > */ > > - return length > 0 ? length : 0; > + return max(length, 0); > } > > void ovs_vport_send(struct vport *vport, struct sk_buff *skb, u8 mac_proto)