[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d95dbb5.63777.18cbe57e107.Coremail.linma@zju.edu.cn>
Date: Sun, 31 Dec 2023 13:27:59 +0800 (GMT+08:00)
From: "Lin Ma" <linma@....edu.cn>
To: "Leon Romanovsky" <leon@...nel.org>
Cc: jgg@...pe.ca, gustavoars@...nel.org, bvanassche@....org,
markzhang@...dia.com, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] RDMA/sa_query: use validate not parser in
ib_nl_is_good_resolve_resp
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.
Regards
Lin
Powered by blists - more mailing lists