kernel/fork.c: use sizeof() instead of sizeof
Subsystems (136)
PATCH 1/1 kernel/fork.c: use sizeof() instead of sizeof
This patch fixes the checkpatch.pl warning to fork.c:
WARNING: sizeof sig->rlim should be sizeof(sig->rlim)
--- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/fork.c +1 -1
@@ -1143,7 +1143,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) sig->real_timer.function = it_real_fn;task_lock (current->group_leader); -memcpy (sig->rlim, current->signal->rlim,sizeof sig->rlim); +memcpy (sig->rlim, current->signal->rlim,sizeof (sig->rlim));task_unlock (current->group_leader);posix_cpu_timers_init_group (sig);
Signature · 1 line
1.9.1
Quoted 14 lines · Wei Tang
This patch fixes the checkpatch.pl warning to
fork.c:WARNING: sizeof
sig->rlimshould besizeof(sig->rlim)Signed-off-by Wei Tang <[email protected]>--- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/fork.c +0
-0
kernel/fork.c static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) · line 1149
Quoted 8 lines
kernel/fork.c +1
-1@@ -1143,7 +1143,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) sig->real_timer.function = it_real_fn;task_lock (current->group_leader); -memcpy (sig->rlim, current->signal->rlim,sizeof sig->rlim); +memcpy (sig->rlim, current->signal->rlim,sizeof (sig->rlim));task_unlock (current->group_leader);posix_cpu_timers_init_group (sig);
So there's over 1,000 such occurances in the kernel and we do not need this drip-drip churn...
If anyone feels strongly about accepting such patches, then the right solution is to create a Coccinelle semantic patch to run over the whole kernel and get over with the churn once and for all.
Thanks,
Ingo
PATCH 1/1 treewide: Use 'sizeof(x)' instead of 'sizeof x'
Quoted 3 lines · Ingo Molnar
If anyone feels strongly about accepting such patches, then the right solution is to create a Coccinelle semantic patch to run over the whole kernel and get over with the churn once and for all.
So applying a semantic patch like this to all .c files:
@@ expression E; @@
-sizeof E
+sizeof(E)
@@ expression E2; @@
-sizeof((E2))
+sizeof(E2)
Produces the single patch below for the whole kernel - instead of generating a churn of 1,000+ patches ...
Since it's Coccinelle that generated the patch we can be reasonably sure that it's an identity transformation - or if it fails, it's a visible failure.
Thanks,
Ingo
--- arch/alpha/kernel/setup.c | 4 +- arch/alpha/oprofile/common.c | 2 +- arch/arm/common/mcpm_entry.c | 2 +- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-ixp4xx/common.c | 2 +- arch/arm/mach-pxa/devices.c | 2 +- arch/arm/mach-u300/dummyspichip.c | 2 +- arch/cris/arch-v10/kernel/traps.c | 2 +- arch/cris/arch-v32/mach-a3/pinmux.c | 12 +- arch/cris/arch-v32/mach-fs/pinmux.c | 12 +- arch/cris/arch-v32/mm/intmem.c | 6 +- arch/cris/boot/tools/build.c | 8 +- arch/ia64/kernel/mca_drv.c | 2 +- arch/m68k/bvme6000/rtc.c | 2 +- arch/m68k/mvme16x/rtc.c | 2 +- arch/mips/boot/elf2ecoff.c | 29 ++- arch/mips/kernel/module.c | 2 +- arch/mips/oprofile/common.c | 2 +- arch/mips/sgi-ip22/ip22-gio.c | 2 +- arch/parisc/kernel/cache.c | 2 +- arch/parisc/kernel/process.c | 2 +- arch/parisc/math-emu/driver.c | 4 +- arch/powerpc/crypto/sha1.c | 2 +- arch/powerpc/kernel/kgdb.c | 6 +- arch/powerpc/oprofile/common.c | 2 +- arch/powerpc/platforms/52xx/mpc52xx_gpt.c | 2 +- arch/powerpc/platforms/cell/spufs/context.c | 2 +- arch/powerpc/platforms/cell/spufs/file.c | 22 +- arch/powerpc/platforms/cell/spufs/gang.c | 2 +- arch/s390/crypto/sha_common.c | 2 +- arch/sparc/lib/bitext.c | 2 +- arch/tile/kernel/backtrace.c | 6 +- arch/um/kernel/um_arch.c | 2 +- arch/x86/boot/cpucheck.c | 2 +- arch/x86/boot/early_serial_console.c | 4 +- arch/x86/boot/edd.c | 6 +- arch/x86/boot/main.c | 4 +- arch/x86/boot/memory.c | 2 +- arch/x86/boot/regs.c | 2 +- arch/x86/boot/video-vesa.c | 6 +- arch/x86/boot/video.c | 2 +- arch/x86/kernel/cpu/common.c | 4 +- arch/x86/kernel/cpu/mcheck/mce.c | 2 +- arch/x86/kernel/cpu/mtrr/generic.c | 2 +- arch/x86/kernel/cpu/mtrr/if.c | 8 +- arch/x86/kernel/e820.c | 2 +- arch/x86/kernel/head64.c | 2 +- arch/x86/kernel/msr.c | 8 +- arch/x86/kvm/assigned-dev.c | 14 +- arch/x86/kvm/emulate.c | 22 +- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/x86.c | 46 ++-- arch/x86/tools/relocs.c | 4 +- drivers/acpi/acpi_video.c | 2 +- drivers/ata/sata_promise.c | 2 +- drivers/atm/iphase.c | 2 +- drivers/atm/lanai.c | 2 +- drivers/base/isa.c | 2 +- drivers/base/power/sysfs.c | 16 +- drivers/base/regmap/regcache-lzo.c | 2 +- drivers/base/regmap/regcache-rbtree.c | 2 +- drivers/block/aoe/aoeblk.c | 4 +- drivers/block/aoe/aoechr.c | 4 +- drivers/block/aoe/aoecmd.c | 26 +-- drivers/block/aoe/aoedev.c | 6 +- drivers/block/cciss.c | 2 +- drivers/char/genrtc.c | 2 +- drivers/char/rtc.c | 2 +- drivers/crypto/nx/nx-aes-xcbc.c | 2 +- drivers/crypto/nx/nx-sha256.c | 2 +- drivers/crypto/nx/nx-sha512.c | 2 +- drivers/firewire/nosy.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- drivers/gpu/drm/drm_atomic.c | 12 +- drivers/gpu/drm/i915/intel_display.c | 4 +- drivers/gpu/drm/radeon/radeon_display.c | 2 +- drivers/i2c/i2c-core.c | 2 +- drivers/iio/industrialio-trigger.c | 4 +- drivers/infiniband/core/addr.c | 4 +- drivers/infiniband/core/agent.c | 2 +- drivers/infiniband/core/cache.c | 12 +- drivers/infiniband/core/cm.c | 32 +-- drivers/infiniband/core/cma.c | 78 +++---- drivers/infiniband/core/device.c | 8 +- drivers/infiniband/core/fmr_pool.c | 8 +- drivers/infiniband/core/mad.c | 38 +-- drivers/infiniband/core/mad_rmpp.c | 2 +- drivers/infiniband/core/multicast.c | 16 +- drivers/infiniband/core/netlink.c | 2 +- drivers/infiniband/core/sa_query.c | 12 +- drivers/infiniband/core/sysfs.c | 6 +- drivers/infiniband/core/ucm.c | 8 +- drivers/infiniband/core/ucma.c | 18 +- drivers/infiniband/core/ud_header.c | 8 +- drivers/infiniband/core/umem.c | 2 +- drivers/infiniband/core/user_mad.c | 16 +- drivers/infiniband/core/uverbs_cmd.c | 260 ++++++++++----------- drivers/infiniband/core/uverbs_main.c | 10 +- drivers/infiniband/core/uverbs_marshall.c | 10 +- drivers/infiniband/core/verbs.c | 4 +- drivers/infiniband/hw/cxgb3/cxio_hal.c | 4 +- drivers/infiniband/hw/cxgb3/iwch_cm.c | 2 +- drivers/infiniband/hw/cxgb3/iwch_provider.c | 26 +-- drivers/infiniband/hw/cxgb4/cm.c | 14 +- drivers/infiniband/hw/cxgb4/cq.c | 10 +- drivers/infiniband/hw/cxgb4/device.c | 10 +- drivers/infiniband/hw/cxgb4/mem.c | 4 +- drivers/infiniband/hw/cxgb4/provider.c | 4 +- drivers/infiniband/hw/cxgb4/qp.c | 64 ++--- drivers/infiniband/hw/cxgb4/resource.c | 16 +- drivers/infiniband/hw/mlx4/ah.c | 4 +- drivers/infiniband/hw/mlx4/alias_GUID.c | 11 +- drivers/infiniband/hw/mlx4/cq.c | 14 +- drivers/infiniband/hw/mlx4/doorbell.c | 2 +- drivers/infiniband/hw/mlx4/mad.c | 30 +-- drivers/infiniband/hw/mlx4/main.c | 36 +-- drivers/infiniband/hw/mlx4/mcg.c | 30 +-- drivers/infiniband/hw/mlx4/mr.c | 2 +- drivers/infiniband/hw/mlx4/qp.c | 40 ++-- drivers/infiniband/hw/mlx4/srq.c | 6 +- drivers/infiniband/hw/mlx4/sysfs.c | 8 +- drivers/infiniband/hw/mthca/mthca_allocator.c | 8 +- drivers/infiniband/hw/mthca/mthca_av.c | 6 +- drivers/infiniband/hw/mthca/mthca_cmd.c | 2 +- drivers/infiniband/hw/mthca/mthca_cq.c | 2 +- drivers/infiniband/hw/mthca/mthca_eq.c | 6 +- drivers/infiniband/hw/mthca/mthca_mad.c | 6 +- drivers/infiniband/hw/mthca/mthca_main.c | 4 +- drivers/infiniband/hw/mthca/mthca_mcg.c | 2 +- drivers/infiniband/hw/mthca/mthca_memfree.c | 12 +- drivers/infiniband/hw/mthca/mthca_mr.c | 12 +- drivers/infiniband/hw/mthca/mthca_profile.c | 2 +- drivers/infiniband/hw/mthca/mthca_provider.c | 70 +++--- drivers/infiniband/hw/mthca/mthca_qp.c | 8 +- drivers/infiniband/hw/mthca/mthca_srq.c | 6 +- drivers/infiniband/hw/nes/nes_cm.c | 2 +- drivers/infiniband/hw/nes/nes_hw.c | 2 +- drivers/infiniband/hw/nes/nes_mgt.c | 4 +- drivers/infiniband/hw/nes/nes_verbs.c | 12 +- drivers/infiniband/hw/ocrdma/ocrdma_stats.c | 2 +- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 22 +- drivers/infiniband/ulp/ipoib/ipoib_fs.c | 10 +- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 4 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 16 +- drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 6 +- drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 2 +- drivers/infiniband/ulp/iser/iser_verbs.c | 6 +- drivers/infiniband/ulp/srp/ib_srp.c | 30 +-- drivers/infiniband/ulp/srpt/ib_srpt.c | 42 ++-- drivers/input/keyboard/lm8323.c | 2 +- drivers/input/misc/dm355evm_keys.c | 2 +- drivers/input/touchscreen/ad7877.c | 6 +- drivers/input/touchscreen/ads7846.c | 4 +- drivers/isdn/gigaset/bas-gigaset.c | 2 +- drivers/isdn/gigaset/capi.c | 2 +- drivers/isdn/gigaset/common.c | 6 +- drivers/isdn/gigaset/ev-layer.c | 2 +- drivers/isdn/gigaset/i4l.c | 12 +- drivers/isdn/gigaset/interface.c | 8 +- drivers/isdn/i4l/isdn_tty.c | 2 +- drivers/md/dm-bufio.c | 4 +- drivers/md/dm-kcopyd.c | 2 +- drivers/media/dvb-core/dvb_net.c | 4 +- drivers/media/i2c/tvp5150.c | 2 +- drivers/media/pci/ngene/ngene-dvb.c | 2 +- drivers/media/pci/saa7134/saa7134-video.c | 4 +- drivers/media/pci/ttpci/av7110_ir.c | 8 +- drivers/media/pci/ttpci/av7110_v4l.c | 4 +- drivers/media/platform/m2m-deinterlace.c | 2 +- drivers/media/platform/mx2_emmaprp.c | 2 +- drivers/media/rc/ir-rc6-decoder.c | 4 +- drivers/media/usb/gspca/etoms.c | 16 +- drivers/media/usb/gspca/gspca.c | 22 +- drivers/media/usb/gspca/jeilinj.c | 2 +- drivers/media/usb/gspca/mars.c | 2 +- drivers/media/usb/gspca/mr97310a.c | 6 +- drivers/media/usb/gspca/ov519.c | 2 +- drivers/media/usb/gspca/pac207.c | 4 +- drivers/media/usb/gspca/pac7302.c | 6 +- drivers/media/usb/gspca/pac7311.c | 4 +- drivers/media/usb/gspca/sn9c2028.c | 6 +- drivers/media/usb/gspca/sonixj.c | 14 +- drivers/media/usb/gspca/sq930x.c | 2 +- drivers/media/usb/gspca/t613.c | 72 +++--- drivers/media/usb/gspca/topro.c | 10 +- drivers/media/usb/gspca/zc3xx.c | 2 +- drivers/media/usb/uvc/uvc_ctrl.c | 6 +- drivers/media/usb/uvc/uvc_driver.c | 52 ++--- drivers/media/usb/uvc/uvc_v4l2.c | 12 +- drivers/media/usb/uvc/uvc_video.c | 2 +- drivers/media/v4l2-core/v4l2-mem2mem.c | 4 +- drivers/media/v4l2-core/videobuf2-dma-contig.c | 6 +- drivers/media/v4l2-core/videobuf2-dma-sg.c | 4 +- drivers/mfd/t7l66xb.c | 2 +- drivers/mfd/tc6393xb.c | 2 +- drivers/mfd/tps65010.c | 16 +- drivers/misc/apds990x.c | 2 +- drivers/misc/bh1770glc.c | 2 +- drivers/misc/eeprom/at25.c | 2 +- drivers/misc/ibmasm/r_heartbeat.c | 4 +- drivers/mtd/devices/m25p80.c | 2 +- drivers/mtd/devices/mtd_dataflash.c | 6 +- drivers/net/ethernet/marvell/skge.c | 2 +- drivers/net/ethernet/mellanox/mlx4/alloc.c | 4 +- drivers/net/ethernet/mellanox/mlx4/cmd.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_resources.c | 4 +- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2 +- drivers/net/ethernet/mellanox/mlx4/eq.c | 18 +- drivers/net/ethernet/mellanox/mlx4/icm.c | 2 +- drivers/net/ethernet/mellanox/mlx4/intf.c | 2 +- drivers/net/ethernet/mellanox/mlx4/main.c | 4 +- drivers/net/ethernet/mellanox/mlx4/mcg.c | 12 +- drivers/net/ethernet/mellanox/mlx4/mr.c | 6 +- drivers/net/ethernet/mellanox/mlx4/qp.c | 4 +- .../net/ethernet/mellanox/mlx4/resource_tracker.c | 24 +- drivers/net/usb/mcs7830.c | 4 +- drivers/net/usb/net1080.c | 14 +- drivers/net/usb/pegasus.c | 2 +- drivers/net/usb/rndis_host.c | 42 ++-- drivers/net/usb/sierra_net.c | 4 +- drivers/net/usb/usbnet.c | 12 +- drivers/net/usb/zaurus.c | 6 +- drivers/net/virtio_net.c | 2 +- drivers/net/wan/sbni.c | 6 +- drivers/net/wireless/marvell/mwifiex/scan.c | 3 +- drivers/net/wireless/rndis_wlan.c | 6 +- drivers/oprofile/oprofile_perf.c | 2 +- drivers/parport/parport_serial.c | 2 +- drivers/parport/probe.c | 2 +- drivers/pcmcia/bfin_cf_pcmcia.c | 2 +- drivers/pcmcia/omap_cf.c | 2 +- drivers/rapidio/rio.c | 2 +- drivers/s390/crypto/zcrypt_api.c | 4 +- drivers/scsi/aha152x.c | 2 +- drivers/scsi/lpfc/lpfc_init.c | 8 +- drivers/scsi/ultrastor.c | 2 +- drivers/scsi/virtio_scsi.c | 2 +- drivers/scsi/vmw_pvscsi.c | 4 +- drivers/spi/spi-lm70llp.c | 2 +- drivers/spi/spi-mpc512x-psc.c | 4 +- drivers/spi/spi-mpc52xx-psc.c | 4 +- drivers/spi/spi-mpc52xx.c | 2 +- drivers/spi/spi-omap-uwire.c | 2 +- drivers/spi/spi-omap2-mcspi.c | 4 +- drivers/spi/spi-ppc4xx.c | 4 +- drivers/staging/most/hdm-dim2/dim2_hdm.c | 4 +- drivers/staging/rdma/ehca/ehca_qp.c | 2 +- drivers/staging/rdma/ehca/ehca_uverbs.c | 2 +- drivers/staging/rdma/ipath/ipath_driver.c | 4 +- drivers/staging/rdma/ipath/ipath_eeprom.c | 12 +- drivers/staging/rdma/ipath/ipath_file_ops.c | 4 +- drivers/staging/rdma/ipath/ipath_fs.c | 8 +- drivers/staging/rdma/ipath/ipath_iba6110.c | 6 +- drivers/staging/rdma/ipath/ipath_init_chip.c | 2 +- drivers/staging/rdma/ipath/ipath_intr.c | 10 +- drivers/staging/rdma/ipath/ipath_mmap.c | 2 +- drivers/staging/rdma/ipath/ipath_mr.c | 10 +- drivers/staging/rdma/ipath/ipath_rc.c | 4 +- drivers/staging/rdma/ipath/ipath_ruc.c | 4 +- drivers/staging/rdma/ipath/ipath_stats.c | 8 +- drivers/staging/rdma/ipath/ipath_sysfs.c | 4 +- drivers/staging/rdma/ipath/ipath_uc.c | 2 +- drivers/staging/rdma/ipath/ipath_ud.c | 2 +- drivers/staging/rdma/ipath/ipath_verbs.c | 10 +- drivers/staging/rdma/ipath/ipath_verbs_mcast.c | 4 +- drivers/target/target_core_spc.c | 2 +- drivers/tty/pty.c | 4 +- drivers/tty/serial/8250/8250_of.c | 2 +- drivers/tty/serial/crisv10.c | 6 +- drivers/tty/vt/vt_ioctl.c | 4 +- drivers/usb/class/cdc-acm.c | 6 +- drivers/usb/core/hcd.c | 12 +- drivers/usb/core/hub.c | 12 +- drivers/usb/core/sysfs.c | 4 +- drivers/usb/core/usb.c | 4 +- drivers/usb/gadget/composite.c | 7 +- drivers/usb/gadget/function/f_acm.c | 4 +- drivers/usb/gadget/function/f_ecm.c | 20 +- drivers/usb/gadget/function/f_eem.c | 4 +- drivers/usb/gadget/function/f_fs.c | 10 +- drivers/usb/gadget/function/f_hid.c | 4 +- drivers/usb/gadget/function/f_loopback.c | 2 +- drivers/usb/gadget/function/f_mass_storage.c | 2 +- drivers/usb/gadget/function/f_ncm.c | 22 +- drivers/usb/gadget/function/f_phonet.c | 12 +- drivers/usb/gadget/function/f_rndis.c | 16 +- drivers/usb/gadget/function/f_serial.c | 2 +- drivers/usb/gadget/function/f_subset.c | 10 +- drivers/usb/gadget/function/f_uac1.c | 2 +- drivers/usb/gadget/function/f_uac2.c | 50 ++-- drivers/usb/gadget/function/rndis.c | 4 +- drivers/usb/gadget/function/storage_common.c | 2 +- drivers/usb/gadget/function/u_ether.c | 2 +- drivers/usb/gadget/legacy/acm_ms.c | 2 +- drivers/usb/gadget/legacy/audio.c | 2 +- drivers/usb/gadget/legacy/cdc2.c | 2 +- drivers/usb/gadget/legacy/dbgp.c | 8 +- drivers/usb/gadget/legacy/ether.c | 2 +- drivers/usb/gadget/legacy/g_ffs.c | 2 +- drivers/usb/gadget/legacy/hid.c | 2 +- drivers/usb/gadget/legacy/inode.c | 18 +- drivers/usb/gadget/legacy/mass_storage.c | 2 +- drivers/usb/gadget/legacy/multi.c | 2 +- drivers/usb/gadget/legacy/ncm.c | 2 +- drivers/usb/gadget/legacy/printer.c | 2 +- drivers/usb/gadget/legacy/zero.c | 2 +- drivers/usb/gadget/udc/dummy_hcd.c | 6 +- drivers/usb/gadget/udc/fsl_udc_core.c | 2 +- drivers/usb/gadget/udc/goku_udc.c | 4 +- drivers/usb/gadget/udc/mv_u3d_core.c | 2 +- drivers/usb/gadget/udc/mv_udc_core.c | 2 +- drivers/usb/gadget/udc/omap_udc.c | 6 +- drivers/usb/gadget/udc/pch_udc.c | 12 +- drivers/usb/gadget/udc/pxa25x_udc.c | 2 +- drivers/usb/gadget/udc/pxa27x_udc.c | 4 +- drivers/usb/host/ehci-dbg.c | 16 +- drivers/usb/host/ehci-mem.c | 8 +- drivers/usb/host/ehci-sched.c | 8 +- drivers/usb/host/isp116x-hcd.c | 2 +- drivers/usb/host/isp1362-hcd.c | 2 +- drivers/usb/host/ohci-dbg.c | 2 +- drivers/usb/host/ohci-hcd.c | 2 +- drivers/usb/host/ohci-mem.c | 4 +- drivers/usb/host/oxu210hp-hcd.c | 12 +- drivers/usb/host/sl811-hcd.c | 2 +- drivers/usb/host/xhci-mem.c | 6 +- drivers/usb/musb/cppi_dma.c | 2 +- drivers/usb/musb/musb_gadget.c | 4 +- drivers/usb/musb/musb_gadget_ep0.c | 2 +- drivers/usb/musb/musb_host.c | 2 +- drivers/usb/phy/phy-isp1301-omap.c | 4 +- drivers/usb/renesas_usbhs/mod_gadget.c | 2 +- drivers/usb/serial/pl2303.c | 4 +- drivers/usb/storage/sddr55.c | 10 +- drivers/vhost/net.c | 16 +- drivers/vhost/scsi.c | 10 +- drivers/vhost/test.c | 8 +- drivers/vhost/vhost.c | 62 ++--- drivers/video/console/sticore.c | 4 +- drivers/video/fbdev/carminefb.c | 4 +- drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 2 +- drivers/video/fbdev/tmiofb.c | 2 +- drivers/virtio/virtio_balloon.c | 2 +- drivers/virtio/virtio_mmio.c | 24 +- drivers/virtio/virtio_pci_common.c | 16 +- drivers/virtio/virtio_pci_modern.c | 24 +- fs/autofs4/expire.c | 2 +- fs/autofs4/waitq.c | 2 +- fs/binfmt_elf.c | 4 +- fs/char_dev.c | 2 +- fs/cifs/connect.c | 2 +- fs/compat.c | 6 +- fs/hpfs/namei.c | 8 +- fs/isofs/inode.c | 4 +- fs/proc/task_mmu.c | 2 +- fs/pstore/inode.c | 2 +- fs/statfs.c | 2 +- fs/xfs/uuid.c | 2 +- init/initramfs.c | 2 +- ipc/compat_mq.c | 4 +- kernel/fork.c | 2 +- kernel/power/suspend_test.c | 2 +- kernel/ptrace.c | 4 +- kernel/signal.c | 2 +- kernel/sys.c | 2 +- kernel/time/posix-cpu-timers.c | 8 +- lib/mpi/mpi-pow.c | 2 +- lib/mpi/mpih-mul.c | 4 +- lib/mpi/mpiutil.c | 2 +- net/9p/trans_rdma.c | 6 +- net/atm/br2684.c | 6 +- net/atm/pppoatm.c | 2 +- net/compat.c | 2 +- net/core/scm.c | 2 +- net/openvswitch/flow_table.c | 2 +- net/rds/ib_rdma.c | 2 +- net/rds/iw.c | 2 +- net/rds/iw_rdma.c | 2 +- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 4 +- net/sunrpc/xprtrdma/svc_rdma_transport.c | 8 +- security/keys/encrypted-keys/encrypted.c | 20 +- security/keys/trusted.c | 20 +- security/selinux/hooks.c | 4 +- security/selinux/ss/conditional.c | 4 +- security/selinux/ss/ebitmap.c | 2 +- security/selinux/ss/policydb.c | 15 +- sound/core/sound.c | 2 +- sound/soc/codecs/tlv320aic26.c | 2 +- sound/soc/codecs/wm8983.c | 4 +- sound/soc/codecs/wm8985.c | 4 +- sound/soc/fsl/mpc5200_dma.c | 8 +- sound/soc/soc-core.c | 6 +- sound/spi/at73c213.c | 2 +- tools/firewire/nosy-dump.c | 12 +- tools/power/cpupower/utils/helpers/msr.c | 4 +- tools/power/x86/turbostat/turbostat.c | 4 +- .../x86_energy_perf_policy.c | 12 +- tools/spi/spidev_fdx.c | 10 +- tools/testing/selftests/vm/thuge-gen.c | 4 +- tools/usb/testusb.c | 14 +- tools/virtio/ringtest/main.c | 8 +- tools/virtio/ringtest/ring.c | 10 +- tools/virtio/ringtest/virtio_ring_0_9.c | 4 +- tools/virtio/virtio_test.c | 12 +- usr/gen_init_cpio.c | 2 +- 408 files changed, 1613 insertions(+), 1618 deletions(-)
arch/alpha/kernel/setup.c +2 -2
@@ -559,9 +559,9 @@ setup_arch(char **cmdline_p)boot flags depending on the boot mode, we need some shorthand. This should do for installation. */ if (strcmp (COMMAND_LINE ,"INSTALL" ) ==0 ) { -strlcpy (command_line,"root=/dev/fd0 load_ramdisk=1" ,sizeof command_line); +strlcpy (command_line,"root=/dev/fd0 load_ramdisk=1" ,sizeof (command_line)); }else { -strlcpy (command_line,COMMAND_LINE ,sizeof command_line); +strlcpy (command_line,COMMAND_LINE ,sizeof (command_line)); }strcpy (boot_command_line, command_line); *cmdline_p = command_line;
arch/alpha/oprofile/common.c +1 -1
@@ -114,7 +114,7 @@ op_axp_create_files(struct dentry *root)struct dentry *dir;char buf[4 ]; -snprintf (buf,sizeof buf,"%d" , i); +snprintf (buf,sizeof (buf),"%d" , i); dir =oprofilefs_mkdir (root, buf);oprofilefs_create_ulong (dir,"enabled" , &ctr[i].enabled);
arch/arm/common/mcpm_entry.c +1 -1
@@ -426,7 +426,7 @@ int __init mcpm_sync_init( {unsigned int i, j, mpidr, this_cluster; -BUILD_BUG_ON (MCPM_SYNC_CLUSTER_SIZE *MAX_NR_CLUSTERS !=sizeof mcpm_sync); +BUILD_BUG_ON (MCPM_SYNC_CLUSTER_SIZE *MAX_NR_CLUSTERS !=sizeof (mcpm_sync));BUG_ON ((unsigned long )&mcpm_sync & (__CACHE_WRITEBACK_GRANULE -1 ));/*
arch/arm/mach-davinci/board-dm644x-evm.c +1 -1
@@ -314,7 +314,7 @@ evm_led_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)*/ evm_led_dev =platform_device_alloc ("leds-gpio" ,0 );platform_device_add_data (evm_led_dev, - &evm_led_data,sizeof evm_led_data); + &evm_led_data,sizeof (evm_led_data)); evm_led_dev->dev.parent = &client->dev; status =platform_device_add (evm_led_dev);
arch/arm/mach-ixp4xx/common.c +1 -1
@@ -348,7 +348,7 @@ static struct pxa2xx_udc_mach_info ixp4xx_udc_info;void __init ixp4xx_set_udc_info (struct pxa2xx_udc_mach_info *info) { -memcpy (&ixp4xx_udc_info, info,sizeof *info); +memcpy (&ixp4xx_udc_info, info,sizeof (*info)); }static struct resource ixp4xx_udc_resources[] = {
arch/arm/mach-pxa/devices.c +1 -1
@@ -95,7 +95,7 @@ static struct pxa2xx_udc_mach_info pxa_udc_info = {void __init pxa_set_udc_info (struct pxa2xx_udc_mach_info *info) { -memcpy (&pxa_udc_info, info,sizeof *info); +memcpy (&pxa_udc_info, info,sizeof (*info)); }static struct resource pxa2xx_udc_resources[] = {
arch/arm/mach-u300/dummyspichip.c +1 -1
@@ -222,7 +222,7 @@ static int pl022_dummy_probe(struct spi_device *spi)dev_info (&spi->dev,"probing dummy SPI device\n" ); - p_dummy =kzalloc (sizeof *p_dummy,GFP_KERNEL ); + p_dummy =kzalloc (sizeof (*p_dummy),GFP_KERNEL );if (!p_dummy)return -ENOMEM ;
arch/cris/arch-v10/kernel/traps.c +1 -1
@@ -119,7 +119,7 @@ handle_BUG(struct pt_regs *regs)unsigned char c;unsigned long irp = regs->irp; -if (__copy_from_user (&f, (const void __user *)(irp -8 ),sizeof f)) +if (__copy_from_user (&f, (const void __user *)(irp -8 ),sizeof (f)))return ;if (f.prefix !=BUG_PREFIX || f.magic !=BUG_MAGIC )return ;
arch/cris/arch-v32/mach-a3/pinmux.c +6 -6
@@ -83,7 +83,7 @@ int crisv32_pinmux_alloc_fixed(enum fixed_function function) {int ret = -EINVAL ; -char saved[sizeof pins]; +char saved[sizeof (pins)];unsigned long flags;reg_pinmux_rw_hwprot hwprot;reg_clkgen_rw_clk_ctrl clk_ctrl;
@@ -91,7 +91,7 @@ crisv32_pinmux_alloc_fixed(enum fixed_function function)spin_lock_irqsave (&pinmux_lock, flags);/* Save internal data for recovery */ -memcpy (saved, pins,sizeof pins); +memcpy (saved, pins,sizeof (pins));crisv32_pinmux_init ();/* must be done before we read rw_hwprot */
@@ -203,7 +203,7 @@ crisv32_pinmux_alloc_fixed(enum fixed_function function)REG_WR (pinmux, regi_pinmux, rw_hwprot, hwprot);REG_WR (clkgen, regi_clkgen, rw_clk_ctrl, clk_ctrl); }else -memcpy (pins, saved,sizeof pins); +memcpy (pins, saved,sizeof (pins));spin_unlock_irqrestore (&pinmux_lock, flags);
@@ -261,14 +261,14 @@ int crisv32_pinmux_dealloc_fixed(enum fixed_function function) {int ret = -EINVAL ; -char saved[sizeof pins]; +char saved[sizeof (pins)];unsigned long flags;reg_pinmux_rw_hwprot hwprot;spin_lock_irqsave (&pinmux_lock, flags);/* Save internal data for recovery */ -memcpy (saved, pins,sizeof pins); +memcpy (saved, pins,sizeof (pins));crisv32_pinmux_init ();/* must be done before we read rw_hwprot */
@@ -361,7 +361,7 @@ crisv32_pinmux_dealloc_fixed(enum fixed_function function)if (!ret)REG_WR (pinmux, regi_pinmux, rw_hwprot, hwprot);else -memcpy (pins, saved,sizeof pins); +memcpy (pins, saved,sizeof (pins));spin_unlock_irqrestore (&pinmux_lock, flags);
arch/cris/arch-v32/mach-fs/pinmux.c +6 -6
@@ -93,14 +93,14 @@ int crisv32_pinmux_alloc(int port, int first_pin, int last_pin,int crisv32_pinmux_alloc_fixed (enum fixed_function function) {int ret = -EINVAL ; -char saved[sizeof pins]; +char saved[sizeof (pins)];unsigned long flags;reg_pinmux_rw_hwprot hwprot;spin_lock_irqsave (&pinmux_lock, flags);/* Save internal data for recovery */ -memcpy (saved, pins,sizeof pins); +memcpy (saved, pins,sizeof (pins));crisv32_pinmux_init ();/* Must be done before we read rw_hwprot */
@@ -168,7 +168,7 @@ int crisv32_pinmux_alloc_fixed(enum fixed_function function)if (!ret)REG_WR (pinmux, regi_pinmux, rw_hwprot, hwprot);else -memcpy (pins, saved,sizeof pins); +memcpy (pins, saved,sizeof (pins));spin_unlock_irqrestore (&pinmux_lock, flags);
@@ -228,14 +228,14 @@ int crisv32_pinmux_dealloc(int port, int first_pin, int last_pin)int crisv32_pinmux_dealloc_fixed (enum fixed_function function) {int ret = -EINVAL ; -char saved[sizeof pins]; +char saved[sizeof (pins)];unsigned long flags;reg_pinmux_rw_hwprot hwprot;spin_lock_irqsave (&pinmux_lock, flags);/* Save internal data for recovery */ -memcpy (saved, pins,sizeof pins); +memcpy (saved, pins,sizeof (pins));crisv32_pinmux_init ();/* Must be done before we read rw_hwprot */
@@ -303,7 +303,7 @@ int crisv32_pinmux_dealloc_fixed(enum fixed_function function)if (!ret)REG_WR (pinmux, regi_pinmux, rw_hwprot, hwprot);else -memcpy (pins, saved,sizeof pins); +memcpy (pins, saved,sizeof (pins));spin_unlock_irqrestore (&pinmux_lock, flags);
arch/cris/arch-v32/mm/intmem.c +3 -3
@@ -34,7 +34,7 @@ static void crisv32_intmem_init(void)static int initiated =0 ;if (!initiated) {struct intmem_allocation * alloc; - alloc =kmalloc (sizeof *alloc,GFP_KERNEL ); + alloc =kmalloc (sizeof (*alloc),GFP_KERNEL );INIT_LIST_HEAD (&intmem_allocations); intmem_virtual =ioremap (MEM_INTMEM_START +RESERVED_SIZE ,MEM_INTMEM_SIZE -RESERVED_SIZE );
@@ -63,7 +63,7 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align) allocation->size >= size + alignment) {if (allocation->size > size + alignment) {struct intmem_allocation * alloc; - alloc =kmalloc (sizeof *alloc,GFP_ATOMIC ); + alloc =kmalloc (sizeof (*alloc),GFP_ATOMIC ); alloc->status =STATUS_FREE ; alloc->size = allocation->size - size - alignment;
@@ -73,7 +73,7 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)if (alignment) {struct intmem_allocation *tmp; - tmp =kmalloc (sizeof *tmp,GFP_ATOMIC ); + tmp =kmalloc (sizeof (*tmp),GFP_ATOMIC ); tmp->offset = allocation->offset; tmp->size = alignment; tmp->status =STATUS_FREE ;
arch/cris/boot/tools/build.c +4 -4
@@ -141,7 +141,7 @@ int main(int argc, char ** argv) minor_root =DEFAULT_MINOR_ROOT ; }fprintf (stderr,"Root device is (%d, %d)\n" , major_root, minor_root); -for (i=0 ;i<sizeof buf; i++) buf[i]=0 ; +for (i=0 ;i<sizeof (buf); i++) buf[i]=0 ;if ((id=open (argv[1 ],O_RDONLY ,0 ))<0 )die ("Unable to open 'boot'" );if (read (id,buf,MINIX_HEADER ) !=MINIX_HEADER )
@@ -158,7 +158,7 @@ int main(int argc, char ** argv)die ("Non-Minix header of 'boot'" );if (((long *) buf)[7 ] !=0 )die ("Illegal symbol table in 'boot'" ); - i=read (id,buf,sizeof buf); + i=read (id,buf,sizeof (buf));fprintf (stderr,"Boot sector %d bytes.\n" ,i);if (i !=512 )die ("Boot block must be exactly 512 bytes" );
@@ -187,7 +187,7 @@ int main(int argc, char ** argv)die ("Non-Minix header of 'setup'" );if (((long *) buf)[7 ] !=0 )die ("Illegal symbol table in 'setup'" ); - for (i=0 ; (c=read(id,buf,sizeof buf))>0 ; i+=c ) + for (i=0 ; (c=read(id,buf,sizeof(buf)))>0 ; i+=c )#ifdef __BIG_KERNEL__ {if (!i) {
@@ -217,7 +217,7 @@ int main(int argc, char ** argv)if (setup_sectors <SETUP_SECTS ) setup_sectors =SETUP_SECTS ;fprintf (stderr,"Setup is %d bytes.\n" ,i); -for (c=0 ; c<sizeof (buf) ; c++) +for (c=0 ; c<sizeof (buf); c++) buf[c] ='\0' ;while (i < setup_sectors *512 ) { c = setup_sectors *512 - i;
arch/ia64/kernel/mca_drv.c +1 -1
@@ -343,7 +343,7 @@ init_record_index_pools(void)/* - 2 - */ sect_min_size = sal_log_sect_min_sizes[0 ]; -for (i =1 ; i <sizeof sal_log_sect_min_sizes/sizeof (size_t ); i++) +for (i =1 ; i <sizeof (sal_log_sect_min_sizes)/sizeof (size_t ); i++)if (sect_min_size > sal_log_sect_min_sizes[i]) sect_min_size = sal_log_sect_min_sizes[i];
arch/m68k/bvme6000/rtc.c +1 -1
@@ -64,7 +64,7 @@ static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) }while (wtime.tm_sec !=bcd2bin (rtc->bcd_sec)); rtc->msr = msr;local_irq_restore (flags); -return copy_to_user (argp, &wtime,sizeof wtime) ? +return copy_to_user (argp, &wtime,sizeof (wtime)) ? -EFAULT :0 ; }case RTC_SET_TIME :/* Set the RTC */
arch/m68k/mvme16x/rtc.c +1 -1
@@ -59,7 +59,7 @@ static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) wtime.tm_wday =bcd2bin (rtc->bcd_dow)-1 ; rtc->ctrl =0 ;local_irq_restore (flags); -return copy_to_user (argp, &wtime,sizeof wtime) ? +return copy_to_user (argp, &wtime,sizeof (wtime)) ? -EFAULT :0 ; }case RTC_SET_TIME :/* Set the RTC */
arch/mips/boot/elf2ecoff.c +14 -15
@@ -77,8 +77,8 @@ static void copy(int out, int in, off_t offset, off_t size) remaining = size;while (remaining) { cur = remaining; -if (cur >sizeof ibuf) - cur =sizeof ibuf; +if (cur >sizeof (ibuf)) + cur =sizeof (ibuf); remaining -= cur;if ((count =read (in, ibuf, cur)) != cur) { fprintf(stderr, "copy: read: %s\n",
@@ -302,8 +302,8 @@ int main(int argc, char *argv[]) }/* Read the header, which is at the beginning of the file... */ - i =read (infile, &ex,sizeof ex); -if (i !=sizeof ex) { + i =read (infile, &ex,sizeof (ex)); +if (i !=sizeof (ex)) {fprintf (stderr,"ex: %s: %s.\n" , argv[1 ], i ?strerror (errno) :"End of file reached" );
@@ -425,7 +425,7 @@ int main(int argc, char *argv[]) eah.data_start = data.vaddr; eah.bss_start = bss.vaddr; eah.gprmask =0xf3fffffe ; -memset (&eah.cprmask,'\0' ,sizeof eah.cprmask); +memset (&eah.cprmask,'\0' ,sizeof (eah.cprmask)); eah.gp_value =0 ;/* unused. */ if (format_bigendian)
@@ -440,10 +440,10 @@ int main(int argc, char *argv[]) efh.f_timdat =0 ;/* bogus */ efh.f_symptr =0 ; efh.f_nsyms =0 ; - efh.f_opthdr =sizeof eah; + efh.f_opthdr =sizeof (eah); efh.f_flags =0x100f ;/* Stripped, not sharable. */ -memset (esecs,0 ,sizeof esecs); +memset (esecs,0 ,sizeof (esecs));strcpy (esecs[0 ].s_name,".text" );strcpy (esecs[1 ].s_name,".data" );strcpy (esecs[2 ].s_name,".bss" );
@@ -511,8 +511,8 @@ int main(int argc, char *argv[])if (must_convert_endian)convert_ecoff_filehdr (&efh);/* Write the headers... */ - i =write (outfile, &efh,sizeof efh); -if (i !=sizeof efh) { + i =write (outfile, &efh,sizeof (efh)); +if (i !=sizeof (efh)) {perror ("efh: write" );exit (1 );
@@ -527,8 +527,8 @@ int main(int argc, char *argv[])if (must_convert_endian)convert_ecoff_aouthdr (&eah); - i =write (outfile, &eah,sizeof eah); -if (i !=sizeof eah) { + i =write (outfile, &eah,sizeof (eah)); +if (i !=sizeof (eah)) {perror ("eah: write" );exit (1 ); }
@@ -576,13 +576,12 @@ int main(int argc, char *argv[])fprintf (stderr,"Warning: %ld byte intersegment gap.\n" , gap); -memset (obuf,0 ,sizeof obuf); +memset (obuf,0 ,sizeof (obuf));while (gap) {int count =write (outfile, obuf, (gap > -sizeof obuf ?sizeof - obuf : gap)); +sizeof (obuf) ?sizeof (obuf) : gap));if (count <0 ) { fprintf(stderr, "Error writing gap: %s\n",
@@ -607,7 +606,7 @@ int main(int argc, char *argv[])*/ {char obuf[4096 ]; -memset (obuf,0 ,sizeof obuf); +memset (obuf,0 ,sizeof (obuf));if (write (outfile, obuf,sizeof (obuf)) !=sizeof (obuf)) {fprintf (stderr,"Error writing PROM padding: %s\n" ,strerror (errno));
arch/mips/kernel/module.c +1 -1
@@ -94,7 +94,7 @@ static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v)* the carry we need to add. Save the information, and let LO16 do the * actual relocation. */ - n =kmalloc (sizeof *n,GFP_KERNEL ); + n =kmalloc (sizeof (*n),GFP_KERNEL );if (!n)return -ENOMEM ;
arch/mips/oprofile/common.c +1 -1
@@ -43,7 +43,7 @@ static int op_mips_create_files(struct dentry *root)struct dentry *dir;char buf[4 ]; -snprintf (buf,sizeof buf,"%d" , i); +snprintf (buf,sizeof (buf),"%d" , i); dir =oprofilefs_mkdir (root, buf);oprofilefs_create_ulong (dir,"enabled" , &ctr[i].enabled);
arch/mips/sgi-ip22/ip22-gio.c +1 -1
@@ -358,7 +358,7 @@ static void ip22_check_gio(int slotno, unsigned long addr, int irq) }printk (KERN_INFO "GIO: slot %d : %s (id %x)\n" , slotno, name, id); - gio_dev =kzalloc (sizeof *gio_dev,GFP_KERNEL ); + gio_dev =kzalloc (sizeof (*gio_dev),GFP_KERNEL ); gio_dev->name = name; gio_dev->slotno = slotno; gio_dev->id.id = id;
arch/parisc/kernel/cache.c +1 -1
@@ -239,7 +239,7 @@ parisc_cache_init(void)#ifndef CONFIG_PA20 if (pdc_btlb_info (&btlb_info) <0 ) { -memset (&btlb_info,0 ,sizeof btlb_info); +memset (&btlb_info,0 ,sizeof (btlb_info)); }#endif
arch/parisc/kernel/process.c +1 -1
@@ -171,7 +171,7 @@ int dump_fpu (struct pt_regs * regs, elf_fpregset_t *r)if (regs ==NULL )return 0 ; -memcpy (r, regs->fr,sizeof *r); +memcpy (r, regs->fr,sizeof (*r));return 1 ; }
arch/parisc/math-emu/driver.c +2 -2
@@ -92,7 +92,7 @@ handle_fpe(struct pt_regs *regs)*/ __u64 frcopy[36 ]; -memcpy (frcopy, regs->fr,sizeof regs->fr); +memcpy (frcopy, regs->fr,sizeof (regs->fr)); frcopy[32 ] =0 ;memcpy (&orig_sw, frcopy,sizeof (orig_sw));
@@ -114,7 +114,7 @@ handle_fpe(struct pt_regs *regs)printk (KERN_DEBUG "\n" ); } -memcpy (regs->fr, frcopy,sizeof regs->fr); +memcpy (regs->fr, frcopy,sizeof (regs->fr));if (signalcode !=0 ) { si.si_signo = signalcode >>24 ; si.si_errno =0 ;
arch/powerpc/crypto/sha1.c +1 -1
@@ -99,7 +99,7 @@ static int sha1_final(struct shash_desc *desc, u8 *out) dst[i] =cpu_to_be32 (sctx->state[i]);/* Wipe context */ -memset (sctx,0 ,sizeof *sctx); +memset (sctx,0 ,sizeof (*sctx));return 0 ; }
arch/powerpc/kernel/kgdb.c +3 -3
@@ -175,15 +175,15 @@ static int kgdb_singlestep(struct pt_regs *regs)if (thread_info != exception_thread_info) {/* Save the original current_thread_info. */ -memcpy (backup_current_thread_info, exception_thread_info,sizeof *thread_info); -memcpy (exception_thread_info, thread_info,sizeof *thread_info); +memcpy (backup_current_thread_info, exception_thread_info,sizeof (*thread_info)); +memcpy (exception_thread_info, thread_info,sizeof (*thread_info)); }kgdb_handle_exception (0 ,SIGTRAP ,0 , regs);if (thread_info != exception_thread_info)/* Restore current_thread_info lastly. */ -memcpy (exception_thread_info, backup_current_thread_info,sizeof *thread_info); +memcpy (exception_thread_info, backup_current_thread_info,sizeof (*thread_info));return 1 ; }
arch/powerpc/oprofile/common.c +1 -1
@@ -159,7 +159,7 @@ static int op_powerpc_create_files(struct dentry *root)struct dentry *dir;char buf[4 ]; -snprintf (buf,sizeof buf,"%d" , i); +snprintf (buf,sizeof (buf),"%d" , i); dir =oprofilefs_mkdir (root, buf);oprofilefs_create_ulong (dir,"enabled" , &ctr[i].enabled);
arch/powerpc/platforms/52xx/mpc52xx_gpt.c +1 -1
@@ -724,7 +724,7 @@ static int mpc52xx_gpt_probe(struct platform_device *ofdev) {struct mpc52xx_gpt_priv *gpt; - gpt =devm_kzalloc (&ofdev->dev,sizeof *gpt,GFP_KERNEL ); + gpt =devm_kzalloc (&ofdev->dev,sizeof (*gpt),GFP_KERNEL );if (!gpt)return -ENOMEM ;
arch/powerpc/platforms/cell/spufs/context.c +1 -1
@@ -37,7 +37,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang) {struct spu_context *ctx; - ctx =kzalloc (sizeof *ctx,GFP_KERNEL ); + ctx =kzalloc (sizeof (*ctx),GFP_KERNEL );if (!ctx) goto out;/* Binding to physical processor deferred
arch/powerpc/platforms/cell/spufs/file.c +11 -11
@@ -477,7 +477,7 @@ __spufs_regs_read(struct spu_context *ctx, char __user *buffer, {struct spu_lscsa *lscsa = ctx->csa.lscsa;return simple_read_from_buffer (buffer, size, pos, - lscsa->gprs,sizeof lscsa->gprs); + lscsa->gprs,sizeof (lscsa->gprs)); } static ssize_t
@@ -668,7 +668,7 @@ static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf,spu_release (ctx); -if (copy_to_user (buf, &mbox_stat,sizeof mbox_stat)) +if (copy_to_user (buf, &mbox_stat,sizeof (mbox_stat)))return -EFAULT ;return 4 ;
@@ -817,7 +817,7 @@ static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf, ibox_stat = (ctx->ops->mbox_stat_read (ctx) >>16 ) &0xff ;spu_release (ctx); -if (copy_to_user (buf, &ibox_stat,sizeof ibox_stat)) +if (copy_to_user (buf, &ibox_stat,sizeof (ibox_stat)))return -EFAULT ;return 4 ;
@@ -967,7 +967,7 @@ static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf, wbox_stat = (ctx->ops->mbox_stat_read (ctx) >>8 ) &0xff ;spu_release (ctx); -if (copy_to_user (buf, &wbox_stat,sizeof wbox_stat)) +if (copy_to_user (buf, &wbox_stat,sizeof (wbox_stat)))return -EFAULT ;return 4 ;
@@ -1695,11 +1695,11 @@ static ssize_t spufs_mfc_write(struct file *file, const char __user *buffer,struct mfc_dma_command cmd;int ret = -EINVAL ; -if (size !=sizeof cmd) +if (size !=sizeof (cmd)) goto out; ret = -EFAULT ; -if (copy_from_user (&cmd, buffer,sizeof cmd)) +if (copy_from_user (&cmd, buffer,sizeof (cmd))) goto out; ret =spufs_check_valid_dma (&cmd);
@@ -2038,7 +2038,7 @@ static ssize_t __spufs_mbox_info_read(struct spu_context *ctx, data = ctx->csa.prob.pu_mb_R; -return simple_read_from_buffer (buf, len, pos, &data,sizeof data); +return simple_read_from_buffer (buf, len, pos, &data,sizeof (data)); } static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf,
@@ -2078,7 +2078,7 @@ static ssize_t __spufs_ibox_info_read(struct spu_context *ctx, data = ctx->csa.priv2.puint_mb_R; -return simple_read_from_buffer (buf, len, pos, &data,sizeof data); +return simple_read_from_buffer (buf, len, pos, &data,sizeof (data)); } static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf,
@@ -2173,7 +2173,7 @@ static ssize_t __spufs_dma_info_read(struct spu_context *ctx, }return simple_read_from_buffer (buf, len, pos, &info, -sizeof info); +sizeof (info)); } static ssize_t spufs_dma_info_read(struct file *file, char __user *buf,
@@ -2207,7 +2207,7 @@ static ssize_t __spufs_proxydma_info_read(struct spu_context *ctx, {struct spu_proxydma_info info;struct mfc_cq_sr *qp, *puqp; -int ret =sizeof info; +int ret =sizeof (info);int i;if (len < ret)
@@ -2230,7 +2230,7 @@ static ssize_t __spufs_proxydma_info_read(struct spu_context *ctx, }return simple_read_from_buffer (buf, len, pos, &info, -sizeof info); +sizeof (info)); } static ssize_t spufs_proxydma_info_read(struct file *file, char __user *buf,
arch/powerpc/platforms/cell/spufs/gang.c +1 -1
@@ -29,7 +29,7 @@ struct spu_gang *alloc_spu_gang(void) {struct spu_gang *gang; - gang =kzalloc (sizeof *gang,GFP_KERNEL ); + gang =kzalloc (sizeof (*gang),GFP_KERNEL );if (!gang) goto out;
arch/s390/crypto/sha_common.c +1 -1
@@ -96,7 +96,7 @@ int s390_sha_final(struct shash_desc *desc, u8 *out)/* copy digest to out */ memcpy (out, ctx->state,crypto_shash_digestsize (desc->tfm));/* wipe context */ -memset (ctx,0 ,sizeof *ctx); +memset (ctx,0 ,sizeof (*ctx));return 0 ; }
arch/sparc/lib/bitext.c +1 -1
@@ -120,7 +120,7 @@ void bit_map_clear(struct bit_map *t, int offset, int len)void bit_map_init (struct bit_map *t,unsigned long *map,int size) {bitmap_zero (map, size); -memset (t,0 ,sizeof *t); +memset (t,0 ,sizeof (*t));spin_lock_init (&t->lock); t->map = map; t->size = size;
arch/tile/kernel/backtrace.c +3 -3
@@ -311,8 +311,8 @@ static void find_caller_pc_and_caller_sp(CallerLocation *location,* prevent any problems. */ unsigned int bytes_to_prefetch =4096 - (pc &4095 ); -if (bytes_to_prefetch >sizeof prefetched_bundles) - bytes_to_prefetch =sizeof prefetched_bundles; +if (bytes_to_prefetch >sizeof (prefetched_bundles)) + bytes_to_prefetch =sizeof (prefetched_bundles); if (!read_memory_func(prefetched_bundles, pc, bytes_to_prefetch,
@@ -641,7 +641,7 @@ bool backtrace_next(BacktraceIterator *state) }/* Try to read the frame linkage data chaining to the next function. */ -if (!state->read_memory_func (&next_frame, state->fp,sizeof next_frame, +if (!state->read_memory_func (&next_frame, state->fp,sizeof (next_frame), state->read_memory_func_extra)) {return false; }
arch/um/kernel/um_arch.c +1 -1
@@ -345,7 +345,7 @@ void __init setup_arch(char **cmdline_p)paging_init ();strlcpy (boot_command_line, command_line,COMMAND_LINE_SIZE ); *cmdline_p = command_line; -setup_hostinfo (host_info,sizeof host_info); +setup_hostinfo (host_info,sizeof (host_info)); }void __init check_bugs (void )
arch/x86/boot/cpucheck.c +1 -1
@@ -103,7 +103,7 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr) {int err; -memset (&cpu.flags,0 ,sizeof cpu.flags); +memset (&cpu.flags,0 ,sizeof (cpu.flags)); cpu.level =3 ;if (has_eflag (X86_EFLAGS_AC ))
arch/x86/boot/early_serial_console.c +2 -2
@@ -45,7 +45,7 @@ static void parse_earlyprintk(void)int pos =0 ;int port =0 ; -if (cmdline_find_option ("earlyprintk" , arg,sizeof arg) >0 ) { +if (cmdline_find_option ("earlyprintk" , arg,sizeof (arg)) >0 ) {char *e;if (!strncmp (arg,"serial" ,6 )) {
@@ -119,7 +119,7 @@ static void parse_console_uart8250(void)* console=uart8250,io,0x3f8,115200n8 * need to make sure it is last one console ! */ -if (cmdline_find_option ("console" , optstr,sizeof optstr) <=0 ) +if (cmdline_find_option ("console" , optstr,sizeof (optstr)) <=0 )return ; options = optstr;
arch/x86/boot/edd.c +3 -3
@@ -76,7 +76,7 @@ static int get_edd_info(u8 devno, struct edd_info *ei) {struct biosregs ireg, oreg; -memset (ei,0 ,sizeof *ei); +memset (ei,0 ,sizeof (*ei));/* Check Extensions Present */
@@ -133,7 +133,7 @@ void query_edd(void)struct edd_info ei, *edp;u32 *mbrptr; -if (cmdline_find_option ("edd" , eddarg,sizeof eddarg) >0 ) { +if (cmdline_find_option ("edd" , eddarg,sizeof (eddarg)) >0 ) {if (!strcmp (eddarg,"skipmbr" ) || !strcmp (eddarg,"skip" )) { do_edd =1 ; do_mbr =0 ;
@@ -166,7 +166,7 @@ void query_edd(void)*/ if (!get_edd_info (devno, &ei) && boot_params.eddbuf_entries <EDDMAXNR ) { -memcpy (edp, &ei,sizeof ei); +memcpy (edp, &ei,sizeof (ei)); edp++; boot_params.eddbuf_entries++; }
arch/x86/boot/main.c +2 -2
@@ -36,8 +36,8 @@ static void copy_boot_params(void)const struct old_cmdline *const oldcmd = (const struct old_cmdline *)OLD_CL_ADDRESS ; -BUILD_BUG_ON (sizeof boot_params !=4096 ); -memcpy (&boot_params.hdr, &hdr,sizeof hdr); +BUILD_BUG_ON (sizeof (boot_params) !=4096 ); +memcpy (&boot_params.hdr, &hdr,sizeof (hdr));if (!boot_params.hdr.cmd_line_ptr && oldcmd->cl_magic ==OLD_CL_MAGIC ) {
arch/x86/boot/memory.c +1 -1
@@ -26,7 +26,7 @@ static int detect_memory_e820(void)initregs (&ireg); ireg.ax =0xe820 ; - ireg.cx =sizeof buf; + ireg.cx =sizeof (buf); ireg.edx =SMAP ; ireg.di = (size_t )&buf;
arch/x86/boot/regs.c +1 -1
@@ -21,7 +21,7 @@void initregs (struct biosregs *reg) { -memset (reg,0 ,sizeof *reg); +memset (reg,0 ,sizeof (*reg)); reg->eflags |=X86_EFLAGS_CF ; reg->ds =ds (); reg->es =ds ();
arch/x86/boot/video-vesa.c +3 -3
@@ -62,7 +62,7 @@ static int vesa_probe(void)if (mode & ~0x1ff )continue ; -memset (&vminfo,0 ,sizeof vminfo);/* Just in case... */ +memset (&vminfo,0 ,sizeof (vminfo));/* Just in case... */ ireg.ax =0x4f01 ; ireg.cx = mode;
@@ -109,7 +109,7 @@ static int vesa_set_mode(struct mode_info *mode)int is_graphic;u16 vesa_mode = mode->mode -VIDEO_FIRST_VESA ; -memset (&vminfo,0 ,sizeof vminfo);/* Just in case... */ +memset (&vminfo,0 ,sizeof (vminfo));/* Just in case... */ initregs (&ireg); ireg.ax =0x4f01 ;
@@ -241,7 +241,7 @@ void vesa_store_edid(void)struct biosregs ireg, oreg;/* Apparently used as a nonsense token... */ -memset (&boot_params.edid_info,0x13 ,sizeof boot_params.edid_info); +memset (&boot_params.edid_info,0x13 ,sizeof (boot_params.edid_info));if (vginfo.version <0x0200 )return ;/* EDID requires VBE 2.0+ */
arch/x86/boot/video.c +1 -1
@@ -115,7 +115,7 @@ static unsigned int get_entry(void) }else if ((key >='0' && key <='9' ) || (key >='A' && key <='Z' ) || (key >='a' && key <='z' )) { -if (len <sizeof entry_buf) { +if (len <sizeof (entry_buf)) { entry_buf[len++] = key;putchar (key); }
arch/x86/kernel/cpu/common.c +2 -2
@@ -727,7 +727,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)#endif c->x86_cache_alignment = c->x86_clflush_size; -memset (&c->x86_capability,0 ,sizeof c->x86_capability); +memset (&c->x86_capability,0 ,sizeof (c->x86_capability)); c->extended_cpuid_level =0 ;if (!have_cpuid_p ())
@@ -879,7 +879,7 @@ static void identify_cpu(struct cpuinfo_x86 *c) c->x86_virt_bits =32 ;#endif c->x86_cache_alignment = c->x86_clflush_size; -memset (&c->x86_capability,0 ,sizeof c->x86_capability); +memset (&c->x86_capability,0 ,sizeof (c->x86_capability));generic_identify (c);
arch/x86/kernel/cpu/mcheck/mce.c +1 -1
@@ -2312,7 +2312,7 @@ static int mce_device_create(unsigned int cpu)if (!mce_available (&boot_cpu_data))return -EIO ; - dev =kzalloc (sizeof *dev,GFP_KERNEL ); + dev =kzalloc (sizeof (*dev),GFP_KERNEL );if (!dev)return -ENOMEM ; dev->id = cpu;
arch/x86/kernel/cpu/mtrr/generic.c +1 -1
@@ -795,7 +795,7 @@ static void generic_set_all(void)local_irq_restore (flags);/* Use the atomic bitops to update the global mask */ -for (count =0 ; count <sizeof mask *8 ; ++count) { +for (count =0 ; count <sizeof (mask) *8 ; ++count) {if (mask &0x01 )set_bit (count, &smp_changes_mask); mask >>=1 ;
arch/x86/kernel/cpu/mtrr/if.c +4 -4
@@ -43,7 +43,7 @@ mtrr_file_add(unsigned long base, unsigned long size, max = num_var_ranges;if (fcount ==NULL ) { - fcount =kzalloc (max *sizeof *fcount,GFP_KERNEL ); + fcount =kzalloc (max *sizeof (*fcount),GFP_KERNEL );if (!fcount)return -ENOMEM ;FILE_FCOUNT (file) = fcount;
@@ -182,12 +182,12 @@ mtrr_ioctl(struct file *file, unsigned int cmd, unsigned long __arg)case MTRRIOC_SET_PAGE_ENTRY :case MTRRIOC_DEL_PAGE_ENTRY :case MTRRIOC_KILL_PAGE_ENTRY : -if (copy_from_user (&sentry, arg,sizeof sentry)) +if (copy_from_user (&sentry, arg,sizeof (sentry)))return -EFAULT ;break ;case MTRRIOC_GET_ENTRY :case MTRRIOC_GET_PAGE_ENTRY : -if (copy_from_user (&gentry, arg,sizeof gentry)) +if (copy_from_user (&gentry, arg,sizeof (gentry)))return -EFAULT ;break ;#ifdef CONFIG_COMPAT
@@ -340,7 +340,7 @@ mtrr_ioctl(struct file *file, unsigned int cmd, unsigned long __arg)switch (cmd) {case MTRRIOC_GET_ENTRY :case MTRRIOC_GET_PAGE_ENTRY : -if (copy_to_user (arg, &gentry,sizeof gentry)) +if (copy_to_user (arg, &gentry,sizeof (gentry))) err = -EFAULT ;break ;#ifdef CONFIG_COMPAT
arch/x86/kernel/e820.c +1 -1
@@ -302,7 +302,7 @@ int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, chg_nr = chgidx;/* sort change-point list by memory addresses (low -> high) */ -sort (change_point, chg_nr,sizeof *change_point, cpcompare,NULL ); +sort (change_point, chg_nr,sizeof (*change_point), cpcompare,NULL );/* create a new bios memory map, removing overlaps */ overlap_entries =0 ;/* number of entries in the overlap table */
arch/x86/kernel/head64.c +1 -1
@@ -129,7 +129,7 @@ static void __init copy_bootdata(char *real_mode_data)char * command_line;unsigned long cmd_line_ptr; -memcpy (&boot_params, real_mode_data,sizeof boot_params); +memcpy (&boot_params, real_mode_data,sizeof (boot_params));sanitize_boot_params (&boot_params); cmd_line_ptr =get_cmd_line_ptr ();if (cmd_line_ptr) {
arch/x86/kernel/msr.c +4 -4
@@ -114,14 +114,14 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg) err = -EBADF ;break ; } -if (copy_from_user (®s, uregs,sizeof regs)) { +if (copy_from_user (®s, uregs,sizeof (regs))) { err = -EFAULT ;break ; } err =rdmsr_safe_regs_on_cpu (cpu, regs);if (err)break ; -if (copy_to_user (uregs, ®s,sizeof regs)) +if (copy_to_user (uregs, ®s,sizeof (regs))) err = -EFAULT ;break ;
@@ -130,14 +130,14 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg) err = -EBADF ;break ; } -if (copy_from_user (®s, uregs,sizeof regs)) { +if (copy_from_user (®s, uregs,sizeof (regs))) { err = -EFAULT ;break ; } err =wrmsr_safe_regs_on_cpu (cpu, regs);if (err)break ; -if (copy_to_user (uregs, ®s,sizeof regs)) +if (copy_to_user (uregs, ®s,sizeof (regs))) err = -EFAULT ;break ;
arch/x86/kvm/assigned-dev.c +7 -7
@@ -982,7 +982,7 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,struct kvm_assigned_pci_dev assigned_dev; r = -EFAULT ; -if (copy_from_user (&assigned_dev, argp,sizeof assigned_dev)) +if (copy_from_user (&assigned_dev, argp,sizeof (assigned_dev))) goto out; r =kvm_vm_ioctl_assign_device (kvm, &assigned_dev);if (r)
@@ -997,7 +997,7 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,struct kvm_assigned_irq assigned_irq; r = -EFAULT ; -if (copy_from_user (&assigned_irq, argp,sizeof assigned_irq)) +if (copy_from_user (&assigned_irq, argp,sizeof (assigned_irq))) goto out; r =kvm_vm_ioctl_assign_irq (kvm, &assigned_irq);if (r)
@@ -1008,7 +1008,7 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,struct kvm_assigned_irq assigned_irq; r = -EFAULT ; -if (copy_from_user (&assigned_irq, argp,sizeof assigned_irq)) +if (copy_from_user (&assigned_irq, argp,sizeof (assigned_irq))) goto out; r =kvm_vm_ioctl_deassign_dev_irq (kvm, &assigned_irq);if (r)
@@ -1019,7 +1019,7 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,struct kvm_assigned_pci_dev assigned_dev; r = -EFAULT ; -if (copy_from_user (&assigned_dev, argp,sizeof assigned_dev)) +if (copy_from_user (&assigned_dev, argp,sizeof (assigned_dev))) goto out; r =kvm_vm_ioctl_deassign_device (kvm, &assigned_dev);if (r)
@@ -1029,7 +1029,7 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,case KVM_ASSIGN_SET_MSIX_NR : {struct kvm_assigned_msix_nr entry_nr; r = -EFAULT ; -if (copy_from_user (&entry_nr, argp,sizeof entry_nr)) +if (copy_from_user (&entry_nr, argp,sizeof (entry_nr))) goto out; r =kvm_vm_ioctl_set_msix_nr (kvm, &entry_nr);if (r)
@@ -1039,7 +1039,7 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,case KVM_ASSIGN_SET_MSIX_ENTRY : {struct kvm_assigned_msix_entry entry; r = -EFAULT ; -if (copy_from_user (&entry, argp,sizeof entry)) +if (copy_from_user (&entry, argp,sizeof (entry))) goto out; r =kvm_vm_ioctl_set_msix_entry (kvm, &entry);if (r)
@@ -1050,7 +1050,7 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,struct kvm_assigned_pci_dev assigned_dev; r = -EFAULT ; -if (copy_from_user (&assigned_dev, argp,sizeof assigned_dev)) +if (copy_from_user (&assigned_dev, argp,sizeof (assigned_dev))) goto out; r =kvm_vm_ioctl_set_pci_irq_mask (kvm, &assigned_dev);break ;
arch/x86/kvm/emulate.c +11 -11
@@ -1449,7 +1449,7 @@ static int read_interrupt_descriptor(struct x86_emulate_ctxt *ctxt,return emulate_gp (ctxt, index <<3 |0x2 ); addr = dt.address + index *8 ; -return ctxt->ops->read_std (ctxt, addr, desc,sizeof *desc, +return ctxt->ops->read_std (ctxt, addr, desc,sizeof (*desc), &ctxt->exception); }
@@ -1463,7 +1463,7 @@ static void get_descriptor_table_ptr(struct x86_emulate_ctxt *ctxt,struct desc_struct desc;u16 sel; -memset (dt,0 ,sizeof *dt); +memset (dt,0 ,sizeof (*dt));if (!ops->get_segment (ctxt, &sel, &desc, &base3,VCPU_SREG_LDTR ))return ;
@@ -1528,7 +1528,7 @@ static int write_segment_descriptor(struct x86_emulate_ctxt *ctxt,if (rc !=X86EMUL_CONTINUE )return rc; -return ctxt->ops->write_std (ctxt, addr, desc,sizeof *desc, +return ctxt->ops->write_std (ctxt, addr, desc,sizeof (*desc), &ctxt->exception); }
@@ -1548,7 +1548,7 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,u16 dummy;u32 base3 =0 ; -memset (&seg_desc,0 ,sizeof seg_desc); +memset (&seg_desc,0 ,sizeof (seg_desc));if (ctxt->mode ==X86EMUL_MODE_REAL ) {/* set real mode segment descriptor (keep limit etc. for
@@ -2958,19 +2958,19 @@ static int task_switch_16(struct x86_emulate_ctxt *ctxt,int ret;u32 new_tss_base =get_desc_base (new_desc); - ret = ops->read_std (ctxt, old_tss_base, &tss_seg,sizeof tss_seg, + ret = ops->read_std (ctxt, old_tss_base, &tss_seg,sizeof (tss_seg), &ctxt->exception);if (ret !=X86EMUL_CONTINUE )return ret;save_state_to_tss16 (ctxt, &tss_seg); - ret = ops->write_std (ctxt, old_tss_base, &tss_seg,sizeof tss_seg, + ret = ops->write_std (ctxt, old_tss_base, &tss_seg,sizeof (tss_seg), &ctxt->exception);if (ret !=X86EMUL_CONTINUE )return ret; - ret = ops->read_std (ctxt, new_tss_base, &tss_seg,sizeof tss_seg, + ret = ops->read_std (ctxt, new_tss_base, &tss_seg,sizeof (tss_seg), &ctxt->exception);if (ret !=X86EMUL_CONTINUE )return ret;
@@ -2980,7 +2980,7 @@ static int task_switch_16(struct x86_emulate_ctxt *ctxt, ret = ops->write_std (ctxt, new_tss_base, &tss_seg.prev_task_link, -sizeof tss_seg.prev_task_link, +sizeof (tss_seg.prev_task_link), &ctxt->exception);if (ret !=X86EMUL_CONTINUE )return ret;
@@ -3104,7 +3104,7 @@ static int task_switch_32(struct x86_emulate_ctxt *ctxt,u32 eip_offset = offsetof(struct tss_segment_32 , eip);u32 ldt_sel_offset = offsetof(struct tss_segment_32 , ldt_selector); - ret = ops->read_std (ctxt, old_tss_base, &tss_seg,sizeof tss_seg, + ret = ops->read_std (ctxt, old_tss_base, &tss_seg,sizeof (tss_seg), &ctxt->exception);if (ret !=X86EMUL_CONTINUE )return ret;
@@ -3117,7 +3117,7 @@ static int task_switch_32(struct x86_emulate_ctxt *ctxt,if (ret !=X86EMUL_CONTINUE )return ret; - ret = ops->read_std (ctxt, new_tss_base, &tss_seg,sizeof tss_seg, + ret = ops->read_std (ctxt, new_tss_base, &tss_seg,sizeof (tss_seg), &ctxt->exception);if (ret !=X86EMUL_CONTINUE )return ret;
@@ -3127,7 +3127,7 @@ static int task_switch_32(struct x86_emulate_ctxt *ctxt, ret = ops->write_std (ctxt, new_tss_base, &tss_seg.prev_task_link, -sizeof tss_seg.prev_task_link, +sizeof (tss_seg.prev_task_link), &ctxt->exception);if (ret !=X86EMUL_CONTINUE )return ret;
arch/x86/kvm/lapic.c +1 -1
@@ -1900,7 +1900,7 @@ void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu,kvm_lapic_set_base (vcpu, vcpu->arch.apic_base);/* set SPIV separately to get count of SW disabled APICs right */ apic_set_spiv (apic, *((u32 *)(s->regs +APIC_SPIV ))); -memcpy (vcpu->arch.apic->regs, s->regs,sizeof *s); +memcpy (vcpu->arch.apic->regs, s->regs,sizeof (*s));/* call kvm_apic_set_id() to put apic into apic_map */ kvm_apic_set_id (apic,kvm_apic_id (apic));kvm_apic_set_version (vcpu);
arch/x86/kvm/x86.c +23 -23
180 lines not on this page · raw message
arch/x86/tools/relocs.c +2 -2
@@ -128,7 +128,7 @@ static void regex_init(int use_real_mode) REG_EXTENDED|REG_NOSUB);if (err) { -regerror (err, &sym_regex_c[i], errbuf,sizeof errbuf); +regerror (err, &sym_regex_c[i], errbuf,sizeof (errbuf));die ("%s" , errbuf); } }
@@ -402,7 +402,7 @@ static void read_shdrs(FILE *fp) }for (i =0 ; i < ehdr.e_shnum; i++) {struct section *sec = &secs[i]; -if (fread (&shdr,sizeof shdr,1 , fp) !=1 ) +if (fread (&shdr,sizeof (shdr),1 , fp) !=1 )die ("Cannot read ELF section headers %d/%d: %s\n" , i, ehdr.e_shnum,strerror (errno)); sec->shdr.sh_name =elf_word_to_cpu (shdr.sh_name);
drivers/acpi/acpi_video.c +1 -1
@@ -811,7 +811,7 @@ acpi_video_init_brightness(struct acpi_video_device *device) goto out; } - br->levels =kmalloc ((obj->package.count +2 ) *sizeof *(br->levels), + br->levels =kmalloc ((obj->package.count +2 ) *sizeof (*(br->levels)),GFP_KERNEL );if (!br->levels) { result = -ENOMEM ;
drivers/ata/sata_promise.c +1 -1
@@ -1223,7 +1223,7 @@ static int pdc_ata_init_one(struct pci_dev *pdev,dev_err (&pdev->dev,"failed to allocate host\n" );return -ENOMEM ; } - hpriv =devm_kzalloc (&pdev->dev,sizeof *hpriv,GFP_KERNEL ); + hpriv =devm_kzalloc (&pdev->dev,sizeof (*hpriv),GFP_KERNEL );if (!hpriv)return -ENOMEM ;spin_lock_init (&hpriv->hard_reset_lock);
drivers/atm/iphase.c +1 -1
@@ -2753,7 +2753,7 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)if (!dev->phy->ioctl)return -EINVAL ;return dev->phy->ioctl (dev,cmd,arg); } -if (copy_from_user (&ia_cmds, arg,sizeof ia_cmds))return -EFAULT ; +if (copy_from_user (&ia_cmds, arg,sizeof (ia_cmds)))return -EFAULT ; board = ia_cmds.status;if ((board <0 ) || (board > iadev_count)) board =0 ;
drivers/atm/lanai.c +1 -1
@@ -2127,7 +2127,7 @@ static int lanai_dev_open(struct atm_dev *atmdev) lanai->nbound =0 ;#endif lanai->cbrvcc =NULL ; -memset (&lanai->stats,0 ,sizeof lanai->stats); +memset (&lanai->stats,0 ,sizeof (lanai->stats));spin_lock_init (&lanai->endtxlock);spin_lock_init (&lanai->servicelock); atmdev->ci_range.vpi_bits =0 ;
drivers/base/isa.c +1 -1
@@ -126,7 +126,7 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev)for (id =0 ; id < ndev; id++) {struct isa_dev *isa_dev; - isa_dev =kzalloc (sizeof *isa_dev,GFP_KERNEL ); + isa_dev =kzalloc (sizeof (*isa_dev),GFP_KERNEL );if (!isa_dev) { error = -ENOMEM ;break ;
drivers/base/power/sysfs.c +8 -8
@@ -115,9 +115,9 @@ static ssize_t control_store(struct device * dev, struct device_attribute *attr,if (cp) len = cp - buf;device_lock (dev); -if (len ==sizeof ctrl_auto -1 &&strncmp (buf, ctrl_auto, len) ==0 ) +if (len ==sizeof (ctrl_auto) -1 &&strncmp (buf, ctrl_auto, len) ==0 )pm_runtime_allow (dev); -else if (len ==sizeof ctrl_on -1 &&strncmp (buf, ctrl_on, len) ==0 ) +else if (len ==sizeof (ctrl_on) -1 &&strncmp (buf, ctrl_on, len) ==0 )pm_runtime_forbid (dev);else n = -EINVAL ;
@@ -355,11 +355,11 @@ wake_store(struct device * dev, struct device_attribute *attr, cp =memchr (buf,'\n' , n);if (cp) len = cp - buf; -if (len ==sizeof _enabled -1 - &&strncmp (buf, _enabled,sizeof _enabled -1 ) ==0 ) +if (len ==sizeof (_enabled) -1 + &&strncmp (buf, _enabled,sizeof (_enabled) -1 ) ==0 )device_set_wakeup_enable (dev,1 ); -else if (len ==sizeof _disabled -1 - &&strncmp (buf, _disabled,sizeof _disabled -1 ) ==0 ) +else if (len ==sizeof (_disabled) -1 + &&strncmp (buf, _disabled,sizeof (_disabled) -1 ) ==0 )device_set_wakeup_enable (dev,0 );else return -EINVAL ;
@@ -576,9 +576,9 @@ static ssize_t async_store(struct device *dev, struct device_attribute *attr, cp =memchr (buf,'\n' , n);if (cp) len = cp - buf; -if (len ==sizeof _enabled -1 &&strncmp (buf, _enabled, len) ==0 ) +if (len ==sizeof (_enabled) -1 &&strncmp (buf, _enabled, len) ==0 )device_enable_async_suspend (dev); -else if (len ==sizeof _disabled -1 && +else if (len ==sizeof (_disabled) -1 &&strncmp (buf, _disabled, len) ==0 )device_disable_async_suspend (dev);else
drivers/base/regmap/regcache-lzo.c +1 -1
@@ -162,7 +162,7 @@ static int regcache_lzo_init(struct regmap *map)/* allocate the lzo blocks and initialize them */ for (i =0 ; i < blkcount; i++) { - lzo_blocks[i] =kzalloc (sizeof **lzo_blocks, + lzo_blocks[i] =kzalloc (sizeof (**lzo_blocks),GFP_KERNEL );if (!lzo_blocks[i]) {kfree (sync_bmp);
drivers/base/regmap/regcache-rbtree.c +1 -1
@@ -202,7 +202,7 @@ static int regcache_rbtree_init(struct regmap *map)int i;int ret; - map->cache =kmalloc (sizeof *rbtree_ctx,GFP_KERNEL ); + map->cache =kmalloc (sizeof (*rbtree_ctx),GFP_KERNEL );if (!map->cache)return -ENOMEM ;
drivers/block/aoe/aoeblk.c +2 -2
@@ -65,7 +65,7 @@ static ssize_t aoedisk_show_netif(struct device *dev,struct aoeif *ifp, *e;char *p; -memset (nds,0 ,sizeof nds); +memset (nds,0 ,sizeof (nds)); nd = nds; ne = nd +ARRAY_SIZE (nds); t = d->targets;
@@ -409,7 +409,7 @@ aoeblk_gdalloc(void *vp) gd->fops = &aoe_bdops; gd->private_data = d;set_capacity (gd, d->ssize); -snprintf (gd->disk_name,sizeof gd->disk_name,"etherd/e%ld.%d" , +snprintf (gd->disk_name,sizeof (gd->disk_name),"etherd/e%ld.%d" , d->aoemajor, d->aoeminor); d->flags &= ~DEVFL_GDALLOC ;
drivers/block/aoe/aoechr.c +2 -2
@@ -85,9 +85,9 @@ revalidate(const char __user *str, size_t size)struct sk_buff *skb;char buf[16 ]; -if (size >=sizeof buf) +if (size >=sizeof (buf))return -EINVAL ; - buf[sizeof buf -1 ] ='\0' ; + buf[sizeof (buf) -1 ] ='\0' ;if (copy_from_user (buf, str, size))return -EFAULT ;
drivers/block/aoe/aoecmd.c +13 -13
@@ -130,8 +130,8 @@ aoehdr_atainit(struct aoedev *d, struct aoetgt *t, struct aoe_hdr *h) {u32 host_tag =newtag (d); -memcpy (h->src, t->ifp->nd->dev_addr,sizeof h->src); -memcpy (h->dst, t->addr,sizeof h->dst); +memcpy (h->src, t->ifp->nd->dev_addr,sizeof (h->src)); +memcpy (h->dst, t->addr,sizeof (h->dst)); h->type =__constant_cpu_to_be16 (ETH_P_AOE ); h->verfl =AOE_HVER ; h->major =cpu_to_be16 (d->aoemajor);
@@ -424,19 +424,19 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff_head *quif (!is_aoe_netif (ifp)) goto cont; - skb =new_skb (sizeof *h +sizeof *ch); + skb =new_skb (sizeof (*h) +sizeof (*ch));if (skb ==NULL ) {printk (KERN_INFO "aoe: skb alloc failure\n" ); goto cont; } -skb_put (skb,sizeof *h +sizeof *ch); +skb_put (skb,sizeof (*h) +sizeof (*ch)); skb->dev = ifp;__skb_queue_tail (queue, skb); h = (struct aoe_hdr *)skb_mac_header (skb); -memset (h,0 ,sizeof *h +sizeof *ch); +memset (h,0 ,sizeof (*h) +sizeof (*ch)); -memset (h->dst,0xff ,sizeof h->dst); -memcpy (h->src, ifp->dev_addr,sizeof h->src); +memset (h->dst,0xff ,sizeof (h->dst)); +memcpy (h->src, ifp->dev_addr,sizeof (h->src)); h->type =__constant_cpu_to_be16 (ETH_P_AOE ); h->verfl =AOE_HVER ; h->major =cpu_to_be16 (aoemajor);
@@ -482,8 +482,8 @@ resend(struct aoedev *d, struct frame *f) f->tag = n;fhash (f); h->tag =cpu_to_be32 (n); -memcpy (h->dst, t->addr,sizeof h->dst); -memcpy (h->src, t->ifp->nd->dev_addr,sizeof h->src); +memcpy (h->dst, t->addr,sizeof (h->dst)); +memcpy (h->src, t->ifp->nd->dev_addr,sizeof (h->src)); skb->dev = t->ifp->nd; skb =skb_clone (skb,GFP_ATOMIC );
@@ -562,7 +562,7 @@ ejectif(struct aoetgt *t, struct aoeif *ifp) nd = ifp->nd; e = t->ifs +NAOEIFS -1 ; - n = (e - ifp) *sizeof *ifp; + n = (e - ifp) *sizeof (*ifp);memmove (ifp, ifp+1 , n); e->nd =NULL ;dev_put (nd);
@@ -1374,7 +1374,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) aoemajor =be16_to_cpu (get_unaligned (&h->major)); d =aoedev_by_aoeaddr (aoemajor, h->minor,0 );if (d ==NULL ) { -snprintf (ebuf,sizeof ebuf,"aoecmd_ata_rsp: ata response " +snprintf (ebuf,sizeof (ebuf),"aoecmd_ata_rsp: ata response " "for unknown device %d.%d\n" , aoemajor, h->minor);aoechr_error (ebuf);
@@ -1453,7 +1453,7 @@ aoecmd_ata_id(struct aoedev *d) skb = f->skb; h = (struct aoe_hdr *)skb_mac_header (skb); ah = (struct aoe_atahdr *) (h+1 ); -skb_put (skb,sizeof *h +sizeof *ah); +skb_put (skb,sizeof (*h) +sizeof (*ah));memset (h,0 , skb->len); f->tag =aoehdr_atainit (d, t, h);fhash (f);
@@ -1521,7 +1521,7 @@ addtgt(struct aoedev *d, char *addr, ulong nframes) goto nomem; t->nframes = nframes; t->d = d; -memcpy (t->addr, addr,sizeof t->addr); +memcpy (t->addr, addr,sizeof (t->addr)); t->ifp = t->ifs;aoecmd_wreset (t); t->maxout = t->nframes /2 ;
drivers/block/aoe/aoedev.c +3 -3
@@ -313,8 +313,8 @@ flush(const char __user *str, size_t cnt, int exiting) skipflags =DEVFL_GDALLOC |DEVFL_NEWSIZE |DEVFL_TKILL ;if (!exiting && cnt >=3 ) { -if (cnt >sizeof buf) - cnt =sizeof buf; +if (cnt >sizeof (buf)) + cnt =sizeof (buf);if (copy_from_user (buf, str, cnt))return -EFAULT ; all = !strncmp (buf,"all" ,3 );
@@ -453,7 +453,7 @@ aoedev_by_aoeaddr(ulong maj, int min, int do_alloc) }if (d || !do_alloc ||minor_get (&sysminor, maj, min) <0 ) goto out; - d =kcalloc (1 ,sizeof *d,GFP_ATOMIC ); + d =kcalloc (1 ,sizeof (*d),GFP_ATOMIC );if (!d) goto out; d->targets =kcalloc (NTARGETS ,sizeof (*d->targets),GFP_ATOMIC );
drivers/block/cciss.c +1 -1
@@ -519,7 +519,7 @@ cciss_proc_write(struct file *file, const char __user *buf,return PTR_ERR (buffer);#ifdef CONFIG_CISS_SCSI_TAPE -if (strncmp (ENGAGE_SCSI , buffer,sizeof ENGAGE_SCSI -1 ) ==0 ) { +if (strncmp (ENGAGE_SCSI , buffer,sizeof (ENGAGE_SCSI ) -1 ) ==0 ) {struct seq_file *seq = file->private_data;ctlr_info_t *h = seq->private;
drivers/char/genrtc.c +1 -1
@@ -276,7 +276,7 @@ static int gen_rtc_ioctl(struct file *file,if (get_rtc_pll (&pll))return -EINVAL ;else -return copy_to_user (argp, &pll,sizeof pll) ? -EFAULT :0 ; +return copy_to_user (argp, &pll,sizeof (pll)) ? -EFAULT :0 ;case RTC_PLL_SET :if (!capable (CAP_SYS_TIME ))
drivers/char/rtc.c +1 -1
@@ -712,7 +712,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)return -ENOTTY ; }return copy_to_user ((void __user *)arg, - &wtime,sizeof wtime) ? -EFAULT :0 ; + &wtime,sizeof (wtime)) ? -EFAULT :0 ; }static long rtc_ioctl (struct file *file,unsigned int cmd,unsigned long arg)
drivers/crypto/nx/nx-aes-xcbc.c +1 -1
@@ -171,7 +171,7 @@ static int nx_xcbc_init(struct shash_desc *desc) {struct xcbc_state *sctx =shash_desc_ctx (desc); -memset (sctx,0 ,sizeof *sctx); +memset (sctx,0 ,sizeof (*sctx));return 0 ; }
drivers/crypto/nx/nx-sha256.c +1 -1
@@ -50,7 +50,7 @@ static int nx_crypto_ctx_sha256_init(struct crypto_tfm *tfm)static int nx_sha256_init (struct shash_desc *desc) {struct sha256_state *sctx =shash_desc_ctx (desc); -memset (sctx,0 ,sizeof *sctx); +memset (sctx,0 ,sizeof (*sctx)); sctx->state[0 ] =__cpu_to_be32 (SHA256_H0 ); sctx->state[1 ] =__cpu_to_be32 (SHA256_H1 );
drivers/crypto/nx/nx-sha512.c +1 -1
@@ -50,7 +50,7 @@ static int nx_sha512_init(struct shash_desc *desc) {struct sha512_state *sctx =shash_desc_ctx (desc); -memset (sctx,0 ,sizeof *sctx); +memset (sctx,0 ,sizeof (*sctx)); sctx->state[0 ] =__cpu_to_be64 (SHA512_H0 ); sctx->state[1 ] =__cpu_to_be64 (SHA512_H1 );
drivers/firewire/nosy.c +3 -3
@@ -289,7 +289,7 @@ nosy_open(struct inode *inode, struct file *file)if (lynx ==NULL )return -ENODEV ; - client =kmalloc (sizeof *client,GFP_KERNEL ); + client =kmalloc (sizeof (*client),GFP_KERNEL );if (client ==NULL ) goto fail;
@@ -366,7 +366,7 @@ nosy_ioctl(struct file *file, unsigned int cmd, unsigned long arg) stats.lost_packet_count = client->buffer.lost_packet_count;spin_unlock_irq (client_list_lock); -if (copy_to_user ((void __user *) arg, &stats,sizeof stats)) +if (copy_to_user ((void __user *) arg, &stats,sizeof (stats)))return -EFAULT ;else return 0 ;
@@ -547,7 +547,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused) }pci_set_master (dev); - lynx =kzalloc (sizeof *lynx,GFP_KERNEL ); + lynx =kzalloc (sizeof (*lynx),GFP_KERNEL );if (lynx ==NULL ) {dev_err (&dev->dev,"Failed to allocate control structure\n" ); ret = -ENOMEM ;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -1
@@ -169,7 +169,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,u64 base;int i, r; - work =kzalloc (sizeof *work,GFP_KERNEL ); + work =kzalloc (sizeof (*work),GFP_KERNEL );if (work ==NULL )return -ENOMEM ;
drivers/gpu/drm/drm_atomic.c +6 -6
@@ -1350,23 +1350,23 @@ static struct drm_pending_vblank_event *create_vblank_event(unsigned long flags;spin_lock_irqsave (&dev->event_lock, flags); -if (file_priv->event_space <sizeof e->event) { +if (file_priv->event_space <sizeof (e->event)) {spin_unlock_irqrestore (&dev->event_lock, flags); goto out; } - file_priv->event_space -=sizeof e->event; + file_priv->event_space -=sizeof (e->event);spin_unlock_irqrestore (&dev->event_lock, flags); - e =kzalloc (sizeof *e,GFP_KERNEL ); + e =kzalloc (sizeof (*e),GFP_KERNEL );if (e ==NULL ) {spin_lock_irqsave (&dev->event_lock, flags); - file_priv->event_space +=sizeof e->event; + file_priv->event_space +=sizeof (e->event);spin_unlock_irqrestore (&dev->event_lock, flags); goto out; } e->event.base.type =DRM_EVENT_FLIP_COMPLETE ; - e->event.base.length =sizeof e->event; + e->event.base.length =sizeof (e->event); e->event.user_data = user_data; e->base.event = &e->event.base; e->base.file_priv = file_priv;
@@ -1382,7 +1382,7 @@ static void destroy_vblank_event(struct drm_device *dev,unsigned long flags;spin_lock_irqsave (&dev->event_lock, flags); - file_priv->event_space +=sizeof e->event; + file_priv->event_space +=sizeof (e->event);spin_unlock_irqrestore (&dev->event_lock, flags);kfree (e); }
drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -6504,7 +6504,7 @@ struct intel_connector *intel_connector_alloc(void) {struct intel_connector *connector; - connector =kzalloc (sizeof *connector,GFP_KERNEL ); + connector =kzalloc (sizeof (*connector),GFP_KERNEL );if (!connector)return NULL ;
@@ -12336,7 +12336,7 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state) ddi_pll_sel = crtc_state->ddi_pll_sel; force_thru = crtc_state->pch_pfit.force_thru; -memset (crtc_state,0 ,sizeof *crtc_state); +memset (crtc_state,0 ,sizeof (*crtc_state)); crtc_state->base = tmp_state; crtc_state->scaler_state = scaler_state;
drivers/gpu/drm/radeon/radeon_display.c +1 -1
@@ -502,7 +502,7 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc,unsigned long flags;int r; - work =kzalloc (sizeof *work,GFP_KERNEL ); + work =kzalloc (sizeof (*work),GFP_KERNEL );if (work ==NULL )return -ENOMEM ;
drivers/i2c/i2c-core.c +1 -1
@@ -1038,7 +1038,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info)struct i2c_client *client;int status; - client =kzalloc (sizeof *client,GFP_KERNEL ); + client =kzalloc (sizeof (*client),GFP_KERNEL );if (!client)return NULL ;
drivers/iio/industrialio-trigger.c +2 -2
@@ -267,7 +267,7 @@ struct iio_poll_funcva_list vargs;struct iio_poll_func *pf; - pf =kmalloc (sizeof *pf,GFP_KERNEL ); + pf =kmalloc (sizeof (*pf),GFP_KERNEL );if (pf ==NULL )return NULL ;va_start (vargs, fmt);
@@ -445,7 +445,7 @@ static void iio_trig_subirqunmask(struct irq_data *d)static struct iio_trigger *viio_trigger_alloc (const char *fmt,va_list vargs) {struct iio_trigger *trig; - trig =kzalloc (sizeof *trig,GFP_KERNEL ); + trig =kzalloc (sizeof (*trig),GFP_KERNEL );if (trig) {int i; trig->dev.type = &iio_trig_type;
drivers/infiniband/core/addr.c +2 -2
@@ -271,7 +271,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,struct rt6_info *rt;int ret; -memset (&fl6,0 ,sizeof fl6); +memset (&fl6,0 ,sizeof (fl6)); fl6.daddr = dst_in->sin6_addr; fl6.saddr = src_in->sin6_addr; fl6.flowi6_oif = addr->bound_dev_if;
@@ -447,7 +447,7 @@ int rdma_resolve_ip(struct rdma_addr_client *client,struct addr_req *req;int ret =0 ; - req =kzalloc (sizeof *req,GFP_KERNEL ); + req =kzalloc (sizeof (*req),GFP_KERNEL );if (!req)return -ENOMEM ;
drivers/infiniband/core/agent.c +1 -1
@@ -154,7 +154,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num)int ret;/* Create new device info */ - port_priv =kzalloc (sizeof *port_priv,GFP_KERNEL ); + port_priv =kzalloc (sizeof (*port_priv),GFP_KERNEL );if (!port_priv) {dev_err (&device->dev,"No memory for ib_agent_port_private\n" ); ret = -ENOMEM ;
drivers/infiniband/core/cache.c +6 -6
@@ -1037,7 +1037,7 @@ static void ib_cache_update(struct ib_device *device, table = ports_table[port -rdma_start_port (device)]; - tprops =kmalloc (sizeof *tprops,GFP_KERNEL ); + tprops =kmalloc (sizeof (*tprops),GFP_KERNEL );if (!tprops)return ;
@@ -1048,8 +1048,8 @@ static void ib_cache_update(struct ib_device *device, goto err; } - pkey_cache =kmalloc (sizeof *pkey_cache + tprops->pkey_tbl_len * -sizeof *pkey_cache->table,GFP_KERNEL ); + pkey_cache =kmalloc (sizeof (*pkey_cache) + tprops->pkey_tbl_len * +sizeof (*pkey_cache->table),GFP_KERNEL );if (!pkey_cache) goto err;
@@ -1135,7 +1135,7 @@ static void ib_cache_event(struct ib_event_handler *handler, event->event == IB_EVENT_SM_CHANGE || event->event == IB_EVENT_CLIENT_REREGISTER || event->event == IB_EVENT_GID_CHANGE) { - work =kmalloc (sizeof *work,GFP_ATOMIC ); + work =kmalloc (sizeof (*work),GFP_ATOMIC );if (work) {INIT_WORK (&work->work, ib_cache_task); work->device = event->device;
@@ -1153,9 +1153,9 @@ int ib_cache_setup_one(struct ib_device *device)rwlock_init (&device->cache.lock); device->cache.pkey_cache = -kzalloc (sizeof *device->cache.pkey_cache * +kzalloc (sizeof (*device->cache.pkey_cache) * (rdma_end_port (device) -rdma_start_port (device) +1 ),GFP_KERNEL ); - device->cache.lmc_cache =kmalloc (sizeof *device->cache.lmc_cache * + device->cache.lmc_cache =kmalloc (sizeof (*device->cache.lmc_cache) * (rdma_end_port (device) -rdma_start_port (device) +1 ),GFP_KERNEL );
drivers/infiniband/core/cm.c +16 -16
@@ -630,7 +630,7 @@ static struct cm_id_private * cm_insert_remote_sidr(struct cm_id_privateelse {int cmp; cmp =memcmp (port_gid, &cur_cm_id_priv->av.dgid, -sizeof *port_gid); +sizeof (*port_gid));if (cmp <0 ) link = &(*link)->rb_left;else if (cmp >0 )
@@ -649,7 +649,7 @@ static void cm_reject_sidr_req(struct cm_id_private *cm_id_priv, {struct ib_cm_sidr_rep_param param; -memset (¶m,0 ,sizeof param); +memset (¶m,0 ,sizeof (param)); param.status = status;ib_send_cm_sidr_rep (&cm_id_priv->id, ¶m); }
@@ -661,7 +661,7 @@ struct ib_cm_id *ib_create_cm_id(struct ib_device *device,struct cm_id_private *cm_id_priv;int ret; - cm_id_priv =kzalloc (sizeof *cm_id_priv,GFP_KERNEL ); + cm_id_priv =kzalloc (sizeof (*cm_id_priv),GFP_KERNEL );if (!cm_id_priv)return ERR_PTR (-ENOMEM );
@@ -748,7 +748,7 @@ static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id) {struct cm_timewait_info *timewait_info; - timewait_info =kzalloc (sizeof *timewait_info,GFP_KERNEL ); + timewait_info =kzalloc (sizeof (*timewait_info),GFP_KERNEL );if (!timewait_info)return ERR_PTR (-ENOMEM );
@@ -847,7 +847,7 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err)spin_unlock_irq (&cm_id_priv->lock);ib_send_cm_rej (cm_id,IB_CM_REJ_TIMEOUT , &cm_id_priv->id.device->node_guid, -sizeof cm_id_priv->id.device->node_guid, +sizeof (cm_id_priv->id.device->node_guid),NULL ,0 );break ;case IB_CM_REQ_RCVD :
@@ -1293,7 +1293,7 @@ static void cm_format_paths_from_req(struct cm_req_msg *req_msg,struct ib_sa_path_rec *primary_path, struct ib_sa_path_rec *alt_path) { - memset(primary_path, 0, sizeof *primary_path); + memset(primary_path, 0, sizeof(*primary_path)); primary_path->dgid = req_msg->primary_local_gid; primary_path->sgid = req_msg->primary_remote_gid; primary_path->dlid = req_msg->primary_local_lid;
@@ -1315,7 +1315,7 @@ static void cm_format_paths_from_req(struct cm_req_msg *req_msg, primary_path->service_id = req_msg->service_id;if (req_msg->alt_local_lid) { -memset (alt_path,0 ,sizeof *alt_path); +memset (alt_path,0 ,sizeof (*alt_path)); alt_path->dgid = req_msg->alt_local_gid; alt_path->sgid = req_msg->alt_remote_gid; alt_path->dlid = req_msg->alt_local_lid;
@@ -1667,7 +1667,7 @@ static int cm_req_handler(struct cm_work *work) } work->path[0 ].gid_type = gid_attr.gid_type;ib_send_cm_rej (cm_id,IB_CM_REJ_INVALID_GID , - &work->path[0 ].sgid,sizeof work->path[0 ].sgid, + &work->path[0 ].sgid,sizeof (work->path[0 ].sgid),NULL ,0 ); goto rejected; }
@@ -1676,7 +1676,7 @@ static int cm_req_handler(struct cm_work *work)if (ret) {ib_send_cm_rej (cm_id,IB_CM_REJ_INVALID_ALT_GID , &work->path[0 ].sgid, -sizeof work->path[0 ].sgid,NULL ,0 ); +sizeof (work->path[0 ].sgid),NULL ,0 ); goto rejected; } }
@@ -2762,7 +2762,7 @@ static void cm_format_path_from_lap(struct cm_id_private *cm_id_priv,struct ib_sa_path_rec *path, struct cm_lap_msg *lap_msg) { - memset(path, 0, sizeof *path); + memset(path, 0, sizeof(*path)); path->dgid = lap_msg->alt_local_gid; path->sgid = lap_msg->alt_remote_gid; path->dlid = lap_msg->alt_local_lid;
@@ -3263,7 +3263,7 @@ static void cm_process_send_error(struct ib_mad_send_buf *msg,enum ib_cm_state state;int ret; -memset (&cm_event,0 ,sizeof cm_event); +memset (&cm_event,0 ,sizeof (cm_event)); cm_id_priv = msg->context[0 ];/* Discard old sends or ones without a response. */
@@ -3413,7 +3413,7 @@ static int cm_establish(struct ib_cm_id *cm_id)if (!cm_dev)return -ENODEV ; - work =kmalloc (sizeof *work,GFP_ATOMIC ); + work =kmalloc (sizeof (*work),GFP_ATOMIC );if (!work)return -ENOMEM ;
@@ -3560,7 +3560,7 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent,atomic_long_inc (&port->counter_group[CM_RECV ]. counter[attr_id -CM_ATTR_ID_OFFSET ]); - work =kmalloc (sizeof *work +sizeof (struct ib_sa_path_rec ) * paths, + work =kmalloc (sizeof (*work) +sizeof (struct ib_sa_path_rec ) * paths,GFP_KERNEL );if (!work) {ib_free_recv_mad (mad_recv_wc);
@@ -3880,7 +3880,7 @@ static void cm_add_one(struct ib_device *ib_device)if (!rdma_cap_ib_cm (ib_device, i))continue ; - port =kzalloc (sizeof *port,GFP_KERNEL ); + port =kzalloc (sizeof (*port),GFP_KERNEL );if (!port) goto error1;
@@ -3985,7 +3985,7 @@ static int __init ib_cm_init(void) {int ret; -memset (&cm,0 ,sizeof cm); +memset (&cm,0 ,sizeof (cm));INIT_LIST_HEAD (&cm.device_list);rwlock_init (&cm.device_lock);spin_lock_init (&cm.lock);
@@ -3995,7 +3995,7 @@ static int __init ib_cm_init(void) cm.remote_qp_table =RB_ROOT ; cm.remote_sidr_table =RB_ROOT ;idr_init (&cm.local_id_table); -get_random_bytes (&cm.random_id_operand,sizeof cm.random_id_operand); +get_random_bytes (&cm.random_id_operand,sizeof (cm.random_id_operand));INIT_LIST_HEAD (&cm.timewait_list); ret =class_register (&cm_class);
drivers/infiniband/core/cma.c +39 -39
299 lines not on this page · raw message
drivers/infiniband/core/device.c +4 -4
@@ -152,14 +152,14 @@ static int alloc_name(char *name)continue ;if (i <0 || i >=PAGE_SIZE *8 )continue ; -snprintf (buf,sizeof buf, name, i); +snprintf (buf,sizeof (buf), name, i);if (!strncmp (buf, device->name,IB_DEVICE_NAME_MAX ))set_bit (i, inuse); } i =find_first_zero_bit (inuse,PAGE_SIZE *8 );free_page ((unsigned long ) inuse); -snprintf (buf,sizeof buf, name, i); +snprintf (buf,sizeof (buf), name, i);if (__ib_device_get_by_name (buf))return -ENFILE ;
@@ -253,7 +253,7 @@ static int add_client_context(struct ib_device *device, struct ib_client *clientstruct ib_client_data *context;unsigned long flags; - context =kmalloc (sizeof *context,GFP_KERNEL ); + context =kmalloc (sizeof (*context),GFP_KERNEL );if (!context) {printk (KERN_WARNING "Couldn't allocate client context for %s/%s\n" , device->name, client->name);
@@ -844,7 +844,7 @@ int ib_find_gid(struct ib_device *device, union ib_gid *gid, ret =ib_query_gid (device, port, i, &tmp_gid,NULL );if (ret)return ret; -if (!memcmp (&tmp_gid, gid,sizeof *gid)) { +if (!memcmp (&tmp_gid, gid,sizeof (*gid))) { *port_num = port;if (index) *index = i;
drivers/infiniband/core/fmr_pool.c +4 -4
@@ -128,7 +128,7 @@ static inline struct ib_pool_fmr *ib_fmr_cache_lookup(struct ib_fmr_pool *pool,if (io_virtual_address == fmr->io_virtual_address && page_list_len == fmr->page_list_len && !memcmp (page_list, fmr->page_list, - page_list_len *sizeof *page_list)) + page_list_len *sizeof (*page_list)))return fmr;return NULL ;
@@ -232,7 +232,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,else max_remaps = device->attrs.max_map_per_fmr; - pool =kmalloc (sizeof *pool,GFP_KERNEL ); + pool =kmalloc (sizeof (*pool),GFP_KERNEL );if (!pool) { printk(KERN_WARNING PFX "couldn't allocate pool struct\n");return ERR_PTR (-ENOMEM );
@@ -248,7 +248,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,if (params->cache) { pool->cache_bucket = -kmalloc (IB_FMR_HASH_SIZE *sizeof *pool->cache_bucket, +kmalloc (IB_FMR_HASH_SIZE *sizeof (*pool->cache_bucket),GFP_KERNEL );if (!pool->cache_bucket) { printk(KERN_WARNING PFX "Failed to allocate cache in pool\n");
@@ -287,7 +287,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd, .max_maps = pool->max_remaps, .page_shift = params->page_shift }; -int bytes_per_fmr =sizeof *fmr; +int bytes_per_fmr =sizeof (*fmr);if (pool->cache_bucket) bytes_per_fmr += params->max_pages_per_fmr *sizeof (u64);
drivers/infiniband/core/mad.c +19 -19
@@ -335,14 +335,14 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device, }/* Allocate structures */ - mad_agent_priv =kzalloc (sizeof *mad_agent_priv,GFP_KERNEL ); + mad_agent_priv =kzalloc (sizeof (*mad_agent_priv),GFP_KERNEL );if (!mad_agent_priv) { ret =ERR_PTR (-ENOMEM ); goto error1; }if (mad_reg_req) { - reg_req =kmemdup (mad_reg_req,sizeof *reg_req,GFP_KERNEL ); + reg_req =kmemdup (mad_reg_req,sizeof (*reg_req),GFP_KERNEL );if (!reg_req) { ret =ERR_PTR (-ENOMEM ); goto error3;
@@ -463,7 +463,7 @@ static int register_snoop_agent(struct ib_mad_qp_info *qp_info,if (i == qp_info->snoop_table_size) {/* Grow table. */ new_snoop_table =krealloc (qp_info->snoop_table, -sizeof mad_snoop_priv * +sizeof (mad_snoop_priv) * (qp_info->snoop_table_size +1 ),GFP_ATOMIC );if (!new_snoop_table) {
@@ -511,7 +511,7 @@ struct ib_mad_agent *ib_register_mad_snoop(struct ib_device *device, goto error1; }/* Allocate structures */ - mad_snoop_priv =kzalloc (sizeof *mad_snoop_priv,GFP_KERNEL ); + mad_snoop_priv =kzalloc (sizeof (*mad_snoop_priv),GFP_KERNEL );if (!mad_snoop_priv) { ret =ERR_PTR (-ENOMEM ); goto error1;
@@ -695,7 +695,7 @@ static void snoop_recv(struct ib_mad_qp_info *qp_info,static void build_smp_wc (struct ib_qp *qp,struct ib_cqe *cqe,u16 slid,u16 pkey_index,u8 port_num,struct ib_wc *wc) { -memset (wc,0 ,sizeof *wc); +memset (wc,0 ,sizeof (*wc)); wc->wr_cqe = cqe; wc->status =IB_WC_SUCCESS ; wc->opcode =IB_WC_RECV ;
@@ -817,7 +817,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, goto out; } - local =kmalloc (sizeof *local,GFP_ATOMIC ); + local =kmalloc (sizeof (*local),GFP_ATOMIC );if (!local) { ret = -ENOMEM ;dev_err (&device->dev,"No memory for ib_mad_local_private\n" );
@@ -949,11 +949,11 @@ static int alloc_send_rmpp_list(struct ib_mad_send_wr_private *send_wr,/* Allocate data segments. */ for (left = send_buf->data_len + pad; left >0 ; left -= seg_size) { - seg =kmalloc (sizeof (*seg) + seg_size, gfp_mask); + seg =kmalloc (sizeof (*seg) + seg_size, gfp_mask);if (!seg) {dev_err (&send_buf->mad_agent->device->dev,"alloc_send_rmpp_segs: RMPP mem alloc failed for len %zd, gfp %#x\n" , -sizeof (*seg) + seg_size, gfp_mask); +sizeof (*seg) + seg_size, gfp_mask);free_send_rmpp_list (send_wr);return -ENOMEM ; }
@@ -1017,7 +1017,7 @@ struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent,return ERR_PTR (-EINVAL ); size = rmpp_active ? hdr_len : mad_size; - buf =kzalloc (sizeof *mad_send_wr + size, gfp_mask); + buf =kzalloc (sizeof (*mad_send_wr) + size, gfp_mask);if (!buf)return ERR_PTR (-ENOMEM );
@@ -1365,7 +1365,7 @@ static int method_in_use(struct ib_mad_mgmt_method_table **method,static int allocate_method_table (struct ib_mad_mgmt_method_table **method) {/* Allocate management method table */ - *method =kzalloc (sizeof **method,GFP_ATOMIC ); + *method =kzalloc (sizeof (**method),GFP_ATOMIC );if (!*method) {pr_err ("No memory for ib_mad_mgmt_method_table\n" );return -ENOMEM ;
@@ -1460,7 +1460,7 @@ static int add_nonoui_reg_req(struct ib_mad_reg_req *mad_reg_req, class = &port_priv->version[mad_reg_req->mgmt_class_version].class;if (!*class) {/* Allocate management class table for "new" class version */ - *class =kzalloc (sizeof **class,GFP_ATOMIC ); + *class =kzalloc (sizeof (**class),GFP_ATOMIC );if (!*class) {dev_err (&agent_priv->agent.device->dev,"No memory for ib_mad_mgmt_class_table\n" );
@@ -1527,7 +1527,7 @@ static int add_oui_reg_req(struct ib_mad_reg_req *mad_reg_req, mad_reg_req->mgmt_class_version].vendor;if (!*vendor_table) {/* Allocate mgmt vendor class table for "new" class version */ - vendor =kzalloc (sizeof *vendor,GFP_ATOMIC ); + vendor =kzalloc (sizeof (*vendor),GFP_ATOMIC );if (!vendor) {dev_err (&agent_priv->agent.device->dev,"No memory for ib_mad_mgmt_vendor_class_table\n" );
@@ -1538,7 +1538,7 @@ static int add_oui_reg_req(struct ib_mad_reg_req *mad_reg_req, }if (!(*vendor_table)->vendor_class[vclass]) {/* Allocate table for this management vendor class */ - vendor_class =kzalloc (sizeof *vendor_class,GFP_ATOMIC ); + vendor_class =kzalloc (sizeof (*vendor_class),GFP_ATOMIC );if (!vendor_class) {dev_err (&agent_priv->agent.device->dev,"No memory for ib_mad_mgmt_vendor_class\n" );
@@ -2545,7 +2545,7 @@ static bool ib_mad_send_error(struct ib_mad_port_private *port_priv,struct ib_qp_attr *attr;/* Transition QP to RTS and fail offending send */ - attr =kmalloc (sizeof *attr,GFP_KERNEL ); + attr =kmalloc (sizeof (*attr),GFP_KERNEL );if (attr) { attr->qp_state =IB_QPS_RTS ; attr->cur_qp_state =IB_QPS_SQE ;
@@ -2964,7 +2964,7 @@ static int ib_mad_port_start(struct ib_mad_port_private *port_priv)struct ib_qp *qp;u16 pkey_index; - attr =kmalloc (sizeof *attr,GFP_KERNEL ); + attr =kmalloc (sizeof (*attr),GFP_KERNEL );if (!attr) {dev_err (&port_priv->device->dev,"Couldn't kmalloc ib_qp_attr\n" );
@@ -3079,7 +3079,7 @@ static int create_mad_qp(struct ib_mad_qp_info *qp_info,struct ib_qp_init_attr qp_init_attr;int ret; -memset (&qp_init_attr,0 ,sizeof qp_init_attr); +memset (&qp_init_attr,0 ,sizeof (qp_init_attr)); qp_init_attr.send_cq = qp_info->port_priv->cq; qp_init_attr.recv_cq = qp_info->port_priv->cq; qp_init_attr.sq_sig_type =IB_SIGNAL_ALL_WR ;
@@ -3127,7 +3127,7 @@ static int ib_mad_port_open(struct ib_device *device,int ret, cq_size;struct ib_mad_port_private *port_priv;unsigned long flags; -char name[sizeof "ib_mad123" ]; +char name[sizeof ("ib_mad123" )];int has_smi;if (WARN_ON (rdma_max_mad_size (device, port_num) <IB_MGMT_MAD_SIZE ))
@@ -3138,7 +3138,7 @@ static int ib_mad_port_open(struct ib_device *device,return -EFAULT ;/* Create new device info */ - port_priv =kzalloc (sizeof *port_priv,GFP_KERNEL ); + port_priv =kzalloc (sizeof (*port_priv),GFP_KERNEL );if (!port_priv) {dev_err (&device->dev,"No memory for ib_mad_port_private\n" );return -ENOMEM ;
@@ -3180,7 +3180,7 @@ static int ib_mad_port_open(struct ib_device *device,if (ret) goto error7; -snprintf (name,sizeof name,"ib_mad%d" , port_num); +snprintf (name,sizeof (name),"ib_mad%d" , port_num); port_priv->wq =create_singlethread_workqueue (name);if (!port_priv->wq) { ret = -ENOMEM ;
drivers/infiniband/core/mad_rmpp.c +1 -1
@@ -287,7 +287,7 @@ create_rmpp_recv(struct ib_mad_agent_private *agent,struct mad_rmpp_recv *rmpp_recv;struct ib_mad_hdr *mad_hdr; - rmpp_recv =kmalloc (sizeof *rmpp_recv,GFP_KERNEL ); + rmpp_recv =kmalloc (sizeof (*rmpp_recv),GFP_KERNEL );if (!rmpp_recv)return NULL ;
drivers/infiniband/core/multicast.c +8 -8
@@ -136,7 +136,7 @@ static struct mcast_group *mcast_find(struct mcast_port *port,while (node) { group = rb_entry(node, struct mcast_group, node); - ret =memcmp (mgid->raw, group->rec.mgid.raw,sizeof *mgid); + ret =memcmp (mgid->raw, group->rec.mgid.raw,sizeof (*mgid));if (!ret)return group;
@@ -162,7 +162,7 @@ static struct mcast_group *mcast_insert(struct mcast_port *port, cur_group = rb_entry(parent, struct mcast_group, node); ret =memcmp (group->rec.mgid.raw, cur_group->rec.mgid.raw, -sizeof group->rec.mgid); +sizeof (group->rec.mgid));if (ret <0 ) link = &(*link)->rb_left;else if (ret >0 )
@@ -286,7 +286,7 @@ static int cmp_rec(struct ib_sa_mcmember_rec *src,/* MGID must already match */ if (comp_mask &IB_SA_MCMEMBER_REC_PORT_GID && -memcmp (&src->port_gid, &dst->port_gid,sizeof src->port_gid)) +memcmp (&src->port_gid, &dst->port_gid,sizeof (src->port_gid)))return -EINVAL ;if (comp_mask &IB_SA_MCMEMBER_REC_QKEY && src->qkey != dst->qkey)return -EINVAL ;
@@ -566,7 +566,7 @@ static struct mcast_group *acquire_group(struct mcast_port *port,unsigned long flags;int is_mgid0; - is_mgid0 = !memcmp (&mgid0, mgid,sizeof mgid0); + is_mgid0 = !memcmp (&mgid0, mgid,sizeof (mgid0));if (!is_mgid0) {spin_lock_irqsave (&port->lock, flags); group =mcast_find (port, mgid);
@@ -575,7 +575,7 @@ static struct mcast_group *acquire_group(struct mcast_port *port,spin_unlock_irqrestore (&port->lock, flags); } - group =kzalloc (sizeof *group, gfp_mask); + group =kzalloc (sizeof (*group), gfp_mask);if (!group)return NULL ;
@@ -626,7 +626,7 @@ ib_sa_join_multicast(struct ib_sa_client *client,if (!dev)return ERR_PTR (-ENODEV ); - member =kmalloc (sizeof *member, gfp_mask); + member =kmalloc (sizeof (*member), gfp_mask);if (!member)return ERR_PTR (-ENOMEM );
@@ -747,7 +747,7 @@ int ib_init_ah_from_mcmember(struct ib_device *device, u8 port_num,if (ret)return ret; -memset (ah_attr,0 ,sizeof *ah_attr); +memset (ah_attr,0 ,sizeof (*ah_attr)); ah_attr->dlid =be16_to_cpu (rec->mlid); ah_attr->sl = rec->sl; ah_attr->port_num = port_num;
@@ -821,7 +821,7 @@ static void mcast_add_one(struct ib_device *device)int i;int count =0 ; - dev =kmalloc (sizeof *dev + device->phys_port_cnt *sizeof *port, + dev =kmalloc (sizeof (*dev) + device->phys_port_cnt *sizeof (*port),GFP_KERNEL );if (!dev)return ;
drivers/infiniband/core/netlink.c +1 -1
@@ -63,7 +63,7 @@ int ibnl_add_client(int index, int nops,struct ibnl_client *cur;struct ibnl_client *nl_client; - nl_client =kmalloc (sizeof *nl_client,GFP_KERNEL ); + nl_client =kmalloc (sizeof (*nl_client),GFP_KERNEL );if (!nl_client)return -ENOMEM ;
drivers/infiniband/core/sa_query.c +6 -6
@@ -868,7 +868,7 @@ static void update_sm_ah(struct work_struct *work)return ; } - new_ah =kmalloc (sizeof *new_ah,GFP_KERNEL ); + new_ah =kmalloc (sizeof (*new_ah),GFP_KERNEL );if (!new_ah) {printk (KERN_WARNING "Couldn't allocate new SM AH\n" );return ;
@@ -882,7 +882,7 @@ static void update_sm_ah(struct work_struct *work) IB_DEFAULT_PKEY_FULL, &new_ah->pkey_index))printk (KERN_ERR "Couldn't find index for default PKey\n" ); -memset (&ah_attr,0 ,sizeof ah_attr); +memset (&ah_attr,0 ,sizeof (ah_attr)); ah_attr.dlid = port_attr.sm_lid; ah_attr.sl = port_attr.sm_sl; ah_attr.port_num = port->port_num;
@@ -1005,7 +1005,7 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,int use_roce;struct net_device *ndev =NULL ; -memset (ah_attr,0 ,sizeof *ah_attr); +memset (ah_attr,0 ,sizeof (*ah_attr)); ah_attr->dlid =be16_to_cpu (rec->dlid); ah_attr->sl = rec->sl; ah_attr->src_path_bits = be16_to_cpu(rec->slid) &
@@ -1137,7 +1137,7 @@ static void init_mad(struct ib_sa_mad *mad, struct ib_mad_agent *agent) {unsigned long flags; -memset (mad,0 ,sizeof *mad); +memset (mad,0 ,sizeof (*mad)); mad->mad_hdr.base_version =IB_MGMT_BASE_VERSION ; mad->mad_hdr.mgmt_class =IB_MGMT_CLASS_SUBN_ADM ;
@@ -1704,7 +1704,7 @@ static void ib_sa_add_one(struct ib_device *device) s =rdma_start_port (device); e =rdma_end_port (device); - sa_dev =kzalloc (sizeof *sa_dev + + sa_dev =kzalloc (sizeof (*sa_dev) + (e - s +1 ) *sizeof (struct ib_sa_port ),GFP_KERNEL );if (!sa_dev)
@@ -1794,7 +1794,7 @@ static int __init ib_sa_init(void) {int ret; -get_random_bytes (&tid,sizeof tid); +get_random_bytes (&tid,sizeof (tid));atomic_set (&ib_nl_sa_request_seq,0 );
drivers/infiniband/core/sysfs.c +3 -3
@@ -425,8 +425,8 @@ static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr,if (!dev->process_mad)return -ENOSYS ; - in_mad =kzalloc (sizeof *in_mad,GFP_KERNEL ); - out_mad =kmalloc (sizeof *out_mad,GFP_KERNEL ); + in_mad =kzalloc (sizeof (*in_mad),GFP_KERNEL ); + out_mad =kmalloc (sizeof (*out_mad),GFP_KERNEL );if (!in_mad || !out_mad) { ret = -ENOMEM ; goto out;
@@ -749,7 +749,7 @@ static int add_port(struct ib_device *device, int port_num,if (ret)return ret; - p =kzalloc (sizeof *p,GFP_KERNEL ); + p =kzalloc (sizeof (*p),GFP_KERNEL );if (!p)return -ENOMEM ;
drivers/infiniband/core/ucm.c +4 -4
@@ -177,7 +177,7 @@ static struct ib_ucm_context *ib_ucm_ctx_alloc(struct ib_ucm_file *file) {struct ib_ucm_context *ctx; - ctx =kzalloc (sizeof *ctx,GFP_KERNEL ); + ctx =kzalloc (sizeof (*ctx),GFP_KERNEL );if (!ctx)return NULL ;
@@ -353,7 +353,7 @@ static int ib_ucm_event_handler(struct ib_cm_id *cm_id, ctx = cm_id->context; - uevent =kzalloc (sizeof *uevent,GFP_KERNEL ); + uevent =kzalloc (sizeof (*uevent),GFP_KERNEL );if (!uevent) goto err1;
@@ -611,7 +611,7 @@ static ssize_t ib_ucm_init_qp_attr(struct ib_ucm_file *file,return PTR_ERR (ctx); resp.qp_attr_mask =0 ; -memset (&qp_attr,0 ,sizeof qp_attr); +memset (&qp_attr,0 ,sizeof (qp_attr)); qp_attr.qp_state = cmd.qp_state; result =ib_cm_init_qp_attr (ctx->cm_id, &qp_attr, &resp.qp_attr_mask);if (result)
@@ -1255,7 +1255,7 @@ static void ib_ucm_add_one(struct ib_device *device)if (!device->alloc_ucontext || !rdma_cap_ib_cm (device,1 ))return ; - ucm_dev =kzalloc (sizeof *ucm_dev,GFP_KERNEL ); + ucm_dev =kzalloc (sizeof (*ucm_dev),GFP_KERNEL );if (!ucm_dev)return ;
drivers/infiniband/core/ucma.c +9 -9
@@ -62,7 +62,7 @@ static struct ctl_table ucma_ctl_table[] = { { .procname = "max_backlog", .data = &max_backlog, - .maxlen = sizeof max_backlog, + .maxlen = sizeof(max_backlog), .mode = 0644, .proc_handler = proc_dointvec, },
@@ -379,7 +379,7 @@ static ssize_t ucma_get_event(struct ucma_file *file, const char __user *inbuf,struct ucma_event *uevent;int ret =0 ; -if (out_len <sizeof uevent->resp) +if (out_len <sizeof (uevent->resp))return -ENOSPC ;if (copy_from_user (&cmd, inbuf,sizeof (cmd)))
@@ -414,7 +414,7 @@ static ssize_t ucma_get_event(struct ucma_file *file, const char __user *inbuf, }if (copy_to_user ((void __user *)(unsigned long )cmd.response, - &uevent->resp,sizeof uevent->resp)) { + &uevent->resp,sizeof (uevent->resp))) { ret = -EFAULT ; goto done; }
@@ -809,7 +809,7 @@ static ssize_t ucma_query_route(struct ucma_file *file,if (IS_ERR (ctx))return PTR_ERR (ctx); -memset (&resp,0 ,sizeof resp); +memset (&resp,0 ,sizeof (resp)); addr = (struct sockaddr *) &ctx->cm_id->route.addr.src_addr; memcpy(&resp.src_addr, addr, addr->sa_family == AF_INET ? sizeof(struct sockaddr_in) :
@@ -862,7 +862,7 @@ static ssize_t ucma_query_addr(struct ucma_context *ctx,if (out_len <sizeof (resp))return -ENOSPC ; -memset (&resp,0 ,sizeof resp); +memset (&resp,0 ,sizeof (resp)); addr = (struct sockaddr *) &ctx->cm_id->route.addr.src_addr; resp.src_size =rdma_addr_size (addr);
@@ -922,7 +922,7 @@ static ssize_t ucma_query_gid(struct ucma_context *ctx,if (out_len <sizeof (resp))return -ENOSPC ; -memset (&resp,0 ,sizeof resp); +memset (&resp,0 ,sizeof (resp));ucma_query_device_addr (ctx->cm_id, &resp);
@@ -1143,7 +1143,7 @@ static ssize_t ucma_init_qp_attr(struct ucma_file *file,return PTR_ERR (ctx); resp.qp_attr_mask =0 ; -memset (&qp_attr,0 ,sizeof qp_attr); +memset (&qp_attr,0 ,sizeof (qp_attr)); qp_attr.qp_state = cmd.qp_state; ret =rdma_init_qp_attr (ctx->cm_id, &qp_attr, &resp.qp_attr_mask);if (ret)
@@ -1219,7 +1219,7 @@ static int ucma_set_ib_path(struct ucma_context *ctx,if (ret)return ret; -memset (&event,0 ,sizeof event); +memset (&event,0 ,sizeof (event)); event.event =RDMA_CM_EVENT_ROUTE_RESOLVED ;return ucma_event_handler (ctx->cm_id, &event); }
@@ -1621,7 +1621,7 @@ static int ucma_open(struct inode *inode, struct file *filp) {struct ucma_file *file; - file =kmalloc (sizeof *file,GFP_KERNEL ); + file =kmalloc (sizeof (*file),GFP_KERNEL );if (!file)return -ENOMEM ;
drivers/infiniband/core/ud_header.c +4 -4
@@ -323,7 +323,7 @@ int ib_ud_header_init(int payload_bytes, struct ib_ud_header *header) { grh_present = grh_present && !ip_version; -memset (header,0 ,sizeof *header); +memset (header,0 ,sizeof (*header));/* * UDP header without IP header doesn't make sense
@@ -454,8 +454,8 @@ int ib_ud_header_pack(struct ib_ud_header *header, len +=IB_DETH_BYTES ;if (header->immediate_present) { -memcpy (buf + len, &header->immediate_data,sizeof header->immediate_data); - len +=sizeof header->immediate_data; +memcpy (buf + len, &header->immediate_data,sizeof (header->immediate_data)); + len +=sizeof (header->immediate_data); }return len;
@@ -540,7 +540,7 @@ int ib_ud_header_unpack(void *buf, buf +=IB_DETH_BYTES ;if (header->immediate_present) -memcpy (&header->immediate_data, buf,sizeof header->immediate_data); +memcpy (&header->immediate_data, buf,sizeof (header->immediate_data));return 0 ; }
drivers/infiniband/core/umem.c +1 -1
@@ -113,7 +113,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,if (!can_do_mlock ())return ERR_PTR (-EPERM ); - umem =kzalloc (sizeof *umem,GFP_KERNEL ); + umem =kzalloc (sizeof (*umem),GFP_KERNEL );if (!umem)return ERR_PTR (-ENOMEM );
drivers/infiniband/core/user_mad.c +8 -8
@@ -219,7 +219,7 @@ static void recv_handler(struct ib_mad_agent *agent,if (mad_recv_wc->wc->status !=IB_WC_SUCCESS ) goto err1; - packet =kzalloc (sizeof *packet,GFP_KERNEL ); + packet =kzalloc (sizeof (*packet),GFP_KERNEL );if (!packet) goto err1;
@@ -459,7 +459,7 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf,if (count <hdr_size (file) +IB_MGMT_RMPP_HDR )return -EINVAL ; - packet =kzalloc (sizeof *packet +IB_MGMT_RMPP_HDR ,GFP_KERNEL ); + packet =kzalloc (sizeof (*packet) +IB_MGMT_RMPP_HDR ,GFP_KERNEL );if (!packet)return -ENOMEM ;
@@ -488,7 +488,7 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf, goto err_up; } -memset (&ah_attr,0 ,sizeof ah_attr); +memset (&ah_attr,0 ,sizeof (ah_attr)); ah_attr.dlid =be16_to_cpu (packet->mad.hdr.lid); ah_attr.sl = packet->mad.hdr.sl; ah_attr.src_path_bits = packet->mad.hdr.path_bits;
@@ -638,7 +638,7 @@ static int ib_umad_reg_agent(struct ib_umad_file *file, void __user *arg, goto out; } -if (copy_from_user (&ureq, arg,sizeof ureq)) { +if (copy_from_user (&ureq, arg,sizeof (ureq))) { ret = -EFAULT ; goto out; }
@@ -666,7 +666,7 @@ static int ib_umad_reg_agent(struct ib_umad_file *file, void __user *arg,memset (&req,0 ,sizeof (req)); req.mgmt_class = ureq.mgmt_class; req.mgmt_class_version = ureq.mgmt_class_version; -memcpy (req.oui, ureq.oui,sizeof req.oui); +memcpy (req.oui, ureq.oui,sizeof (req.oui));if (compat_method_mask) {u32 *umm = (u32 *) ureq.method_mask;
@@ -677,7 +677,7 @@ static int ib_umad_reg_agent(struct ib_umad_file *file, void __user *arg, umm[i *2 ] | ((u64 ) umm[i *2 +1 ] <<32 ); }else memcpy (req.method_mask, ureq.method_mask, -sizeof req.method_mask); +sizeof (req.method_mask)); } agent = ib_register_mad_agent(file->port->ib_dev, file->port->port_num,
@@ -939,7 +939,7 @@ static int ib_umad_open(struct inode *inode, struct file *filp) goto out; ret = -ENOMEM ; - file =kzalloc (sizeof *file,GFP_KERNEL ); + file =kzalloc (sizeof (*file),GFP_KERNEL );if (!file) goto out;
@@ -1284,7 +1284,7 @@ static void ib_umad_add_one(struct ib_device *device) s =rdma_start_port (device); e =rdma_end_port (device); - umad_dev =kzalloc (sizeof *umad_dev + + umad_dev =kzalloc (sizeof (*umad_dev) + (e - s +1 ) *sizeof (struct ib_umad_port ),GFP_KERNEL );if (!umad_dev)
drivers/infiniband/core/uverbs_cmd.c +130 -130
444 lines not on this page · raw message
drivers/infiniband/core/uverbs_marshall.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/cxgb3/iwch_provider.c +13 -13
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/cxgb4/qp.c +32 -32
64 lines not on this page · raw message
drivers/infiniband/hw/mlx4/alias_GUID.c +5 -6
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/mthca/mthca_allocator.c +4 -4
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/mthca/mthca_cmd.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/mthca/mthca_mad.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/mthca/mthca_main.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/mthca/mthca_mcg.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/mthca/mthca_memfree.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/mthca/mthca_profile.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/mthca/mthca_provider.c +35 -35
70 lines not on this page · raw message
drivers/infiniband/hw/mthca/mthca_srq.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/ocrdma/ocrdma_stats.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/infiniband/ulp/ipoib/ipoib_cm.c +11 -11
Lines of this file are not shown. View the raw message.
drivers/infiniband/ulp/ipoib/ipoib_fs.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/infiniband/ulp/ipoib/ipoib_ib.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/infiniband/ulp/ipoib/ipoib_main.c +8 -8
Lines of this file are not shown. View the raw message.
drivers/infiniband/ulp/ipoib/ipoib_multicast.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/infiniband/ulp/ipoib/ipoib_verbs.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/infiniband/ulp/ipoib/ipoib_vlan.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/infiniband/ulp/iser/iser_verbs.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/infiniband/ulp/srpt/ib_srpt.c +21 -21
42 lines not on this page · raw message
drivers/media/pci/saa7134/saa7134-video.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/media/platform/m2m-deinterlace.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/usb/gspca/t613.c +36 -36
72 lines not on this page · raw message
drivers/media/usb/uvc/uvc_driver.c +26 -26
52 lines not on this page · raw message
drivers/media/v4l2-core/videobuf2-dma-contig.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/media/v4l2-core/videobuf2-dma-sg.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/alloc.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/cmd.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/en_resources.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/en_rx.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/en_tx.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/eq.c +9 -9
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/icm.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/intf.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/main.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/mcg.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/mr.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/qp.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +12 -12
Lines of this file are not shown. View the raw message.
drivers/net/usb/rndis_host.c +21 -21
42 lines not on this page · raw message
drivers/net/wireless/marvell/mwifiex/scan.c +1 -2
Lines of this file are not shown. View the raw message.
drivers/staging/most/hdm-dim2/dim2_hdm.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ehca/ehca_uverbs.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_driver.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_eeprom.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_file_ops.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_iba6110.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_init_chip.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_intr.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_mmap.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_stats.c +4 -4
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_sysfs.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_verbs.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/staging/rdma/ipath/ipath_verbs_mcast.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/usb/gadget/function/f_loopback.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/usb/gadget/function/f_mass_storage.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/usb/gadget/function/f_uac2.c +25 -25
50 lines not on this page · raw message
drivers/usb/gadget/function/storage_common.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/usb/gadget/legacy/mass_storage.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/vhost/vhost.c +31 -31
62 lines not on this page · raw message
drivers/video/fbdev/omap2/omapfb/omapfb-main.c +1 -1
Lines of this file are not shown. View the raw message.
net/sunrpc/xprtrdma/svc_rdma_transport.c +4 -4
Lines of this file are not shown. View the raw message.
security/keys/encrypted-keys/encrypted.c +10 -10
Lines of this file are not shown. View the raw message.
tools/power/cpupower/utils/helpers/msr.c +2 -2
Lines of this file are not shown. View the raw message.
tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c +6 -6
Lines of this file are not shown. View the raw message.
tools/virtio/ringtest/virtio_ring_0_9.c +2 -2
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [PATCH] treewide: Use 'sizeof(x)' instead of 'sizeof x'
Quoted 15 lines · Ingo Molnar
Quoted 3 lines · Ingo Molnar
If anyone feels strongly about accepting such patches, then the right solution is to create a Coccinelle semantic patch to run over the whole kernel and get over with the churn once and for all.
So applying a semantic patch like this to all .c files:
@@ expression E; @@
-sizeof E
+sizeof(E)
@@ expression E2; @@
-sizeof((E2))
+sizeof(E2)
Quoted 2 lines
Produces the single patch below for the whole kernel - instead of generating a churn of 1,000+ patches ...
If this isn't a joke, a nicer way to submit this is by subsystem and not as a single huge patch.
This allows subsystem maintainers to reduce patch
contention as this patch already doesn't apply
to -next.
Al Viro
maintainerQuoted 24 lines · Ingo Molnar
Quoted 21 lines · Wei Tang
This patch fixes the checkpatch.pl warning to
fork.c:WARNING: sizeof
sig->rlimshould besizeof(sig->rlim)Signed-off-by Wei Tang <[email protected]>--- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/fork.c +1
-1@@ -1143,7 +1143,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) sig->real_timer.function = it_real_fn;task_lock (current->group_leader); -memcpy (sig->rlim, current->signal->rlim,sizeof sig->rlim); +memcpy (sig->rlim, current->signal->rlim,sizeof (sig->rlim));task_unlock (current->group_leader);
Quoted 8 lines
kernel/fork.c static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) · line 1149
Quoted 1 line
kernel/fork.c +0
-0posix_cpu_timers_init_group (sig);So there's over 1,000 such occurances in the kernel and we do not need this drip-drip churn...
If anyone feels strongly about accepting such patches, then the right solution is to create a Coccinelle semantic patch to run over the whole kernel and get over with the churn once and for all.
That, or a single patch taking that piece of idiocy out of checkpatch.pl...
Quoted 2 lines · Al Viro
Quoted 1 line · Ingo Molnar
* Wei Tang <[email protected]> wrote:
[]
Quoted 1 line
Quoted 1 line
Quoted 1 line
WARNING: sizeof
sig->rlimshould besizeof(sig->rlim)
[]
Quoted 5 lines
Quoted 3 lines
If anyone feels strongly about accepting such patches, then the right solution is to create a Coccinelle semantic patch to run over the whole kernel and get over with the churn once and for all.
That, or a single patch taking that piece of idiocy out of checkpatch.pl...
Al Viro
maintainerQuoted 5 lines · Joe Perches
Quoted 2 lines · Al Viro
Quoted 1 line · Ingo Molnar
* Wei Tang <[email protected]> wrote:
[]
Quoted 1 line
Quoted 1 line
Quoted 1 line
WARNING: sizeof
sig->rlimshould besizeof(sig->rlim)
Quoted 8 lines
[]
Quoted 5 lines
Quoted 3 lines
If anyone feels strongly about accepting such patches, then the right solution is to create a Coccinelle semantic patch to run over the whole kernel and get over with the churn once and for all.
That, or a single patch taking that piece of idiocy out of checkpatch.pl...
Umm... Matter of taste, really - and I don't quite agree about "should think of sizeof() as a function, not as some ass-backwards special case C parsing rule that is subtle as hell". I've seen enough folks getting confused about treatment of arrays; confusion between sizeof uses and function calls often contributed to that.
Quoted 11 lines · Al Viro
Quoted 10 lines · Joe Perches
Quoted 2 lines · Al Viro
Quoted 1 line · Ingo Molnar
* Wei Tang <[email protected]> wrote:
[]
Quoted 1 line
Quoted 1 line
Quoted 1 line
WARNING: sizeof
sig->rlimshould besizeof(sig->rlim)[]
Quoted 4 lines
Quoted 3 lines
If anyone feels strongly about accepting such patches, then the right solution is to create a Coccinelle semantic patch to run over the whole kernel and get over with the churn once and for all.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
That, or a single patch taking that piece of idiocy out of checkpatch.pl...
Umm... Matter of taste, really
On that I can agree. Idiocy rather less so.
A message that is not in the archive (sent off-list or not yet received): CAOviyajXB2y5zuFhdRPQfVSe_NYvaFjjUz6f86e791AvFPYfMw@mail.gmail.com
Al Viro
maintainerQuoted 4 lines · Aleksa Sarai
I haven't looked at the order of operations for sizeof, but I imagine there's cases where it might bind in a different way than is expected. Are you sure there'd be no negative downside to removing the check (the whole point is to ensure no new code has stuff like that).
I won't comment on the whole point (or lack thereof) of checkpatch.pl, but the only subtlety with sizeof is that sizeof ( type-name ) <something> is *never* interpreted as sizeof of something cast to type-name. IOW, its priority is higher than that of typecasts. If <something> starts with {, it's a sizeof of compound literal, otherwise it's an unary expression "sizeof ( type-name )" followed by <something>, which might or might not yield a valid expression (e.g.
sizeof(int)1
won't parse, while
sizeof(int)-1
will be treated as (sizeof(int)) - 1).
Potential headache is along the lines of
#define A (int)-1
sizeof A
but that's more of "use enough parentheses in body of a macro to avoid nasty surprises" - same as e.g.
#define A 2 + 2
A * A
yielding 8 (2 + 2 * 2 + 2) rather than expected 16 ((2 + 2) * (2 + 2))
FWIW, the actual rules are
unary-expression: postfix-expression |
++ unary-expression | -- unary-expression |
- cast-expression |
+ cast-expression | ! cast-expression | ~ cast-expression |
* cast-expression | & cast-expression | sizeof unary-expression | sizeof ( type-name )
cast-expression: unary-expression |
( type-name ) cast-expression
Note that while e.g.
++ ++ n
is allowed by grammar, it runs afoul of the constraint for ++ argument, which must be a modifiable lvalue. None of the operators above yield that, so the rules for ++ and -- might as well have been ++ postfix-expression and -- postfix-expression resp.
Quoted 15 lines · Al Viro
FWIW, the actual rules are
unary-expression: postfix-expression |
++ unary-expression | -- unary-expression |
- cast-expression |
+ cast-expression | ! cast-expression | ~ cast-expression |
* cast-expression | & cast-expression | sizeof unary-expression | sizeof ( type-name )
cast-expression: unary-expression |
( type-name ) cast-expression
Note that while e.g.
Quoted 5 lines
++ ++ nis allowed by grammar, it runs afoul of the constraint for ++ argument, which must be a modifiable lvalue. None of the operators above yield that, so the rules for ++ and -- might as well have been ++ postfix-expression and -- postfix-expression resp.
Unless I'm mistaken, * cast-expression yields an lvalue.
- Kevin
Al Viro
maintainerQuoted 6 lines · Kevin Easton
Quoted 2 lines · Al Viro
the rules for ++ and -- might as well have been ++ postfix-expression and -- postfix-expression resp.
Unless I'm mistaken, * cast-expression yields an lvalue.
D'oh... Obviously correct (and just as obviously, ++*p is valid and quite common). Shouldn't have posted while half-asleep ;-/ Self-LART applied...