On 10 August 2017 at 11:41, Ben Pfaff <b...@ovn.org> wrote:
> On Thu, Aug 10, 2017 at 01:01:32PM +0800, Gao Zhenyu wrote:
>> How about:
>> struct ovsdb_idl_table {
>> ...
>>     const struct ovsdb_idl_table_class *table_class
>> ....
>> }
>>
>> struct ovsdb_idl {
>> ....
>>      const struct ovsdb_idl_class *idl_class;
>> ....
>
> Why make it longer?
>
>> Besides of that, I see many places consume the table class.
>> Do you mind to make a macro helps to fetch the class?
>> Like:
>>
>> #define OVSDB_GET_TABLE_CLASS(row) \
>>             ((row)->table->class)
>
> Ugh.

Just in case the context isn't obvious... ;-)

I think that in general, we try not to obscure what's going on in OVS
code. This particular suggestion makes it less clear when reading the
code exactly where the class comes from, because the pointer
dereference is then hidden behind the macro. It also makes lines
referencing the class longer, and some of these lines are already
fairly long.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to