bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 1/2] bpf: btf: fix the brackets of BTF_INT_OFFSET()
@ 2019-05-13  9:11 Gary Lin
  2019-05-13  9:11 ` [PATCH bpf-next 2/2] docs/btf: update BTF_INT_OFFSET() Gary Lin
  2019-05-13  9:26 ` [PATCH bpf-next 1/2] bpf: btf: fix the brackets of BTF_INT_OFFSET() Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Gary Lin @ 2019-05-13  9:11 UTC (permalink / raw)
  To: bpf, Alexei Starovoitov; +Cc: Martin KaFai Lau

'VAL' should be protected by the brackets.

Fixes: 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)")
Signed-off-by: Gary Lin <glin@suse.com>
---
 include/uapi/linux/btf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/btf.h b/include/uapi/linux/btf.h
index 9310652ca4f9..63ae4a39e58b 100644
--- a/include/uapi/linux/btf.h
+++ b/include/uapi/linux/btf.h
@@ -83,7 +83,7 @@ struct btf_type {
  * is the 32 bits arrangement:
  */
 #define BTF_INT_ENCODING(VAL)	(((VAL) & 0x0f000000) >> 24)
-#define BTF_INT_OFFSET(VAL)	(((VAL  & 0x00ff0000)) >> 16)
+#define BTF_INT_OFFSET(VAL)	(((VAL) & 0x00ff0000) >> 16)
 #define BTF_INT_BITS(VAL)	((VAL)  & 0x000000ff)
 
 /* Attributes stored in the BTF_INT_ENCODING */
-- 
2.21.0


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

* [PATCH bpf-next 2/2] docs/btf: update BTF_INT_OFFSET()
  2019-05-13  9:11 [PATCH bpf-next 1/2] bpf: btf: fix the brackets of BTF_INT_OFFSET() Gary Lin
@ 2019-05-13  9:11 ` Gary Lin
  2019-05-13  9:26 ` [PATCH bpf-next 1/2] bpf: btf: fix the brackets of BTF_INT_OFFSET() Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Gary Lin @ 2019-05-13  9:11 UTC (permalink / raw)
  To: bpf, Alexei Starovoitov; +Cc: Martin KaFai Lau

Fix BTF_INT_OFFSET() in the document

Signed-off-by: Gary Lin <glin@suse.com>
---
 Documentation/bpf/btf.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/bpf/btf.rst b/Documentation/bpf/btf.rst
index 8820360d00da..35d83e24dbdb 100644
--- a/Documentation/bpf/btf.rst
+++ b/Documentation/bpf/btf.rst
@@ -131,7 +131,7 @@ The following sections detail encoding of each kind.
 ``btf_type`` is followed by a ``u32`` with the following bits arrangement::
 
   #define BTF_INT_ENCODING(VAL)   (((VAL) & 0x0f000000) >> 24)
-  #define BTF_INT_OFFSET(VAL)     (((VAL  & 0x00ff0000)) >> 16)
+  #define BTF_INT_OFFSET(VAL)     (((VAL) & 0x00ff0000) >> 16)
   #define BTF_INT_BITS(VAL)       ((VAL)  & 0x000000ff)
 
 The ``BTF_INT_ENCODING`` has the following attributes::
-- 
2.21.0


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

* Re: [PATCH bpf-next 1/2] bpf: btf: fix the brackets of BTF_INT_OFFSET()
  2019-05-13  9:11 [PATCH bpf-next 1/2] bpf: btf: fix the brackets of BTF_INT_OFFSET() Gary Lin
  2019-05-13  9:11 ` [PATCH bpf-next 2/2] docs/btf: update BTF_INT_OFFSET() Gary Lin
@ 2019-05-13  9:26 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2019-05-13  9:26 UTC (permalink / raw)
  To: Gary Lin, bpf, Alexei Starovoitov; +Cc: Martin KaFai Lau

On 05/13/2019 11:11 AM, Gary Lin wrote:
> 'VAL' should be protected by the brackets.
> 
> Fixes: 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)")
> Signed-off-by: Gary Lin <glin@suse.com>
> ---
>  include/uapi/linux/btf.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/btf.h b/include/uapi/linux/btf.h
> index 9310652ca4f9..63ae4a39e58b 100644
> --- a/include/uapi/linux/btf.h
> +++ b/include/uapi/linux/btf.h
> @@ -83,7 +83,7 @@ struct btf_type {
>   * is the 32 bits arrangement:
>   */
>  #define BTF_INT_ENCODING(VAL)	(((VAL) & 0x0f000000) >> 24)
> -#define BTF_INT_OFFSET(VAL)	(((VAL  & 0x00ff0000)) >> 16)
> +#define BTF_INT_OFFSET(VAL)	(((VAL) & 0x00ff0000) >> 16)
>  #define BTF_INT_BITS(VAL)	((VAL)  & 0x000000ff)
>  
>  /* Attributes stored in the BTF_INT_ENCODING */
> 

I'm okay with that fix, but could you please squash patch 1 and
patch 2 into a single one? I don't think it's worth splitting them
here.

Thanks,
Daniel

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

end of thread, other threads:[~2019-05-13  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13  9:11 [PATCH bpf-next 1/2] bpf: btf: fix the brackets of BTF_INT_OFFSET() Gary Lin
2019-05-13  9:11 ` [PATCH bpf-next 2/2] docs/btf: update BTF_INT_OFFSET() Gary Lin
2019-05-13  9:26 ` [PATCH bpf-next 1/2] bpf: btf: fix the brackets of BTF_INT_OFFSET() Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).