All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] treewide conversion to sizeof_member() for v5.5-rc1
@ 2019-12-07 19:48 Kees Cook
  2019-12-08 23:19 ` Linus Torvalds
  0 siblings, 1 reply; 4+ messages in thread
From: Kees Cook @ 2019-12-07 19:48 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, David Miller, Pankaj Bharadiya, Alexey Dobriyan,
	Joe Perches

Hi Linus,

Please pull this mostly mechanical treewide conversion to the single and
more accurately named sizeof_member() macro for the end of v5.5-rc1. This
replaces 3 macros of the same behavior (FIELD_SIZEOF(), SIZEOF_FIELD(),
and sizeof_field()). The last patch in the series has a script in the
commit log to do the conversion, if you want to compare the results.
(Since v5.4-rc2, there are 4 new users of the old macros, if you care
to refresh the commit.)

I believe the concerns from your feedback on the v5.4 pull request[1]
have been addressed with an Ack from Dave Miller[2], and clarification
of the naming[3]. The series has lived in linux-next for the entire
development cycle and had only 1 trivial conflict[4].

As there are a few new users of the old macros in your tree and in
linux-next (targeting the next merge window), I will clean up those final
users during this coming development cycle and send the final old macro
removal patch[5] at that time.

Thanks!

-Kees

[1] https://lore.kernel.org/lkml/CAHk-=wg8+eNK+SK1Ekqm0qNQHVM6e6YOdZx3yhsX6Ajo3gEupg@mail.gmail.com/
[2] https://lore.kernel.org/lkml/20191002.132121.402975401040540710.davem@davemloft.net/
[3] https://lore.kernel.org/lkml/20190927065700.GA2215@avx2/
[4] https://lore.kernel.org/lkml/20191106160331.016b2521@canb.auug.org.au/
[5] https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=kspp/sizeof_member/slow-full&id=4aa9c5de448cdb804c83f285d63a93c249ba6fa5

The following changes since commit da0c9ea146cbe92b832f1b0f694840ea8eb33cce:

  Linux 5.4-rc2 (2019-10-06 14:27:30 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/sizeof_member-v5.5-rc1

for you to fetch changes up to ec2f877856e0af3889940e00b160f7f20f8d774f:

  treewide: Use sizeof_member() macro (2019-10-29 15:35:27 -0700)

----------------------------------------------------------------
treewide conversion to new sizeof_member() macro

----------------------------------------------------------------
Pankaj Bharadiya (3):
      MIPS: OCTEON: Replace SIZEOF_FIELD() macro
      linux/stddef.h: Add sizeof_member() macro
      treewide: Use sizeof_member() macro

 Documentation/process/coding-style.rst             |   2 +-
 .../translations/it_IT/process/coding-style.rst    |   2 +-
 .../translations/zh_CN/process/coding-style.rst    |   2 +-
 arch/arc/kernel/unwind.c                           |   6 +-
 arch/arm64/include/asm/processor.h                 |  10 +-
 arch/mips/cavium-octeon/executive/cvmx-bootmem.c   |   9 +-
 arch/powerpc/net/bpf_jit32.h                       |   4 +-
 arch/powerpc/net/bpf_jit_comp.c                    |  16 +--
 arch/sparc/net/bpf_jit_comp_32.c                   |   8 +-
 arch/x86/kernel/fpu/xstate.c                       |   2 +-
 block/blk-core.c                                   |   4 +-
 crypto/adiantum.c                                  |   4 +-
 crypto/essiv.c                                     |   2 +-
 drivers/firmware/efi/efi.c                         |   2 +-
 drivers/gpu/drm/i915/gvt/scheduler.c               |   2 +-
 drivers/infiniband/hw/efa/efa_verbs.c              |   2 +-
 drivers/infiniband/hw/hfi1/sdma.c                  |   2 +-
 drivers/infiniband/hw/hfi1/verbs.h                 |   4 +-
 drivers/infiniband/ulp/opa_vnic/opa_vnic_ethtool.c |   2 +-
 drivers/input/keyboard/applespi.c                  |   2 +-
 drivers/md/raid5-ppl.c                             |   2 +-
 drivers/media/platform/omap3isp/isppreview.c       |  24 ++--
 drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c       |   4 +-
 .../net/ethernet/cavium/liquidio/octeon_console.c  |  16 +--
 drivers/net/ethernet/emulex/benet/be_ethtool.c     |   2 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    |   2 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  |   2 +-
 drivers/net/ethernet/huawei/hinic/hinic_ethtool.c  |   8 +-
 drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c   |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c     |   2 +-
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c     |   2 +-
 drivers/net/ethernet/intel/ice/ice_ethtool.c       |  10 +-
 drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h     |   2 +-
 drivers/net/ethernet/intel/igb/igb_ethtool.c       |   4 +-
 drivers/net/ethernet/intel/igc/igc_ethtool.c       |   4 +-
 drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c     |   4 +-
 drivers/net/ethernet/intel/ixgbevf/ethtool.c       |   4 +-
 drivers/net/ethernet/marvell/mv643xx_eth.c         |   4 +-
 drivers/net/ethernet/mellanox/mlx4/en_ethtool.c    |   2 +-
 .../net/ethernet/mellanox/mlx5/core/fpga/ipsec.c   |   6 +-
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c  |   4 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c |   4 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c |   2 +-
 drivers/net/ethernet/netronome/nfp/bpf/jit.c       |  10 +-
 drivers/net/ethernet/netronome/nfp/bpf/main.c      |   2 +-
 drivers/net/ethernet/netronome/nfp/bpf/offload.c   |   2 +-
 drivers/net/ethernet/netronome/nfp/flower/main.h   |   2 +-
 .../ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c    |   2 +-
 drivers/net/ethernet/qlogic/qede/qede.h            |   2 +-
 .../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c    |   2 +-
 drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c |   2 +-
 .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c   |   4 +-
 drivers/net/ethernet/ti/cpsw_ethtool.c             |   6 +-
 drivers/net/ethernet/ti/netcp_ethss.c              |  32 ++---
 drivers/net/fjes/fjes_ethtool.c                    |   2 +-
 drivers/net/geneve.c                               |   2 +-
 drivers/net/hyperv/netvsc_drv.c                    |   2 +-
 drivers/net/usb/sierra_net.c                       |   2 +-
 drivers/net/usb/usbnet.c                           |   2 +-
 drivers/net/vxlan.c                                |   4 +-
 drivers/net/wireless/marvell/libertas/debugfs.c    |   2 +-
 drivers/net/wireless/marvell/mwifiex/util.h        |   4 +-
 drivers/s390/net/qeth_core_main.c                  |   2 +-
 drivers/s390/net/qeth_core_mpc.h                   |  10 +-
 drivers/scsi/aacraid/aachba.c                      |   4 +-
 drivers/scsi/be2iscsi/be_cmds.h                    |   2 +-
 drivers/scsi/cxgbi/libcxgbi.c                      |   2 +-
 drivers/scsi/smartpqi/smartpqi_init.c              |   6 +-
 drivers/staging/qlge/qlge_ethtool.c                |   2 +-
 drivers/target/iscsi/cxgbit/cxgbit_main.c          |   2 +-
 drivers/usb/atm/usbatm.c                           |   2 +-
 drivers/usb/gadget/function/f_fs.c                 |   2 +-
 fs/befs/linuxvfs.c                                 |   2 +-
 fs/crypto/keyring.c                                |   2 +-
 fs/ext2/super.c                                    |   2 +-
 fs/ext4/super.c                                    |   2 +-
 fs/freevxfs/vxfs_super.c                           |   2 +-
 fs/fuse/virtio_fs.c                                |   2 +-
 fs/orangefs/super.c                                |   2 +-
 fs/ufs/super.c                                     |   2 +-
 fs/verity/enable.c                                 |   2 +-
 include/linux/filter.h                             |  12 +-
 include/linux/kvm_host.h                           |   2 +-
 include/linux/phy_led_triggers.h                   |   2 +-
 include/linux/slab.h                               |   2 +-
 include/linux/stddef.h                             |  13 +-
 include/net/garp.h                                 |   2 +-
 include/net/ip_tunnels.h                           |   6 +-
 include/net/mrp.h                                  |   2 +-
 include/net/netfilter/nf_conntrack_helper.h        |   2 +-
 include/net/netfilter/nf_tables_core.h             |   2 +-
 include/net/sock.h                                 |   2 +-
 ipc/util.c                                         |   2 +-
 kernel/bpf/cgroup.c                                |   2 +-
 kernel/bpf/local_storage.c                         |   4 +-
 kernel/fork.c                                      |   2 +-
 kernel/signal.c                                    |  12 +-
 kernel/utsname.c                                   |   2 +-
 net/802/mrp.c                                      |   6 +-
 net/batman-adv/main.c                              |   2 +-
 net/bridge/br.c                                    |   2 +-
 net/caif/caif_socket.c                             |   2 +-
 net/core/dev.c                                     |   2 +-
 net/core/filter.c                                  | 140 ++++++++++-----------
 net/core/flow_dissector.c                          |  10 +-
 net/core/skbuff.c                                  |   2 +-
 net/core/xdp.c                                     |   4 +-
 net/dccp/proto.c                                   |   2 +-
 net/ipv4/ip_gre.c                                  |   4 +-
 net/ipv4/ip_vti.c                                  |   4 +-
 net/ipv4/raw.c                                     |   2 +-
 net/ipv4/tcp.c                                     |   2 +-
 net/ipv6/ip6_gre.c                                 |   4 +-
 net/ipv6/raw.c                                     |   2 +-
 net/iucv/af_iucv.c                                 |   2 +-
 net/netfilter/nf_tables_api.c                      |   4 +-
 net/netfilter/nfnetlink_cthelper.c                 |   2 +-
 net/netfilter/nft_ct.c                             |  12 +-
 net/netfilter/nft_masq.c                           |   2 +-
 net/netfilter/nft_nat.c                            |   6 +-
 net/netfilter/nft_redir.c                          |   2 +-
 net/netfilter/nft_tproxy.c                         |   4 +-
 net/netfilter/xt_RATEEST.c                         |   2 +-
 net/netlink/af_netlink.c                           |   2 +-
 net/openvswitch/datapath.c                         |   2 +-
 net/openvswitch/flow.h                             |   4 +-
 net/rxrpc/af_rxrpc.c                               |   2 +-
 net/sched/act_ct.c                                 |   4 +-
 net/sched/cls_flower.c                             |   2 +-
 net/sctp/socket.c                                  |   4 +-
 net/unix/af_unix.c                                 |   2 +-
 security/integrity/ima/ima_policy.c                |   4 +-
 sound/soc/codecs/hdmi-codec.c                      |   2 +-
 tools/testing/selftests/bpf/bpf_util.h             |   6 +-
 virt/kvm/kvm_main.c                                |   2 +-
 136 files changed, 340 insertions(+), 336 deletions(-)

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [GIT PULL] treewide conversion to sizeof_member() for v5.5-rc1
  2019-12-07 19:48 [GIT PULL] treewide conversion to sizeof_member() for v5.5-rc1 Kees Cook
@ 2019-12-08 23:19 ` Linus Torvalds
  2019-12-08 23:40   ` joe
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2019-12-08 23:19 UTC (permalink / raw)
  To: Kees Cook
  Cc: Linux Kernel Mailing List, David Miller, Pankaj Bharadiya,
	Alexey Dobriyan, Joe Perches

On Sat, Dec 7, 2019 at 11:48 AM Kees Cook <keescook@chromium.org> wrote:
>
> Please pull this mostly mechanical treewide conversion to the single and
> more accurately named sizeof_member() macro for the end of v5.5-rc1.

So this one I'm _still_ not convinced about. It makes yet another name
for something we've had before, which just annoys me. And maybe it's
the 13-year old in me, but "sizeof_member()" just makes me go "that's
puerile".

I _can_ see why we'd want to standardize on one of the tree versions
we have, but I can't really see the problem with the existing #define
that we have, and that is used (admittedly not all that much):
sizeof_field().

                Linus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [GIT PULL] treewide conversion to sizeof_member() for v5.5-rc1
  2019-12-08 23:19 ` Linus Torvalds
