Re: [PATCH rdma-next v1 1/2] IB/mad: Add state machine to MAD layer

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

 



On Sun, Jan 19, 2025 at 10:26:24AM +0200, Leon Romanovsky wrote:

> > > +#define NOT_EXPECT_MAD_STATE(mad_send_wr, wrong_state)              \
> > > +	{                                                           \
> > > +		if (IS_ENABLED(CONFIG_LOCKDEP))                     \
> > > +			WARN_ON(mad_send_wr->state == wrong_state); \
> > > +	}
> > 
> > These could all be static inlines, otherwise at least
> > mad_send_wr->state needs brackets (mad_send_wr)->state
> 
> I don't think that it is worth to have functions here.

You should always prefer functions to function-like-macros if
possible..

The expected_state needs () as well

Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux