Re: [PATCH 1/7] netlink: Remove pointless checks

James Prestwood <[email protected]> Fri, 26 Jul 2024 10:55:02 -0700
Newsgroups dev.linux.lists.ell
Message-ID <[email protected]>
Hi Denis,

On 7/26/24 9:12 AM, Denis Kenzior wrote:
> command_queue, command_pending and command_lookup structures are always
> initialized at construction time and are not destroyed until l_netlink
> destruction.  There's no need to check whether they ar valid.
> ---
>   ell/netlink.c | 8 --------
>   1 file changed, 8 deletions(-)
>
> diff --git a/ell/netlink.c b/ell/netlink.c
> index 024740b62fc3..26c31679e4c7 100644
> --- a/ell/netlink.c
> +++ b/ell/netlink.c
> @@ -410,10 +410,6 @@ LIB_EXPORT unsigned int l_netlink_send(struct l_netlink *netlink,
>   	if (unlikely(!netlink))
>   		return 0;
>   
> -	if (!netlink->command_queue || !netlink->command_pending ||
> -						!netlink->command_lookup)
> -		return 0;
> -
>   	if (flags & 0xff)
>   		return 0;
>   
> @@ -471,10 +467,6 @@ LIB_EXPORT bool l_netlink_cancel(struct l_netlink *netlink, unsigned int id)
>   	if (unlikely(!netlink || !id))
>   		return false;
>   
> -	if (!netlink->command_queue || !netlink->command_pending ||
> -						!netlink->command_lookup)
> -		return false;
> -
>   	command = l_hashmap_remove(netlink->command_lookup, L_UINT_TO_PTR(id));
>   	if (!command)
>   		return false;

These all look good to me visually, assuming they pass autotests (once 
the update to IWD/netdev is done)

Thanks,

James