OpenCloudOS-Kernel/drivers/misc
Johannes Berg 59ae1d127a networking: introduce and use skb_put_data()
A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.

An spatch similar to the one for skb_put_zero() converts many
of the places using it:

    @@
    identifier p, p2;
    expression len, skb, data;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, len);
    |
    -memcpy(p, data, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb, data;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, sizeof(*p));
    |
    -memcpy(p, data, sizeof(*p));
    )

    @@
    expression skb, len, data;
    @@
    -memcpy(skb_put(skb, len), data, len);
    +skb_put_data(skb, data, len);

(again, manually post-processed to retain some comments)

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 11:48:37 -04:00
..
altera-stapl
c2port drivers/misc/c2port/c2port-duramar2150.c: checking for NULL instead of IS_ERR() 2017-05-08 17:15:10 -07:00
cb710
cxl cxl: Avoid double free_irq() for psl,slice interrupts 2017-06-09 11:30:53 +02:00
echo
eeprom eeprom: idt_89hpesx: Add OF device ID table 2017-04-08 18:22:59 +02:00
genwqe sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
ibmasm sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
lis3lv02d sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
mei mei: make sysfs modalias format similar as uevent modalias 2017-06-03 19:10:22 +09:00
mic virtio: add context flag to find vqs 2017-05-02 23:41:43 +03:00
sgi-gru mm: convert generic code to 5-level paging 2017-03-09 11:48:47 -08:00
sgi-xp sgi-xp: Use designated initializers 2017-05-28 10:22:42 -07:00
ti-st networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
vmw_vmci drivers/misc/vmw_vmci/vmci_queue_pair.c: fix a couple integer overflow tests 2017-05-08 17:15:10 -07:00
Kconfig misc: pci_endpoint_test: select CRC32 2017-05-16 23:05:40 +02:00
Makefile pci-v4.12-changes 2017-05-08 19:03:25 -07:00
ad525x_dpot-i2c.c misc: ad525x_dpot: Remove unnecessary MODULE_ALIAS() 2015-09-20 19:33:29 -07:00
ad525x_dpot-spi.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
ad525x_dpot.c misc: ad525x_dpot: Fix the enabling of the "otpXen" attributes 2016-03-01 16:55:13 -08:00
ad525x_dpot.h
apds990x.c misc: apds990x, bh1770glc, lis3lv02d: use to_i2c_client 2016-02-07 23:01:45 -08:00
apds9802als.c
aspeed-lpc-ctrl.c drivers/misc: aspeed-lpc-ctrl: fix printk format warning again 2017-04-08 17:37:20 +02:00
atmel-ssc.c misc: atmel-ssc: register as sound DAI if #sound-dai-cells is present 2016-12-15 12:13:31 +00:00
atmel_tclib.c misc: atmel_tclib: get and use slow clock 2015-10-06 12:33:14 +02:00
bh1770glc.c misc: apds990x, bh1770glc, lis3lv02d: use to_i2c_client 2016-02-07 23:01:45 -08:00
cs5535-mfgpt.c
ds1682.c misc: ds1682: Add OF device ID table 2017-04-08 18:22:59 +02:00
dummy-irq.c Annotate hardware config module parameters in drivers/misc/ 2017-04-20 12:02:32 +01:00
enclosure.c scsi: ses: don't get power status of SES device slot on probe 2017-04-06 12:48:05 -04:00
fsa9480.c
hmc6352.c
hpilo.c drivers/misc/hpilo: Changes to support new security states in iLO5 FW 2016-09-27 12:53:46 +02:00
hpilo.h
ics932s401.c
ioc4.c
isl29003.c misc: Drop owner assignment from i2c_driver 2015-08-10 08:37:35 +02:00
isl29020.c
kgdbts.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task.h> 2017-03-02 08:42:35 +01:00
lattice-ecp3-config.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
lkdtm.h lkdtm: add bad USER_DS test 2017-04-08 17:56:02 +02:00
lkdtm_bugs.c misc: lkdtm: Add volatile to intentional NULL pointer reference 2017-04-18 18:03:42 +02:00
lkdtm_core.c lkdtm: add bad USER_DS test 2017-04-08 17:56:02 +02:00
lkdtm_heap.c sched/headers: Prepare to remove <linux/cred.h> inclusion from <linux/sched.h> 2017-03-02 08:42:31 +01:00
lkdtm_perms.c lkdtm: Do not use flush_icache_range() on user addresses 2016-11-10 15:34:56 +01:00
lkdtm_rodata.c lkdtm: Mark lkdtm_rodata_do_nothing() notrace 2016-08-31 13:12:38 +02:00
lkdtm_usercopy.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
pch_phub.c misc: pch_phub: Add UART_CLK quirk for Boston platform 2016-08-31 15:45:18 +02:00
pci_endpoint_test.c misc: Add host side PCI driver for PCI test function device 2017-04-28 10:23:19 -05:00
phantom.c
pti.c
qcom-coincell.c ARM: qcom: silence an uninitialized variable warning 2016-05-01 14:20:04 -07:00
spear13xx_pcie_gadget.c spear13xx_pcie_gadget: use per-attribute show and store methods 2015-10-13 22:17:40 -07:00
sram-exec.c drivers/misc/sram-exec.c: use set_memory.h header 2017-05-08 17:15:14 -07:00
sram.c misc: sram: Integrate protect-exec reserved sram area type 2017-01-25 11:48:03 +01:00
sram.h misc: sram: Integrate protect-exec reserved sram area type 2017-01-25 11:48:03 +01:00
ti_dac7512.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
tifm_7xx1.c
tifm_core.c
tsl2550.c misc: tsl2550: Add OF device ID table 2017-04-08 18:22:59 +02:00
vexpress-syscfg.c sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
vmw_balloon.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00