Re: [PATCH rdma-next v2 03/11] RDMA/efa: Add the efa.h header file

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

 



On Wed, Feb 27, 2019 at 09:58:10AM +0200, Gal Pressman wrote:
> On 26-Feb-19 20:03, Steve Wise wrote:
> >> +#define efa_stat_inc(dev, stat)                                         \
> >> +	do {                                                            \
> >> +		typeof(dev) _dev = dev;                                 \
> >> +		unsigned long flags;                                    \
> >> +									\
> >> +		spin_lock_irqsave(&_dev->stats_lock, flags);            \
> >> +		(stat)++;                                               \
> >> +		spin_unlock_irqrestore(&_dev->stats_lock, flags);       \
> >> +	} while (0)
> >> +
> >
> >
> > Would this be more safe as a static inline function where you explicitly
> > type the parameters?
>
> The typeof looks like an overkill.
> I prefer to keep it as a define, but I will thin it down a little.

Generally speaking, we are not super excited to see abstractions over
basic kernel primitives, especially if such abstractions don't do a lot,
but hiding locks.

Thanks

Attachment: signature.asc
Description: PGP signature


[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