Message ID | 20240726161232.146982-1-denkenz@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/7] netlink: Remove pointless checks | expand |
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
Hi James, > > These all look good to me visually, assuming they pass autotests (once the > update to IWD/netdev is done) > autotests seem to pass locally (with some usual test-runner flakiness), so I'll push this out and send the iwd patchset in a bit. I do need to merge the iwd monitor patch first though. Have you looked at that one? Regards, -Denis
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;