linux_old1/net/decnet
Gustavo A. R. Silva bb3e16ad8b net, decnet: use struct_size() in kzalloc()
One of the more common cases of allocation size calculations is finding the
size of a structure that has a zero-sized array at the end, along with memory
for some number of elements for that array. For example:

struct foo {
    int stuff;
    struct boo entry[];
};

instance = kzalloc(sizeof(struct foo) + count * sizeof(struct boo), GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can now
use the new struct_size() helper:

instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-16 13:22:10 -08:00
..
netfilter decnet: whitespace fixes 2018-07-24 14:10:42 -07:00
Kconfig decnet: whitespace fixes 2018-07-24 14:10:42 -07:00
Makefile decnet: whitespace fixes 2018-07-24 14:10:42 -07:00
README
TODO decnet: whitespace fixes 2018-07-24 14:10:42 -07:00
af_decnet.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-12-27 13:04:52 -08:00
dn_dev.c decnet: Remove unnecessary check for dev->name 2018-09-21 19:48:36 -07:00
dn_fib.c net, decnet: use struct_size() in kzalloc() 2019-01-16 13:22:10 -08:00
dn_neigh.c proc: introduce proc_create_net{,_data} 2018-05-16 07:24:30 +02:00
dn_nsp_in.c decnet: whitespace fixes 2018-07-24 14:10:42 -07:00
dn_nsp_out.c decnet: whitespace fixes 2018-07-24 14:10:42 -07:00
dn_route.c mm: convert totalram_pages and totalhigh_pages variables to atomic 2018-12-28 12:11:47 -08:00
dn_rules.c decnet: whitespace fixes 2018-07-24 14:10:42 -07:00
dn_table.c net: decnet: dn_table: mark expected switch fall-through 2017-11-11 19:10:06 +09:00
dn_timer.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
sysctl_net_decnet.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00

README

                       Linux DECnet Project
                      ======================

The documentation for this kernel subsystem is available in the
Documentation/networking subdirectory of this distribution and also
on line at http://www.chygwyn.com/DECnet/

Steve Whitehouse <SteveW@ACM.org>