linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: gustavo@embeddedor.com
Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: sched: cls_u32: use struct_size() helper
Date: Sat, 04 May 2019 00:47:00 -0400 (EDT)	[thread overview]
Message-ID: <20190504.004700.1643902028919203643.davem@davemloft.net> (raw)
In-Reply-To: <20190501162315.GA27166@embeddedor>

From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Wed, 1 May 2019 11:23:15 -0500

> Make use of the struct_size() helper instead of an open-coded version
> in order to avoid any potential type mistakes, in particular in the
> context in which this code is being used.
> 
> So, replace code of the following form:
> 
> sizeof(*s) + s->nkeys*sizeof(struct tc_u32_key)
> 
> with:
> 
> struct_size(s, keys, s->nkeys)
> 
> This code was detected with the help of Coccinelle.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Applied.

  reply	other threads:[~2019-05-04  4:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-01 16:23 [PATCH net-next] net: sched: cls_u32: use struct_size() helper Gustavo A. R. Silva
2019-05-04  4:47 ` David Miller [this message]
2019-05-23 23:22 ` Gustavo A. R. Silva
2019-05-23 23:25   ` Gustavo A. R. Silva

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=20190504.004700.1643902028919203643.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=gustavo@embeddedor.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --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).