Re: [PATCH v2 1/9] trace-cmd record: Move port_type into instance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 18 Apr 2022 13:22:21 +0300
Tzvetomir Stoyanov <tz.stoyanov@xxxxxxxxx> wrote:

> > +++ b/tracecmd/include/trace-local.h
> > @@ -285,6 +285,7 @@ struct buffer_instance {
> >         int                     *fds;
> >         bool                    use_fifos;
> >
> > +       enum port_type          port_type;  
> 
> I would suggest setting the default value of port_type explicitly in
> allocate_instance(). Even though USE_UDP is 0, it is more clear. The
> first time when I went through these changes, I was wondering why UDP
> is not set at all. Then found that it was a static boolean in the
> previous implementation, defaulting to false.

I could add a comment. I purposely had USE_UDP to zero for this purpose.
This is a common trick to do in the kernel as well.

But it should have a comment stating that here. I'll update it in v3.

Thanks for the review.

-- Steve



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux