[PATCH][net-next] xdp: remove redundant variable 'headroom'

Subsystems: networking [general], the rest, xdp (express data path)

STALE2899d

3 messages, 3 authors, 2018-08-31 · open the first message on its own page

[PATCH][net-next] xdp: remove redundant variable 'headroom'

From: Colin King <hidden>
Date: 2018-08-30 14:27:26

From: Colin Ian King <redacted>

Variable 'headroom' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
variable ‘headroom’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <redacted>
---
 net/core/xdp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/xdp.c b/net/core/xdp.c
index 654dbb19707e..4b2b194f4f1f 100644
--- a/net/core/xdp.c
+++ b/net/core/xdp.c
@@ -412,7 +412,7 @@ EXPORT_SYMBOL_GPL(xdp_attachment_setup);
 
 struct xdp_frame *xdp_convert_zc_to_xdp_frame(struct xdp_buff *xdp)
 {
-	unsigned int metasize, headroom, totsize;
+	unsigned int metasize, totsize;
 	void *addr, *data_to_copy;
 	struct xdp_frame *xdpf;
 	struct page *page;
@@ -420,7 +420,6 @@ struct xdp_frame *xdp_convert_zc_to_xdp_frame(struct xdp_buff *xdp)
 	/* Clone into a MEM_TYPE_PAGE_ORDER0 xdp_frame. */
 	metasize = xdp_data_meta_unsupported(xdp) ? 0 :
 		   xdp->data - xdp->data_meta;
-	headroom = xdp->data - xdp->data_hard_start;
 	totsize = xdp->data_end - xdp->data + metasize;
 
 	if (sizeof(*xdpf) + totsize > PAGE_SIZE)
-- 
2.17.1

Re: [PATCH][net-next] xdp: remove redundant variable 'headroom'

From: Björn Töpel <hidden>
Date: 2018-08-30 14:37:58

On 2018-08-30 16:27, Colin King wrote:
quoted hunk
From: Colin Ian King <redacted>

Variable 'headroom' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
variable ‘headroom’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <redacted>
---
  net/core/xdp.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/xdp.c b/net/core/xdp.c
index 654dbb19707e..4b2b194f4f1f 100644
--- a/net/core/xdp.c
+++ b/net/core/xdp.c
@@ -412,7 +412,7 @@ EXPORT_SYMBOL_GPL(xdp_attachment_setup);
  
  struct xdp_frame *xdp_convert_zc_to_xdp_frame(struct xdp_buff *xdp)
  {
-	unsigned int metasize, headroom, totsize;
+	unsigned int metasize, totsize;
  	void *addr, *data_to_copy;
  	struct xdp_frame *xdpf;
  	struct page *page;
@@ -420,7 +420,6 @@ struct xdp_frame *xdp_convert_zc_to_xdp_frame(struct xdp_buff *xdp)
  	/* Clone into a MEM_TYPE_PAGE_ORDER0 xdp_frame. */
  	metasize = xdp_data_meta_unsupported(xdp) ? 0 :
  		   xdp->data - xdp->data_meta;
-	headroom = xdp->data - xdp->data_hard_start;
  	totsize = xdp->data_end - xdp->data + metasize;
  
  	if (sizeof(*xdpf) + totsize > PAGE_SIZE)
This should go via bpf-next. Thanks for the fix!

Acked-by: Björn Töpel <redacted>

Re: [PATCH][net-next] xdp: remove redundant variable 'headroom'

From: Alexei Starovoitov <hidden>
Date: 2018-08-31 02:50:21

On Thu, Aug 30, 2018 at 04:37:50PM +0200, Björn Töpel wrote:
On 2018-08-30 16:27, Colin King wrote:
quoted
From: Colin Ian King <redacted>

Variable 'headroom' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
variable ‘headroom’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <redacted>
---
  net/core/xdp.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/xdp.c b/net/core/xdp.c
index 654dbb19707e..4b2b194f4f1f 100644
--- a/net/core/xdp.c
+++ b/net/core/xdp.c
@@ -412,7 +412,7 @@ EXPORT_SYMBOL_GPL(xdp_attachment_setup);
  struct xdp_frame *xdp_convert_zc_to_xdp_frame(struct xdp_buff *xdp)
  {
-	unsigned int metasize, headroom, totsize;
+	unsigned int metasize, totsize;
  	void *addr, *data_to_copy;
  	struct xdp_frame *xdpf;
  	struct page *page;
@@ -420,7 +420,6 @@ struct xdp_frame *xdp_convert_zc_to_xdp_frame(struct xdp_buff *xdp)
  	/* Clone into a MEM_TYPE_PAGE_ORDER0 xdp_frame. */
  	metasize = xdp_data_meta_unsupported(xdp) ? 0 :
  		   xdp->data - xdp->data_meta;
-	headroom = xdp->data - xdp->data_hard_start;
  	totsize = xdp->data_end - xdp->data + metasize;
  	if (sizeof(*xdpf) + totsize > PAGE_SIZE)
This should go via bpf-next. Thanks for the fix!

Acked-by: Björn Töpel <redacted>
Applied, Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help