On 12/4/24 16:48, Eelco Chaudron wrote: > A fake command with a value of -1 is used and then stored in a > uint16_t, which generates a Coverity warning. This change will > store UINT16_MAX in such cases. > > Signed-off-by: Eelco Chaudron <[email protected]> > --- > lib/ofp-meter.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/ofp-meter.c b/lib/ofp-meter.c > index 9ea40a0bf..b0dbfecd4 100644 > --- a/lib/ofp-meter.c > +++ b/lib/ofp-meter.c > @@ -581,7 +581,11 @@ parse_ofp_meter_mod_str__(struct ofputil_meter_mod *mm, > char *string, > > switch (command) { > case -1: > + /* This is a special case for requesting meters, which has no > + * specific command assigned. To avoid compiler warnings, > + * set the command to UINT16_MAX. */
Nit: Double spaces between sentences and I'd move the 'set' word to a previous line, there is plenty of space there. May be fixed while applying. Otherwise, Acked-by: Ilya Maximets <[email protected]> > fields = F_METER; > + command = UINT16_MAX; > break; > > case OFPMC13_ADD: _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
