Skip to content

Commit

Permalink
xdp: remove redundant variable 'headroom'
Browse files Browse the repository at this point in the history
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 <colin.king@canonical.com>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Colin Ian King authored and Daniel Borkmann committed Aug 31, 2018
1 parent 18baed2 commit 7296216
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/core/xdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,14 @@ 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;

/* 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)
Expand Down

0 comments on commit 7296216

Please sign in to comment.