Re: [PATCH v1] RDMA/sa_query: use validate not parser in ib_nl_is_good_resolve_resp

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

 



On Sun, Dec 31, 2023 at 01:27:59PM +0800, Lin Ma wrote:
> Hello Leon,
> 
> > > The attributes array `tb` in ib_nl_is_good_resolve_resp is never used
> > > after the parsing. Therefore use nla_validate_deprecated function here
> > > for improvement.
> > 
> > What did this change improve?
> > 
> 
> To my concern, the nla_validate_deprecated, compared to nla_parse_deprecated,
> will at lease save a memset in function nla_parse_deprecated
> 
> ```
> if (tb)
>     memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
> ```
> 
> Morever, because the `nla_validate_deprecated` just validate the attributes
> array and will not try to retrieve the nla pointers. It shall be faster
> and cleaner here :D.

We don't care about speed in this path.
Let's leave the code as is.

Thanks

> 
> Regards
> Lin




[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