[ovs-dev] [PATCH] pinctrl: Fix "sparse" warning.
Ramu Ramamurthy
ramu.ramamurthy at gmail.com
Tue May 17 17:29:39 UTC 2016
Darrell, Ben,
Thanks for the fix, The warning was introduced by my patch "send GARP
on localnet"
In the future, I will run my changes through sparse (and possibly
clang) to detect such
problems prior to sharing a patch.
ovn/controller/pinctrl.c:609:39: warning: incorrect type in assignment
(different base types)
ovn/controller/pinctrl.c:609:39: expected restricted ofp_port_t
[usertype] port
ovn/controller/pinctrl.c:609:39: got int [signed] ofport
On Tue, May 17, 2016 at 8:12 AM, Darrell Ball <dlu998 at gmail.com> wrote:
> On Tue, May 17, 2016 at 7:44 AM, Ben Pfaff <blp at ovn.org> wrote:
>
>> The ofport member should be an ofp_port_t, since it represents an OpenFlow
>> port number.
>>
>> Fixes: 9baaabfff3c7 ("ovn: Fix localnet ports deletion and recreation
>> sometimes after restart.")
>>
>
> Is this rather related to "ovn: send garp on localnet." ?
>
>
>
>> Signed-off-by: Ben Pfaff <blp at ovn.org>
>> ---
>> ovn/controller/pinctrl.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
>> index 1611bcd..bc57c40 100644
>> --- a/ovn/controller/pinctrl.c
>> +++ b/ovn/controller/pinctrl.c
>> @@ -514,7 +514,7 @@ struct garp_data {
>> ovs_be32 ipv4; /* Ipv4 address of port. */
>> long long int announce_time; /* Next announcement in ms. */
>> int backoff; /* Backoff for the next announcement. */
>> - int ofport; /* ofport used to output this GARP. */
>> + ofp_port_t ofport; /* ofport used to output this GARP. */
>> };
>>
>> /* Contains GARPs to be sent. */
>> @@ -548,7 +548,8 @@ send_garp_update(const struct sbrec_port_binding
>> *binding_rec,
>> if (!ld || !ld->localnet_port) {
>> return;
>> }
>> - int ofport = simap_get(localnet_ofports,
>> ld->localnet_port->logical_port);
>> + ofp_port_t ofport = u16_to_ofp(simap_get(localnet_ofports,
>> +
>> ld->localnet_port->logical_port));
>>
>> /* Update GARP if it exists. */
>> struct garp_data *garp = shash_find_data(&send_garp_data,
>> --
>> 2.1.3
>>
>> _______________________________________________
>> dev mailing list
>> dev at openvswitch.org
>> http://openvswitch.org/mailman/listinfo/dev
>>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list