All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] genl: make l_genl_attr_recurse take a const pointer
@ 2022-07-26 16:34 James Prestwood
  2022-07-26 16:35 ` [PATCH 2/2] genl: remove 'msg' from l_genl_attr James Prestwood
  2022-07-26 17:08 ` [PATCH 1/2] genl: make l_genl_attr_recurse take a const pointer Denis Kenzior
  0 siblings, 2 replies; 3+ messages in thread
From: James Prestwood @ 2022-07-26 16:34 UTC (permalink / raw)
  To: ell; +Cc: James Prestwood

The outer attribute iterator should be const since its not being
modified.
---
 ell/genl.c | 2 +-
 ell/genl.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ell/genl.c b/ell/genl.c
index 2cae2f0..2c873ef 100644
--- a/ell/genl.c
+++ b/ell/genl.c
@@ -1761,7 +1761,7 @@ LIB_EXPORT bool l_genl_attr_next(struct l_genl_attr *attr,
 	return true;
 }
 
-LIB_EXPORT bool l_genl_attr_recurse(struct l_genl_attr *attr,
+LIB_EXPORT bool l_genl_attr_recurse(const struct l_genl_attr *attr,
 						struct l_genl_attr *nested)
 {
 	const struct nlattr *nla;
diff --git a/ell/genl.h b/ell/genl.h
index 7e5b7bb..42041fa 100644
--- a/ell/genl.h
+++ b/ell/genl.h
@@ -109,7 +109,8 @@ bool l_genl_msg_leave_nested(struct l_genl_msg *msg);
 bool l_genl_attr_init(struct l_genl_attr *attr, struct l_genl_msg *msg);
 bool l_genl_attr_next(struct l_genl_attr *attr, uint16_t *type,
 					uint16_t *len, const void **data);
-bool l_genl_attr_recurse(struct l_genl_attr *attr, struct l_genl_attr *nested);
+bool l_genl_attr_recurse(const struct l_genl_attr *attr,
+				struct l_genl_attr *nested);
 
 bool l_genl_family_info_has_group(const struct l_genl_family_info *info,
 					const char *group);
-- 
2.34.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] genl: remove 'msg' from l_genl_attr
  2022-07-26 16:34 [PATCH 1/2] genl: make l_genl_attr_recurse take a const pointer James Prestwood
@ 2022-07-26 16:35 ` James Prestwood
  2022-07-26 17:08 ` [PATCH 1/2] genl: make l_genl_attr_recurse take a const pointer Denis Kenzior
  1 sibling, 0 replies; 3+ messages in thread
From: James Prestwood @ 2022-07-26 16:35 UTC (permalink / raw)
  To: ell; +Cc: James Prestwood

The original l_genl_msg object was never being used
---
 ell/genl.c | 2 --
 ell/genl.h | 1 -
 2 files changed, 3 deletions(-)

diff --git a/ell/genl.c b/ell/genl.c
index 2c873ef..4ed95df 100644
--- a/ell/genl.c
+++ b/ell/genl.c
@@ -1720,7 +1720,6 @@ LIB_EXPORT bool l_genl_attr_init(struct l_genl_attr *attr,
 	if (!NLA_OK(nla, len))
 		return false;
 
-	attr->msg = msg;
 	attr->data = NULL;
 	attr->len = 0;
 	attr->next_data = nla;
@@ -1773,7 +1772,6 @@ LIB_EXPORT bool l_genl_attr_recurse(const struct l_genl_attr *attr,
 	if (!nla)
 		return false;
 
-	nested->msg = attr->msg;
 	nested->data = NULL;
 	nested->len = 0;
 	nested->next_data = NLA_DATA(nla);
diff --git a/ell/genl.h b/ell/genl.h
index 42041fa..915bcf7 100644
--- a/ell/genl.h
+++ b/ell/genl.h
@@ -76,7 +76,6 @@ bool l_genl_request_family(struct l_genl *genl, const char *name,
 					l_genl_destroy_func_t destroy);
 
 struct l_genl_attr {
-	struct l_genl_msg *msg;
 	const void *data;
 	uint32_t len;
 	const void *next_data;
-- 
2.34.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] genl: make l_genl_attr_recurse take a const pointer
  2022-07-26 16:34 [PATCH 1/2] genl: make l_genl_attr_recurse take a const pointer James Prestwood
  2022-07-26 16:35 ` [PATCH 2/2] genl: remove 'msg' from l_genl_attr James Prestwood
@ 2022-07-26 17:08 ` Denis Kenzior
  1 sibling, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2022-07-26 17:08 UTC (permalink / raw)
  To: James Prestwood, ell

Hi James,

On 7/26/22 11:34, James Prestwood wrote:
> The outer attribute iterator should be const since its not being
> modified.
> ---
>   ell/genl.c | 2 +-
>   ell/genl.h | 3 ++-
>   2 files changed, 3 insertions(+), 2 deletions(-)
> 

Both applied, thanks.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-26 17:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-26 16:34 [PATCH 1/2] genl: make l_genl_attr_recurse take a const pointer James Prestwood
2022-07-26 16:35 ` [PATCH 2/2] genl: remove 'msg' from l_genl_attr James Prestwood
2022-07-26 17:08 ` [PATCH 1/2] genl: make l_genl_attr_recurse take a const pointer Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.