Skip to contentSkip to conversation

genl: Return false, not NULL, for boolean return.

PATCH Applied Ossama Othman 2 participants 2 messages Mar 12, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 genl: Return false, not NULL, for boolean return.

From: Ossama Othman <[email protected]>

The return type of the l_genl_request_family() function is bool, not a pointer. Return false instead of NULL to match the return type.

---
 ell/genl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
ell/genl.c +2 -2
index 7e3f800..97457cf 100644
@@ -1538,11 +1538,11 @@ LIB_EXPORT bool l_genl_request_family(struct l_genl *genl, const char *name,
 	struct family_request *req;
 
 	if (unlikely(!genl) || unlikely(!name))
-		return NULL;
+		return false;
 
 	len = strlen(name);
 	if (unlikely(strlen(name) >= GENL_NAMSIZ))
-		return NULL;
+		return false;
 
 	req = l_new(struct family_request, 1);
 	req->appeared_func = appeared_func;
Signature · 1 line
2.25.1
#1 lore raw

Hi Ossama,

Quoted 8 lines · Ossama Othman

From: Ossama Othman <[email protected]>

The return type of the l_genl_request_family() function is bool, not a pointer. Return false instead of NULL to match the return type.

---
  ell/genl.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Regards,
-Denis