[PATCH v6 05/18] netlink: introduce nla_decoder_t to parse netlink attribute data

Dmitry V. Levin ldv at altlinux.org
Tue Jun 27 21:08:25 UTC 2017


On Tue, Jun 27, 2017 at 06:10:07PM +0800, JingPiao Chen wrote:
[...]
> --- a/nlattr.c
> +++ b/nlattr.c
> @@ -29,6 +29,7 @@
>  
>  #include "defs.h"
>  #include "netlink.h"
> +#include "nlattr.h"
>  
>  static bool
>  fetch_nlattr(struct tcb *const tcp, struct nlattr *const nlattr,
> @@ -65,7 +66,10 @@ decode_nlattr_with_data(struct tcb *tcp,
>  			kernel_ulong_t addr,
>  			kernel_ulong_t len,
>  			const struct xlat *const table,
> -			const char *const dflt)
> +			const char *const dflt,
> +			const nla_decoder_t *decoders,
> +			unsigned int size,
> +			void *const opaque_data)

I tend to add "const" qualifier to auto variables and function arguments,
despite it doesn't affect the code generated by the compiler.

The purpose of this "const" qualifier is to highlight the intent.
Some people find this use of "const" qualifier redundant, though.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170628/66765ff3/attachment.bin>


More information about the Strace-devel mailing list