netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: a@unstable.cc
Cc: netdev@vger.kernel.org, cake@lists.bufferbloat.net, toke@toke.dk,
	jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	stephen@networkplumber.org
Subject: Re: [PATCH] net/sch_generic.h: use sizeof_member() and get rid of unused variable
Date: Tue, 19 May 2020 15:40:19 -0700 (PDT)	[thread overview]
Message-ID: <20200519.154019.1247104207621510920.davem@davemloft.net> (raw)
In-Reply-To: <20200519091333.20923-1-a@unstable.cc>

From: Antonio Quartulli <a@unstable.cc>
Date: Tue, 19 May 2020 11:13:33 +0200

> Compiling with -Wunused triggers the following warning:
> 
> ./include/net/sch_generic.h: In function ‘qdisc_cb_private_validate’:
> ./include/net/sch_generic.h:464:23: warning: unused variable ‘qcb’ [-Wunused-variable]
>   464 |  struct qdisc_skb_cb *qcb;
>       |                       ^~~
> 
> as the qcb variable is only used to compute the sizeof one of its members.

It's referenced in the code, therefore it is not "unused".

If in some configuration BUILD_BUG_ON() does not reference it's arguments,
that's the bug that needs to be fixed.

  reply	other threads:[~2020-05-19 22:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19  9:13 [PATCH] net/sch_generic.h: use sizeof_member() and get rid of unused variable Antonio Quartulli
2020-05-19 22:40 ` David Miller [this message]
2020-05-20  8:39   ` Antonio Quartulli
2020-05-20 18:17     ` David Miller
2020-05-20 21:25       ` Antonio Quartulli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200519.154019.1247104207621510920.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=a@unstable.cc \
    --cc=cake@lists.bufferbloat.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=toke@toke.dk \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).