linux/net/nfc
Johannes Berg 3b0f31f2b8 genetlink: make policy common to family
Since maxattr is common, the policy can't really differ sanely,
so make it common as well.

The only user that did in fact manage to make a non-common policy
is taskstats, which has to be really careful about it (since it's
still using a common maxattr!). This is no longer supported, but
we can fake it using pre_doit.

This reduces the size of e.g. nl80211.o (which has lots of commands):

   text	   data	    bss	    dec	    hex	filename
 398745	  14323	   2240	 415308	  6564c	net/wireless/nl80211.o (before)
 397913	  14331	   2240	 414484	  65314	net/wireless/nl80211.o (after)
--------------------------------
   -832      +8       0    -824

Which is obviously just 8 bytes for each command, and an added 8
bytes for the new policy pointer. I'm not sure why the ops list is
counted as .text though.

Most of the code transformations were done using the following spatch:
    @ops@
    identifier OPS;
    expression POLICY;
    @@
    struct genl_ops OPS[] = {
    ...,
     {
    -	.policy = POLICY,
     },
    ...
    };

    @@
    identifier ops.OPS;
    expression ops.POLICY;
    identifier fam;
    expression M;
    @@
    struct genl_family fam = {
            .ops = OPS,
            .maxattr = M,
    +       .policy = POLICY,
            ...
    };

This also gets rid of devlink_nl_cmd_region_read_dumpit() accessing
the cb->data as ops, which we want to change in a later genl patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-22 10:38:23 -04:00
..
hci NFC: Fix possible memory corruption when handling SHDLC I-Frame commands 2018-09-18 19:55:01 -07:00
nci Merge branch 'work.tty-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-10-24 14:43:41 +01:00
af_nfc.c net: socket: mark socket protocol handler structs as const 2017-05-16 11:54:07 -04:00
core.c NFC: Convert timers to use timer_setup() 2017-11-06 01:12:10 +01:00
digital_core.c NFC: digital: Abort cmd when deactivating target 2017-11-10 00:03:39 +01:00
digital_dep.c NFC: digital: NFC-DEP Target WT(nfcdep,max) is now 14 2017-06-23 00:19:59 +02:00
digital_technology.c NFC: digital: NFC-A SEL_RES must be one byte 2017-06-23 00:19:59 +02:00
digital.h NFC: digital: Add 'tg_listen_md' and 'tg_get_rf_tech' driver hooks 2014-07-23 01:17:31 +02:00
Kconfig NFC Digital: Add NFC-F technology support 2013-09-25 02:02:25 +02:00
llcp_commands.c net: nfc: Fix NULL dereference on nfc_llcp_build_tlv fails 2019-02-27 12:47:08 -08:00
llcp_core.c net: nfc: Fix NULL dereference on nfc_llcp_build_tlv fails 2019-02-27 12:47:08 -08:00
llcp_sock.c Revert "net: simplify sock_poll_wait" 2018-10-23 10:57:06 -07:00
llcp.h net: Pass kern from net_proto_family.create to sk_alloc 2015-05-11 10:50:17 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
netlink.c genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
nfc.h nfc: netlink: HCI event connectivity implementation 2015-12-29 19:06:20 +01:00
rawsock.c Revert changes to convert to ->poll_mask() and aio IOCB_CMD_POLL 2018-06-28 10:40:47 -07:00