[dpdk-dev] [PATCH v2 05/33] common/cpt: add common code for init routine
Thomas Monjalon
thomas at monjalon.net
Mon Sep 17 14:51:09 CEST 2018
17/09/2018 14:32, Akhil Goyal:
>
> Hi Thomas,
>
> On 9/17/2018 5:16 PM, Thomas Monjalon wrote:
>
> > 17/09/2018 12:45, Akhil Goyal:
> >> On 9/4/2018 9:28 AM, Anoob Joseph wrote:
> >>> +struct pending_queue {
> >>> + uint16_t enq_tail;
> >>> + uint16_t deq_head;
> >>> + uint16_t soft_qlen;
> >>> + /**< Software expected queue length */
> >>> + uint16_t p_doorbell;
> >>> + struct rid *rid_queue;
> >>> + /**< Array of pending requests */
> >>> + uint64_t pending_count;
> >>> + /**< Pending requests count */
> >>> +};
> >> better to add comment for each element of structure.
> >> Also remove extra tab for comments(here and any other place if any.)
> > I don't understand this trend in the community about doing comments
> > _after_ the item _and_ not on the same line.
> > The default style should be commenting _before_.
> > And if you feel it is better to have the comment on the same line,
> > then you can comment _after_, but on the same line.
> >
> I think this should not matter, whether the comment should be before or after,
>
> it should be consistent across the code. I can see that both are being used equally.
>
> Shall we change the complete code beyond this driver as well?
>
> I think whatever we choose, it should be atleast consistent within the file.
Let me rephrase.
There are 3 styles:
1/ comment on the previous line (before the item)
2/ comment on the same line (just after the item)
3/ comment on the next line (after the item)
I am fine with #1 and #2 but I really don't see the benefit of #3.
More information about the dev
mailing list