diff mbox series

[dwarves,v2,1/3] btf_encoder: Fix handling of restrict qualifier

Message ID 20210121113520.3603097-2-gprocida@google.com (mailing list archive)
State Not Applicable
Delegated to: BPF
Headers show
Series Small fixes and improvements | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Giuliano Procida Jan. 21, 2021, 11:35 a.m. UTC
This corrects a typo that resulted in 'restrict' being treated as 'const'.

Fixes: 48efa92933e8 ("btf_encoder: Use libbpf APIs to encode BTF type info")

Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 libbtf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnaldo Carvalho de Melo Jan. 21, 2021, 1:21 p.m. UTC | #1
Em Thu, Jan 21, 2021 at 11:35:18AM +0000, Giuliano Procida escreveu:
> This corrects a typo that resulted in 'restrict' being treated as 'const'.
> 
> Fixes: 48efa92933e8 ("btf_encoder: Use libbpf APIs to encode BTF type info")

Thanks for providing the Fixes: tag!

Applied,

- Arnaldo

 
> Acked-by: Andrii Nakryiko <andrii@kernel.org>
> Signed-off-by: Giuliano Procida <gprocida@google.com>
> ---
>  libbtf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libbtf.c b/libbtf.c
> index 16e1d45..3709087 100644
> --- a/libbtf.c
> +++ b/libbtf.c
> @@ -417,7 +417,7 @@ int32_t btf_elf__add_ref_type(struct btf_elf *btfe, uint16_t kind, uint32_t type
>  		id = btf__add_const(btf, type);
>  		break;
>  	case BTF_KIND_RESTRICT:
> -		id = btf__add_const(btf, type);
> +		id = btf__add_restrict(btf, type);
>  		break;
>  	case BTF_KIND_TYPEDEF:
>  		id = btf__add_typedef(btf, name, type);
> -- 
> 2.30.0.296.g2bfb1c46d8-goog
>
diff mbox series

Patch

diff --git a/libbtf.c b/libbtf.c
index 16e1d45..3709087 100644
--- a/libbtf.c
+++ b/libbtf.c
@@ -417,7 +417,7 @@  int32_t btf_elf__add_ref_type(struct btf_elf *btfe, uint16_t kind, uint32_t type
 		id = btf__add_const(btf, type);
 		break;
 	case BTF_KIND_RESTRICT:
-		id = btf__add_const(btf, type);
+		id = btf__add_restrict(btf, type);
 		break;
 	case BTF_KIND_TYPEDEF:
 		id = btf__add_typedef(btf, name, type);