On 11 Dec 2024, at 14:32, Ilya Maximets wrote:

> 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]>

Thanks for the review Ilya! With the nit fixed, applied to main.

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to