@ 2019-12-08 23:40   ` joe
  2019-12-08 23:53     ` Linus Torvalds
  0 siblings, 1 reply; 4+ messages in thread
From: joe @ 2019-12-08 23:40 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Kees Cook, Linux Kernel Mailing List, David Miller,
	Pankaj Bharadiya, Alexey Dobriyan

On 2019-12-08 17:19, Linus Torvalds wrote:
> maybe it's
> the 13-year old in me, but "sizeof_member()" just makes me go "that's
> puerile.

The 13 year old in you could grow up one day.  Most 13 year olds don't 
even know that word btw.

> I _can_ see why we'd want to standardize on one of the tree versions
> we have, but I can't really see the problem with the existing #define
> that we have, and that is used (admittedly not all that much):
> sizeof_field()

Call it what the standard calls it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [GIT PULL] treewide conversion to sizeof_member() for v5.5-rc1
  2019-12-08 23:40   ` joe
@ 2019-12-08 23:53     ` Linus Torvalds
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Torvalds @ 2019-12-08 23:53 UTC (permalink / raw)
  To: Joe Perches
  Cc: Kees Cook, Linux Kernel Mailing List, David Miller,
	Pankaj Bharadiya, Alexey Dobriyan

On Sun, Dec 8, 2019 at 3:40 PM <joe@perches.com> wrote:
>
> Call it what the standard calls it.

... or, you know, call it what the individual parts of a data
structure is called in computer science in general: fields.

That really is standard naming too, Joe. Just to quote Wikipedia

  "A record (also called tuple or struct) is an aggregate data
structure. A record is a value that contains other values, typically
in fixed number and sequence and typically indexed by names. The
elements of records are usually called fields or members"

see?

Do we name things by their C implementation, or by their generic CS
names? Sometimes one, sometimes the other.

But the fact is, "field" really isn't wrong AND IT IS WHAT WE ALREADY USE.

And last time I pointed out that at least according to a quick grep,
we use "field" a whole lot more than we use "member".

Possibly exactly because that's the typical generic name.

             Linus

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-08 23:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-07 19:48 [GIT PULL] treewide conversion to sizeof_member() for v5.5-rc1 Kees Cook
2019-12-08 23:19 ` Linus Torvalds
2019-12-08 23:40   ` joe
2019-12-08 23:53     ` Linus Torvalds

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.