mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf after 7.0-rc1
Cross-merge trees after 7.0-rc1. No conflicts. Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
commit
3ecf0b4a0e
3
CREDITS
3
CREDITS
|
|
@ -3492,7 +3492,8 @@ S: Brazil
|
|||
N: Stephen Rothwell
|
||||
E: sfr@canb.auug.org.au
|
||||
W: http://www.canb.auug.org.au/~sfr
|
||||
P: 1024/BD8C7805 CD A4 9D 01 10 6E 7E 3B 91 88 FA D9 C8 40 AA 02
|
||||
P: 4096R/5AD24211C060D1C8 D41C A3ED 5B30 275C F5A0 1B05 5AD2 4211 C060 D1C8
|
||||
D: Created linux-next and maintained it 2008-2026
|
||||
D: Boot/setup/build work for setup > 2K
|
||||
D: Author, APM driver
|
||||
D: Directory notification
|
||||
|
|
|
|||
|
|
@ -127,6 +127,18 @@ To enable verbose messages set the V= variable, for example::
|
|||
|
||||
make coccicheck MODE=report V=1
|
||||
|
||||
By default, coccicheck will print debug logs to stdout and redirect stderr to
|
||||
/dev/null. This can make coccicheck output difficult to read and understand.
|
||||
Debug and error messages can instead be written to a debug file instead by
|
||||
setting the ``DEBUG_FILE`` variable::
|
||||
|
||||
make coccicheck MODE=report DEBUG_FILE="cocci.log"
|
||||
|
||||
Coccinelle cannot overwrite a debug file. Instead of repeatedly deleting a log
|
||||
file, you could include the datetime in the debug file name::
|
||||
|
||||
make coccicheck MODE=report DEBUG_FILE="cocci-$(date -Iseconds).log"
|
||||
|
||||
Coccinelle parallelization
|
||||
--------------------------
|
||||
|
||||
|
|
@ -208,11 +220,10 @@ include options matching the options used when we compile the kernel.
|
|||
You can learn what these options are by using V=1; you could then
|
||||
manually run Coccinelle with debug options added.
|
||||
|
||||
Alternatively you can debug running Coccinelle against SmPL patches
|
||||
by asking for stderr to be redirected to stderr. By default stderr
|
||||
is redirected to /dev/null; if you'd like to capture stderr you
|
||||
can specify the ``DEBUG_FILE="file.txt"`` option to coccicheck. For
|
||||
instance::
|
||||
An easier approach to debug running Coccinelle against SmPL patches is to ask
|
||||
coccicheck to redirect stderr to a debug file. As mentioned in the examples, by
|
||||
default stderr is redirected to /dev/null; if you'd like to capture stderr you
|
||||
can specify the ``DEBUG_FILE="file.txt"`` option to coccicheck. For instance::
|
||||
|
||||
rm -f cocci.err
|
||||
make coccicheck COCCI=scripts/coccinelle/free/kfree.cocci MODE=report DEBUG_FILE=cocci.err
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ properties:
|
|||
- enum:
|
||||
- qcom,kaanapali-cci
|
||||
- qcom,qcm2290-cci
|
||||
- qcom,qcs8300-cci
|
||||
- qcom,sa8775p-cci
|
||||
- qcom,sc7280-cci
|
||||
- qcom,sc8280xp-cci
|
||||
|
|
@ -133,6 +134,7 @@ allOf:
|
|||
enum:
|
||||
- qcom,kaanapali-cci
|
||||
- qcom,qcm2290-cci
|
||||
- qcom,qcs8300-cci
|
||||
- qcom,sm8750-cci
|
||||
then:
|
||||
properties:
|
||||
|
|
|
|||
100
Documentation/devicetree/bindings/i2c/silabs,cp2112.yaml
Normal file
100
Documentation/devicetree/bindings/i2c/silabs,cp2112.yaml
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/i2c/silabs,cp2112.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: CP2112 HID USB to SMBus/I2C Bridge
|
||||
|
||||
maintainers:
|
||||
- Danny Kaehn <danny.kaehn@plexus.com>
|
||||
|
||||
description:
|
||||
The CP2112 is a USB HID device which includes an integrated I2C controller
|
||||
and 8 GPIO pins. Its GPIO pins can each be configured as inputs, open-drain
|
||||
outputs, or push-pull outputs.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: usb10c4,ea90
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
description: The USB port number
|
||||
|
||||
interrupt-controller: true
|
||||
"#interrupt-cells":
|
||||
const: 2
|
||||
|
||||
gpio-controller: true
|
||||
"#gpio-cells":
|
||||
const: 2
|
||||
|
||||
gpio-line-names:
|
||||
minItems: 1
|
||||
maxItems: 8
|
||||
|
||||
i2c:
|
||||
description: The SMBus/I2C controller node for the CP2112
|
||||
$ref: /schemas/i2c/i2c-controller.yaml#
|
||||
unevaluatedProperties: false
|
||||
|
||||
properties:
|
||||
clock-frequency:
|
||||
minimum: 10000
|
||||
default: 100000
|
||||
maximum: 400000
|
||||
|
||||
patternProperties:
|
||||
"-hog(-[0-9]+)?$":
|
||||
type: object
|
||||
|
||||
required:
|
||||
- gpio-hog
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
|
||||
usb {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cp2112: device@1 {
|
||||
compatible = "usb10c4,ea90";
|
||||
reg = <1>;
|
||||
|
||||
gpio-controller;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
#gpio-cells = <2>;
|
||||
gpio-line-names = "CP2112_SDA", "CP2112_SCL", "TEST2",
|
||||
"TEST3","TEST4", "TEST5", "TEST6";
|
||||
|
||||
fan-rst-hog {
|
||||
gpio-hog;
|
||||
gpios = <7 GPIO_ACTIVE_HIGH>;
|
||||
output-high;
|
||||
line-name = "FAN_RST";
|
||||
};
|
||||
|
||||
i2c {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
sda-gpios = <&cp2112 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
scl-gpios = <&cp2112 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
|
||||
temp@48 {
|
||||
compatible = "national,lm75";
|
||||
reg = <0x48>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
Motorola CPCAP PMIC RTC
|
||||
-----------------------
|
||||
|
||||
This module is part of the CPCAP. For more details about the whole
|
||||
chip see Documentation/devicetree/bindings/mfd/motorola-cpcap.txt.
|
||||
|
||||
Requires node properties:
|
||||
- compatible: should contain "motorola,cpcap-rtc"
|
||||
- interrupts: An interrupt specifier for alarm and 1 Hz irq
|
||||
|
||||
Example:
|
||||
|
||||
&cpcap {
|
||||
cpcap_rtc: rtc {
|
||||
compatible = "motorola,cpcap-rtc";
|
||||
interrupts = <39 IRQ_TYPE_NONE>, <26 IRQ_TYPE_NONE>;
|
||||
};
|
||||
};
|
||||
|
|
@ -23,6 +23,7 @@ properties:
|
|||
- loongson,ls1b-rtc
|
||||
- loongson,ls1c-rtc
|
||||
- loongson,ls7a-rtc
|
||||
- loongson,ls2k0300-rtc
|
||||
- loongson,ls2k1000-rtc
|
||||
- items:
|
||||
- enum:
|
||||
|
|
@ -42,6 +43,18 @@ required:
|
|||
|
||||
unevaluatedProperties: false
|
||||
|
||||
if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- loongson,ls1c-rtc
|
||||
- loongson,ls2k0300-rtc
|
||||
|
||||
then:
|
||||
properties:
|
||||
interrupts: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/rtc/motorola,cpcap-rtc.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Motorola CPCAP PMIC RTC
|
||||
|
||||
maintainers:
|
||||
- Svyatoslav Ryhel <clamor95@gmail.com>
|
||||
|
||||
description:
|
||||
This module is part of the Motorola CPCAP MFD device. For more details
|
||||
see Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml. The
|
||||
RTC is represented as a sub-node of the PMIC node on the device tree.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: motorola,cpcap-rtc
|
||||
|
||||
interrupts:
|
||||
items:
|
||||
- description: alarm interrupt
|
||||
- description: 1 Hz interrupt
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- interrupts
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
...
|
||||
|
|
@ -14,6 +14,7 @@ properties:
|
|||
items:
|
||||
- enum:
|
||||
- renesas,r9a08g045-rtca3 # RZ/G3S
|
||||
- renesas,r9a09g056-rtca3 # RZ/V2N
|
||||
- renesas,r9a09g057-rtca3 # RZ/V2H
|
||||
- const: renesas,rz-rtca3
|
||||
|
||||
|
|
@ -82,7 +83,9 @@ allOf:
|
|||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
const: renesas,r9a09g057-rtca3
|
||||
enum:
|
||||
- renesas,r9a09g056-rtca3
|
||||
- renesas,r9a09g057-rtca3
|
||||
then:
|
||||
properties:
|
||||
resets:
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ properties:
|
|||
reg:
|
||||
maxItems: 1
|
||||
|
||||
avdd-supply:
|
||||
AVDD-supply:
|
||||
description: Analog power supply
|
||||
|
||||
dvdd-supply:
|
||||
DVDD-supply:
|
||||
description: Digital power supply
|
||||
|
||||
reset-gpios:
|
||||
|
|
@ -60,7 +60,7 @@ allOf:
|
|||
properties:
|
||||
dsd-path: false
|
||||
|
||||
additionalProperties: false
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ properties:
|
|||
reg:
|
||||
maxItems: 1
|
||||
|
||||
avdd-supply:
|
||||
AVDD-supply:
|
||||
description: A 1.8V supply that powers up the AVDD pin.
|
||||
|
||||
dvdd-supply:
|
||||
DVDD-supply:
|
||||
description: A 1.2V supply that powers up the DVDD pin.
|
||||
|
||||
reset-gpios:
|
||||
|
|
@ -32,7 +32,10 @@ required:
|
|||
- compatible
|
||||
- reg
|
||||
|
||||
additionalProperties: false
|
||||
allOf:
|
||||
- $ref: dai-common.yaml#
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
|
|
|||
|
|
@ -9638,6 +9638,7 @@ F: security/integrity/evm/
|
|||
|
||||
EXTENSIBLE FIRMWARE INTERFACE (EFI)
|
||||
M: Ard Biesheuvel <ardb@kernel.org>
|
||||
R: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
||||
L: linux-efi@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
|
||||
|
|
|
|||
6
Makefile
6
Makefile
|
|
@ -1,8 +1,8 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 6
|
||||
PATCHLEVEL = 19
|
||||
VERSION = 7
|
||||
PATCHLEVEL = 0
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION =
|
||||
EXTRAVERSION = -rc1
|
||||
NAME = Baby Opossum Posse
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
|||
|
|
@ -861,7 +861,7 @@ marvel_agp_setup(alpha_agp_info *agp)
|
|||
if (!alpha_agpgart_size)
|
||||
return -ENOMEM;
|
||||
|
||||
aper = kmalloc(sizeof(*aper), GFP_KERNEL);
|
||||
aper = kmalloc_obj(*aper);
|
||||
if (aper == NULL) return -ENOMEM;
|
||||
|
||||
aper->arena = agp->hose->sg_pci;
|
||||
|
|
@ -1059,7 +1059,7 @@ marvel_agp_info(void)
|
|||
/*
|
||||
* Allocate the info structure.
|
||||
*/
|
||||
agp = kmalloc(sizeof(*agp), GFP_KERNEL);
|
||||
agp = kmalloc_obj(*agp);
|
||||
if (!agp)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ titan_agp_setup(alpha_agp_info *agp)
|
|||
if (!alpha_agpgart_size)
|
||||
return -ENOMEM;
|
||||
|
||||
aper = kmalloc(sizeof(struct titan_agp_aperture), GFP_KERNEL);
|
||||
aper = kmalloc_obj(struct titan_agp_aperture);
|
||||
if (aper == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -760,7 +760,7 @@ titan_agp_info(void)
|
|||
/*
|
||||
* Allocate the info structure.
|
||||
*/
|
||||
agp = kmalloc(sizeof(*agp), GFP_KERNEL);
|
||||
agp = kmalloc_obj(*agp);
|
||||
if (!agp)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ process_reloc_for_got(Elf64_Rela *rela,
|
|||
goto found_entry;
|
||||
}
|
||||
|
||||
g = kmalloc (sizeof (*g), GFP_KERNEL);
|
||||
g = kmalloc_obj(*g);
|
||||
g->next = chains[r_sym].next;
|
||||
g->r_addend = r_addend;
|
||||
g->got_offset = *poffset;
|
||||
|
|
@ -93,7 +93,7 @@ module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs,
|
|||
}
|
||||
|
||||
nsyms = symtab->sh_size / sizeof(Elf64_Sym);
|
||||
chains = kcalloc(nsyms, sizeof(struct got_entry), GFP_KERNEL);
|
||||
chains = kzalloc_objs(struct got_entry, nsyms);
|
||||
if (!chains) {
|
||||
printk(KERN_ERR
|
||||
"module %s: no memory for symbol chain buffer\n",
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ static void pdev_save_srm_config(struct pci_dev *dev)
|
|||
printed = 1;
|
||||
}
|
||||
|
||||
tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
|
||||
tmp = kmalloc_obj(*tmp);
|
||||
if (!tmp) {
|
||||
printk(KERN_ERR "%s: kmalloc() failed!\n", __func__);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ register_cpus(void)
|
|||
int i;
|
||||
|
||||
for_each_possible_cpu(i) {
|
||||
struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
|
||||
struct cpu *p = kzalloc_obj(*p);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
register_cpu(p, i);
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ void *unwind_add_table(struct module *module, const void *table_start,
|
|||
if (table_size <= 0)
|
||||
return NULL;
|
||||
|
||||
table = kmalloc(sizeof(*table), GFP_KERNEL);
|
||||
table = kmalloc_obj(*table);
|
||||
if (!table)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -1140,7 +1140,7 @@ static int jit_prepare_final_mem_alloc(struct jit_context *ctx)
|
|||
}
|
||||
|
||||
if (ctx->need_extra_pass) {
|
||||
ctx->jit_data = kzalloc(sizeof(*ctx->jit_data), GFP_KERNEL);
|
||||
ctx->jit_data = kzalloc_obj(*ctx->jit_data);
|
||||
if (!ctx->jit_data)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ config ARM
|
|||
select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE if HAVE_KRETPROBES && FRAME_POINTER && !ARM_UNWIND
|
||||
select ARCH_HAS_BINFMT_FLAT
|
||||
select ARCH_HAS_CACHE_LINE_SIZE if OF
|
||||
select ARCH_HAS_CC_CAN_LINK
|
||||
select ARCH_HAS_CPU_CACHE_ALIASING
|
||||
select ARCH_HAS_CPU_FINALIZE_INIT if MMU
|
||||
select ARCH_HAS_CURRENT_STACK_POINTER
|
||||
|
|
@ -1716,6 +1717,18 @@ config KERNEL_MODE_NEON
|
|||
|
||||
endmenu
|
||||
|
||||
config ARCH_CC_CAN_LINK
|
||||
bool
|
||||
default $(cc_can_link_user,-mlittle-endian) if CPU_LITTLE_ENDIAN
|
||||
default $(cc_can_link_user,-mbig-endian -mbe8) if CPU_ENDIAN_BE8
|
||||
default $(cc_can_link_user,-mbig-endian -mbe32) if CPU_ENDIAN_BE32
|
||||
|
||||
config ARCH_USERFLAGS
|
||||
string
|
||||
default "-mlittle-endian" if CPU_LITTLE_ENDIAN
|
||||
default "-mbig-endian -mbe8" if CPU_ENDIAN_BE8
|
||||
default "-mbig-endian -mbe32" if CPU_ENDIAN_BE32
|
||||
|
||||
menu "Power management options"
|
||||
|
||||
source "kernel/power/Kconfig"
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
|
|||
struct locomo_dev *dev;
|
||||
int ret;
|
||||
|
||||
dev = kzalloc(sizeof(struct locomo_dev), GFP_KERNEL);
|
||||
dev = kzalloc_obj(struct locomo_dev);
|
||||
if (!dev) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
|
|
@ -277,7 +277,7 @@ static int locomo_suspend(struct platform_device *dev, pm_message_t state)
|
|||
struct locomo_save_data *save;
|
||||
unsigned long flags;
|
||||
|
||||
save = kmalloc(sizeof(struct locomo_save_data), GFP_KERNEL);
|
||||
save = kmalloc_obj(struct locomo_save_data);
|
||||
if (!save)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
|
|||
unsigned long r;
|
||||
int i, ret = -ENODEV;
|
||||
|
||||
lchip = kzalloc(sizeof(struct locomo), GFP_KERNEL);
|
||||
lchip = kzalloc_obj(struct locomo);
|
||||
if (!lchip)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -737,7 +737,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
|
|||
unsigned i;
|
||||
int ret;
|
||||
|
||||
dev = kzalloc(sizeof(struct sa1111_dev), GFP_KERNEL);
|
||||
dev = kzalloc_obj(struct sa1111_dev);
|
||||
if (!dev) {
|
||||
ret = -ENOMEM;
|
||||
goto err_alloc;
|
||||
|
|
@ -969,7 +969,7 @@ static int sa1111_suspend_noirq(struct device *dev)
|
|||
unsigned int val;
|
||||
void __iomem *base;
|
||||
|
||||
save = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL);
|
||||
save = kmalloc_obj(struct sa1111_save_data);
|
||||
if (!save)
|
||||
return -ENOMEM;
|
||||
sachip->saved_state = save;
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ static int scoop_probe(struct platform_device *pdev)
|
|||
if (!mem)
|
||||
return -EINVAL;
|
||||
|
||||
devptr = kzalloc(sizeof(struct scoop_dev), GFP_KERNEL);
|
||||
devptr = kzalloc_obj(struct scoop_dev);
|
||||
if (!devptr)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ static int __init init_atags_procfs(void)
|
|||
|
||||
WARN_ON(tag->hdr.tag != ATAG_NONE);
|
||||
|
||||
b = kmalloc(struct_size(b, data, size), GFP_KERNEL);
|
||||
b = kmalloc_flex(*b, data, size);
|
||||
if (!b)
|
||||
goto nomem;
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ static unsigned long get_arch_pgd(pgd_t *pgd)
|
|||
static int secondary_biglittle_prepare(unsigned int cpu)
|
||||
{
|
||||
if (!cpu_vtable[cpu])
|
||||
cpu_vtable[cpu] = kzalloc(sizeof(*cpu_vtable[cpu]), GFP_KERNEL);
|
||||
cpu_vtable[cpu] = kzalloc_obj(*cpu_vtable[cpu]);
|
||||
|
||||
return cpu_vtable[cpu] ? 0 : -ENOMEM;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ asmlinkage long sys_oabi_semtimedop(int semid,
|
|||
return -E2BIG;
|
||||
if (nsops < 1 || nsops > SEMOPM)
|
||||
return -EINVAL;
|
||||
sops = kvmalloc_array(nsops, sizeof(*sops), GFP_KERNEL);
|
||||
sops = kvmalloc_objs(*sops, nsops);
|
||||
if (!sops)
|
||||
return -ENOMEM;
|
||||
err = 0;
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size,
|
|||
unsigned long text_size)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct unwind_table *tab = kmalloc(sizeof(*tab), GFP_KERNEL);
|
||||
struct unwind_table *tab = kmalloc_obj(*tab);
|
||||
|
||||
pr_debug("%s(%08lx, %08lx, %08lx, %08lx)\n", __func__, start, size,
|
||||
text_addr, text_size);
|
||||
|
|
|
|||
|
|
@ -179,8 +179,7 @@ static int __init vdso_init(void)
|
|||
text_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
|
||||
|
||||
/* Allocate the VDSO text pagelist */
|
||||
vdso_text_pagelist = kcalloc(text_pages, sizeof(struct page *),
|
||||
GFP_KERNEL);
|
||||
vdso_text_pagelist = kzalloc_objs(struct page *, text_pages);
|
||||
if (vdso_text_pagelist == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)
|
|||
{
|
||||
struct resource *res;
|
||||
|
||||
res = kcalloc(2, sizeof(struct resource), GFP_KERNEL);
|
||||
res = kzalloc_objs(struct resource, 2);
|
||||
if (!res) {
|
||||
printk("out of memory for root bus resources");
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ static int __init ebsa285_leds_init(void)
|
|||
for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) {
|
||||
struct ebsa285_led *led;
|
||||
|
||||
led = kzalloc(sizeof(*led), GFP_KERNEL);
|
||||
led = kzalloc_obj(*led);
|
||||
if (!led)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -727,7 +727,7 @@ static int __init netwinder_leds_init(void)
|
|||
for (i = 0; i < ARRAY_SIZE(netwinder_leds); i++) {
|
||||
struct netwinder_led *led;
|
||||
|
||||
led = kzalloc(sizeof(*led), GFP_KERNEL);
|
||||
led = kzalloc_obj(*led);
|
||||
if (!led)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
|
|||
char *name;
|
||||
int ret;
|
||||
|
||||
pmu_mmdc = kzalloc(sizeof(*pmu_mmdc), GFP_KERNEL);
|
||||
pmu_mmdc = kzalloc_obj(*pmu_mmdc);
|
||||
if (!pmu_mmdc) {
|
||||
pr_err("failed to allocate PMU device!\n");
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ static void __init i2c_quirk(void)
|
|||
for_each_compatible_node(np, NULL, "marvell,mv78230-i2c") {
|
||||
struct property *new_compat;
|
||||
|
||||
new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
|
||||
new_compat = kzalloc_obj(*new_compat);
|
||||
|
||||
new_compat->name = kstrdup("compatible", GFP_KERNEL);
|
||||
new_compat->length = sizeof("marvell,mv78230-a0-i2c");
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ static void __init armada_375_380_coherency_init(struct device_node *np)
|
|||
for_each_compatible_node(cache_dn, NULL, "arm,pl310-cache") {
|
||||
struct property *p;
|
||||
|
||||
p = kzalloc(sizeof(*p), GFP_KERNEL);
|
||||
p = kzalloc_obj(*p);
|
||||
p->name = kstrdup("arm,io-coherent", GFP_KERNEL);
|
||||
of_add_property(cache_dn, p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ static int __init mvebu_soc_device(void)
|
|||
if (!is_id_valid)
|
||||
return 0;
|
||||
|
||||
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
|
||||
soc_dev_attr = kzalloc_obj(*soc_dev_attr);
|
||||
if (!soc_dev_attr)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ static void __init mxs_machine_init(void)
|
|||
const u32 *ocotp = mxs_get_ocotp();
|
||||
int ret;
|
||||
|
||||
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
|
||||
soc_dev_attr = kzalloc_obj(*soc_dev_attr);
|
||||
if (!soc_dev_attr)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ static int __init omap1_system_dma_init(void)
|
|||
goto exit_iounmap;
|
||||
}
|
||||
|
||||
d = kzalloc(sizeof(*d), GFP_KERNEL);
|
||||
d = kzalloc_obj(*d);
|
||||
if (!d) {
|
||||
ret = -ENOMEM;
|
||||
goto exit_iounmap;
|
||||
|
|
|
|||
|
|
@ -294,8 +294,7 @@ static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
|
|||
{
|
||||
int i;
|
||||
|
||||
omap_mcbsp_devices = kcalloc(size, sizeof(struct platform_device *),
|
||||
GFP_KERNEL);
|
||||
omap_mcbsp_devices = kzalloc_objs(struct platform_device *, size);
|
||||
if (!omap_mcbsp_devices) {
|
||||
printk(KERN_ERR "Could not register McBSP devices\n");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ static int __init omap1_dm_timer_init(void)
|
|||
goto err_free_pdev;
|
||||
}
|
||||
|
||||
pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
|
||||
pdata = kzalloc_obj(*pdata);
|
||||
if (!pdata) {
|
||||
ret = -ENOMEM;
|
||||
goto err_free_pdata;
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ void omap2xxx_clkt_vps_init(void)
|
|||
omap2xxx_clkt_vps_late_init();
|
||||
omap2xxx_clkt_vps_check_bootloader_rates();
|
||||
|
||||
hw = kzalloc(sizeof(*hw), GFP_KERNEL);
|
||||
hw = kzalloc_obj(*hw);
|
||||
if (!hw)
|
||||
return;
|
||||
init.name = "virt_prcm_set";
|
||||
|
|
|
|||
|
|
@ -787,7 +787,7 @@ void __init omap_soc_device_init(void)
|
|||
struct soc_device *soc_dev;
|
||||
struct soc_device_attribute *soc_dev_attr;
|
||||
|
||||
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
|
||||
soc_dev_attr = kzalloc_obj(*soc_dev_attr);
|
||||
if (!soc_dev_attr)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ static struct powerdomain *_get_pwrdm(struct device *dev)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
|
||||
entry = kmalloc_obj(*entry);
|
||||
if (entry) {
|
||||
entry->dev = dev;
|
||||
entry->pwrdm = pwrdm;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
|
|||
!omap_hwmod_parse_module_range(NULL, node, &res))
|
||||
return -ENODEV;
|
||||
|
||||
hwmods = kcalloc(oh_cnt, sizeof(struct omap_hwmod *), GFP_KERNEL);
|
||||
hwmods = kzalloc_objs(struct omap_hwmod *, oh_cnt);
|
||||
if (!hwmods) {
|
||||
ret = -ENOMEM;
|
||||
goto odbfd_exit;
|
||||
|
|
@ -309,7 +309,7 @@ static struct omap_device *omap_device_alloc(struct platform_device *pdev,
|
|||
int i;
|
||||
struct omap_hwmod **hwmods;
|
||||
|
||||
od = kzalloc(sizeof(struct omap_device), GFP_KERNEL);
|
||||
od = kzalloc_obj(struct omap_device);
|
||||
if (!od)
|
||||
goto oda_exit1;
|
||||
|
||||
|
|
|
|||
|
|
@ -3392,7 +3392,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh,
|
|||
void __iomem *regs = NULL;
|
||||
unsigned long flags;
|
||||
|
||||
sysc = kzalloc(sizeof(*sysc), GFP_KERNEL);
|
||||
sysc = kzalloc_obj(*sysc);
|
||||
if (!sysc)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -3422,7 +3422,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh,
|
|||
}
|
||||
|
||||
if (list_empty(&oh->slave_ports)) {
|
||||
oi = kzalloc(sizeof(*oi), GFP_KERNEL);
|
||||
oi = kzalloc_obj(*oi);
|
||||
if (!oi)
|
||||
goto out_free_class;
|
||||
|
||||
|
|
@ -3525,7 +3525,7 @@ int omap_hwmod_init_module(struct device *dev,
|
|||
|
||||
oh = _lookup(data->name);
|
||||
if (!oh) {
|
||||
oh = kzalloc(sizeof(*oh), GFP_KERNEL);
|
||||
oh = kzalloc_obj(*oh);
|
||||
if (!oh)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -3536,7 +3536,7 @@ int omap_hwmod_init_module(struct device *dev,
|
|||
/* Unused, can be handled by PRM driver handling resets */
|
||||
oh->prcm.omap4.flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT;
|
||||
|
||||
oh->class = kzalloc(sizeof(*oh->class), GFP_KERNEL);
|
||||
oh->class = kzalloc_obj(*oh->class);
|
||||
if (!oh->class) {
|
||||
kfree(oh);
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ static int __init amx3_idle_init(struct device_node *cpu_node, int cpu)
|
|||
state_count++;
|
||||
}
|
||||
|
||||
idle_states = kcalloc(state_count, sizeof(*idle_states), GFP_KERNEL);
|
||||
idle_states = kzalloc_objs(*idle_states, state_count);
|
||||
if (!idle_states)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
|
|||
if (!pwrdm->pwrsts)
|
||||
return 0;
|
||||
|
||||
pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC);
|
||||
pwrst = kmalloc_obj(struct power_state, GFP_ATOMIC);
|
||||
if (!pwrst)
|
||||
return -ENOMEM;
|
||||
pwrst->pwrdm = pwrdm;
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
|
|||
!strncmp(pwrdm->name, "l4per", 5))
|
||||
pwrdm_set_logic_retst(pwrdm, PWRDM_POWER_OFF);
|
||||
|
||||
pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC);
|
||||
pwrst = kmalloc_obj(struct power_state, GFP_ATOMIC);
|
||||
if (!pwrst)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
|
|||
while (volt_data[count].volt_nominal)
|
||||
count++;
|
||||
|
||||
nvalue_table = kcalloc(count, sizeof(*nvalue_table), GFP_KERNEL);
|
||||
nvalue_table = kzalloc_objs(*nvalue_table, count);
|
||||
if (!nvalue_table)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ static int __init pcie_setup(struct pci_sys_data *sys)
|
|||
/*
|
||||
* Request resources.
|
||||
*/
|
||||
res = kzalloc(sizeof(struct resource), GFP_KERNEL);
|
||||
res = kzalloc_obj(struct resource);
|
||||
if (!res)
|
||||
panic("pcie_setup unable to alloc resources");
|
||||
|
||||
|
|
@ -490,7 +490,7 @@ static int __init pci_setup(struct pci_sys_data *sys)
|
|||
/*
|
||||
* Request resources
|
||||
*/
|
||||
res = kzalloc(sizeof(struct resource), GFP_KERNEL);
|
||||
res = kzalloc_obj(struct resource);
|
||||
if (!res)
|
||||
panic("pci_setup unable to alloc resources");
|
||||
|
||||
|
|
|
|||
|
|
@ -692,7 +692,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
|
|||
unsigned long base;
|
||||
int i;
|
||||
|
||||
ec = kzalloc(sizeof(ecard_t), GFP_KERNEL);
|
||||
ec = kzalloc_obj(ecard_t);
|
||||
if (!ec) {
|
||||
ec = ERR_PTR(-ENOMEM);
|
||||
goto nomem;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ int __init sa11xx_clk_init(void)
|
|||
|
||||
clk_hw_register_clkdev(hw, "OSTIMER0", NULL);
|
||||
|
||||
hw = kzalloc(sizeof(*hw), GFP_KERNEL);
|
||||
hw = kzalloc_obj(*hw);
|
||||
if (!hw)
|
||||
return -ENOMEM;
|
||||
hw->init = &clk_mpll_init_data;
|
||||
|
|
@ -129,7 +129,7 @@ int __init sa11xx_clk_init(void)
|
|||
FAlnMsk(TUCR_TSEL), 0, &tucr_lock);
|
||||
clk_set_rate(hw->clk, 3686400);
|
||||
|
||||
hw = kzalloc(sizeof(*hw), GFP_KERNEL);
|
||||
hw = kzalloc_obj(*hw);
|
||||
if (!hw)
|
||||
return -ENOMEM;
|
||||
hw->init = &clk_gpio27_init_data;
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ int __init sa11x0_register_fixed_regulator(int n,
|
|||
{
|
||||
struct regulator_init_data *id;
|
||||
|
||||
cfg->init_data = id = kzalloc(sizeof(*cfg->init_data), GFP_KERNEL);
|
||||
cfg->init_data = id = kzalloc_obj(*cfg->init_data);
|
||||
if (!cfg->init_data)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ static int neponset_probe(struct platform_device *dev)
|
|||
goto err_alloc;
|
||||
}
|
||||
|
||||
d = kzalloc(sizeof(*d), GFP_KERNEL);
|
||||
d = kzalloc_obj(*d);
|
||||
if (!d) {
|
||||
ret = -ENOMEM;
|
||||
goto err_alloc;
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ static int __init rcar_gen2_regulator_quirk(void)
|
|||
if (ret) /* Skip invalid entry and continue */
|
||||
continue;
|
||||
|
||||
quirk = kzalloc(sizeof(*quirk), GFP_KERNEL);
|
||||
quirk = kzalloc_obj(*quirk);
|
||||
if (!quirk) {
|
||||
ret = -ENOMEM;
|
||||
of_node_put(np);
|
||||
|
|
|
|||
|
|
@ -395,7 +395,7 @@ static int ve_spc_populate_opps(uint32_t cluster)
|
|||
uint32_t data = 0, off, ret, idx;
|
||||
struct ve_spc_opp *opps;
|
||||
|
||||
opps = kcalloc(MAX_OPPS, sizeof(*opps), GFP_KERNEL);
|
||||
opps = kzalloc_objs(*opps, MAX_OPPS);
|
||||
if (!opps)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -442,7 +442,7 @@ static int ve_init_opp_table(struct device *cpu_dev)
|
|||
int __init ve_spc_init(void __iomem *baseaddr, u32 a15_clusid, int irq)
|
||||
{
|
||||
int ret;
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
info = kzalloc_obj(*info);
|
||||
if (!info)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -525,7 +525,7 @@ static struct clk *ve_spc_clk_register(struct device *cpu_dev)
|
|||
struct clk_init_data init;
|
||||
struct clk_spc *spc;
|
||||
|
||||
spc = kzalloc(sizeof(*spc), GFP_KERNEL);
|
||||
spc = kzalloc_obj(*spc);
|
||||
if (!spc)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ static void __init versatile_dt_pci_init(void)
|
|||
goto out_put_node;
|
||||
}
|
||||
|
||||
newprop = kzalloc(sizeof(*newprop), GFP_KERNEL);
|
||||
newprop = kzalloc_obj(*newprop);
|
||||
if (!newprop)
|
||||
goto out_put_node;
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ static void __init zynq_init_machine(void)
|
|||
struct soc_device *soc_dev;
|
||||
struct device *parent = NULL;
|
||||
|
||||
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
|
||||
soc_dev_attr = kzalloc_obj(*soc_dev_attr);
|
||||
if (!soc_dev_attr)
|
||||
goto out;
|
||||
|
||||
|
|
|
|||
|
|
@ -507,7 +507,7 @@ static __init int l2x0_pmu_init(void)
|
|||
if (!l2x0_base)
|
||||
return 0;
|
||||
|
||||
l2x0_pmu = kzalloc(sizeof(*l2x0_pmu), GFP_KERNEL);
|
||||
l2x0_pmu = kzalloc_obj(*l2x0_pmu);
|
||||
if (!l2x0_pmu) {
|
||||
pr_warn("Unable to allocate L2x0 PMU\n");
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ static int __init __uniphier_cache_init(struct device_node *np,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
||||
data = kzalloc_obj(*data);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -558,8 +558,8 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
|
|||
}
|
||||
#endif
|
||||
|
||||
buf = kzalloc(sizeof(*buf),
|
||||
gfp & ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM));
|
||||
buf = kzalloc_obj(*buf,
|
||||
gfp & ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM));
|
||||
if (!buf)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -1504,7 +1504,7 @@ arm_iommu_create_mapping(struct device *dev, dma_addr_t base, u64 size)
|
|||
bitmap_size = PAGE_SIZE;
|
||||
}
|
||||
|
||||
mapping = kzalloc(sizeof(struct dma_iommu_mapping), GFP_KERNEL);
|
||||
mapping = kzalloc_obj(struct dma_iommu_mapping);
|
||||
if (!mapping)
|
||||
goto err;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include "mm.h"
|
||||
|
||||
#ifdef CONFIG_ARM_LPAE
|
||||
#define _pgd_alloc(mm) kmalloc_array(PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL | __GFP_ZERO)
|
||||
#define _pgd_alloc(mm) kmalloc_objs(pgd_t, PTRS_PER_PGD, GFP_KERNEL | __GFP_ZERO)
|
||||
#define _pgd_free(mm, pgd) kfree(pgd)
|
||||
#else
|
||||
#define _pgd_alloc(mm) __pgd_alloc(mm, 2)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ static inline bool __virt_addr_valid(unsigned long x)
|
|||
phys_addr_t __virt_to_phys(unsigned long x)
|
||||
{
|
||||
WARN(!__virt_addr_valid(x),
|
||||
"virt_to_phys used for non-linear address: %pK (%pS)\n",
|
||||
"virt_to_phys used for non-linear address: %px (%pS)\n",
|
||||
(void *)x, (void *)x);
|
||||
|
||||
return __virt_to_phys_nodebug(x);
|
||||
|
|
|
|||
|
|
@ -763,9 +763,8 @@ static int coverage_start_fn(const struct decode_header *h, void *args)
|
|||
|
||||
static int coverage_start(const union decode_item *table)
|
||||
{
|
||||
coverage.base = kmalloc_array(MAX_COVERAGE_ENTRIES,
|
||||
sizeof(struct coverage_entry),
|
||||
GFP_KERNEL);
|
||||
coverage.base = kmalloc_objs(struct coverage_entry,
|
||||
MAX_COVERAGE_ENTRIES);
|
||||
coverage.num_entries = 0;
|
||||
coverage.nesting = 0;
|
||||
return table_iter(table, coverage_start_fn, &coverage);
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ int __init arch_xen_unpopulated_init(struct resource **res)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
regs = kcalloc(nr_reg, sizeof(*regs), GFP_KERNEL);
|
||||
regs = kzalloc_objs(*regs, nr_reg);
|
||||
if (!regs) {
|
||||
of_node_put(np);
|
||||
return -ENOMEM;
|
||||
|
|
@ -383,7 +383,7 @@ int __init arch_xen_unpopulated_init(struct resource **res)
|
|||
start = regs[i - 1].end + 1;
|
||||
end = regs[i].start - 1;
|
||||
|
||||
tmp_res = kzalloc(sizeof(*tmp_res), GFP_KERNEL);
|
||||
tmp_res = kzalloc_obj(*tmp_res);
|
||||
if (!tmp_res) {
|
||||
rc = -ENOMEM;
|
||||
goto err;
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ bool __set_phys_to_machine_multi(unsigned long pfn,
|
|||
return true;
|
||||
}
|
||||
|
||||
p2m_entry = kzalloc(sizeof(*p2m_entry), GFP_NOWAIT);
|
||||
p2m_entry = kzalloc_obj(*p2m_entry, GFP_NOWAIT);
|
||||
if (!p2m_entry)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -144,8 +144,6 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t phys)
|
|||
__pte(__phys_to_pte_val((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
|
||||
|
||||
#define pte_none(pte) (!pte_val(pte))
|
||||
#define __pte_clear(mm, addr, ptep) \
|
||||
__set_pte(ptep, __pte(0))
|
||||
#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
|
||||
|
||||
/*
|
||||
|
|
@ -1284,6 +1282,13 @@ static inline bool pud_user_accessible_page(pud_t pud, unsigned long addr)
|
|||
/*
|
||||
* Atomic pte/pmd modifications.
|
||||
*/
|
||||
|
||||
static inline void __pte_clear(struct mm_struct *mm,
|
||||
unsigned long addr, pte_t *ptep)
|
||||
{
|
||||
__set_pte(ptep, __pte(0));
|
||||
}
|
||||
|
||||
static inline int __ptep_test_and_clear_young(struct vm_area_struct *vma,
|
||||
unsigned long address,
|
||||
pte_t *ptep)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
|
|||
for_each_mem_range(i, &start, &end)
|
||||
nr_ranges++;
|
||||
|
||||
cmem = kmalloc(struct_size(cmem, ranges, nr_ranges), GFP_KERNEL);
|
||||
cmem = kmalloc_flex(*cmem, ranges, nr_ranges);
|
||||
if (!cmem)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -81,9 +81,7 @@ static int __init __vdso_init(enum vdso_abi abi)
|
|||
vdso_info[abi].vdso_code_start) >>
|
||||
PAGE_SHIFT;
|
||||
|
||||
vdso_pagelist = kcalloc(vdso_info[abi].vdso_pages,
|
||||
sizeof(struct page *),
|
||||
GFP_KERNEL);
|
||||
vdso_pagelist = kzalloc_objs(struct page *, vdso_info[abi].vdso_pages);
|
||||
if (vdso_pagelist == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -854,8 +854,8 @@ static void kvm_init_mpidr_data(struct kvm *kvm)
|
|||
* iterative method. Single vcpu VMs do not need this either.
|
||||
*/
|
||||
if (struct_size(data, cmpidr_to_idx, nr_entries) <= PAGE_SIZE)
|
||||
data = kzalloc(struct_size(data, cmpidr_to_idx, nr_entries),
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
data = kzalloc_flex(*data, cmpidr_to_idx, nr_entries,
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
|
||||
if (!data)
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ static int share_pfn_hyp(u64 pfn)
|
|||
goto unlock;
|
||||
}
|
||||
|
||||
this = kzalloc(sizeof(*this), GFP_KERNEL);
|
||||
this = kzalloc_obj(*this);
|
||||
if (!this) {
|
||||
ret = -ENOMEM;
|
||||
goto unlock;
|
||||
|
|
@ -978,7 +978,7 @@ int kvm_init_stage2_mmu(struct kvm *kvm, struct kvm_s2_mmu *mmu, unsigned long t
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
pgt = kzalloc(sizeof(*pgt), GFP_KERNEL_ACCOUNT);
|
||||
pgt = kzalloc_obj(*pgt, GFP_KERNEL_ACCOUNT);
|
||||
if (!pgt)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1155,7 +1155,8 @@ int topup_hyp_memcache(struct kvm_hyp_memcache *mc, unsigned long min_pages)
|
|||
return 0;
|
||||
|
||||
if (!mc->mapping) {
|
||||
mc->mapping = kzalloc(sizeof(struct pkvm_mapping), GFP_KERNEL_ACCOUNT);
|
||||
mc->mapping = kzalloc_obj(struct pkvm_mapping,
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
if (!mc->mapping)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
@ -2328,7 +2329,7 @@ int __init kvm_mmu_init(u32 hyp_va_bits)
|
|||
goto out;
|
||||
}
|
||||
|
||||
hyp_pgtable = kzalloc(sizeof(*hyp_pgtable), GFP_KERNEL);
|
||||
hyp_pgtable = kzalloc_obj(*hyp_pgtable);
|
||||
if (!hyp_pgtable) {
|
||||
kvm_err("Hyp mode page-table not allocated\n");
|
||||
err = -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -1215,8 +1215,8 @@ int kvm_vcpu_allocate_vncr_tlb(struct kvm_vcpu *vcpu)
|
|||
if (!kvm_has_feat(vcpu->kvm, ID_AA64MMFR4_EL1, NV_frac, NV2_ONLY))
|
||||
return 0;
|
||||
|
||||
vcpu->arch.vncr_tlb = kzalloc(sizeof(*vcpu->arch.vncr_tlb),
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
vcpu->arch.vncr_tlb = kzalloc_obj(*vcpu->arch.vncr_tlb,
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
if (!vcpu->arch.vncr_tlb)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1704,8 +1704,8 @@ int kvm_init_nv_sysregs(struct kvm_vcpu *vcpu)
|
|||
if (kvm->arch.sysreg_masks)
|
||||
goto out;
|
||||
|
||||
kvm->arch.sysreg_masks = kzalloc(sizeof(*(kvm->arch.sysreg_masks)),
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
kvm->arch.sysreg_masks = kzalloc_obj(*(kvm->arch.sysreg_masks),
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
if (!kvm->arch.sysreg_masks)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -797,7 +797,7 @@ void kvm_host_pmu_init(struct arm_pmu *pmu)
|
|||
|
||||
guard(mutex)(&arm_pmus_lock);
|
||||
|
||||
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
|
||||
entry = kmalloc_obj(*entry);
|
||||
if (!entry)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ static struct kvm_ptdump_guest_state *kvm_ptdump_parser_create(struct kvm *kvm)
|
|||
struct kvm_pgtable *pgtable = mmu->pgt;
|
||||
int ret;
|
||||
|
||||
st = kzalloc(sizeof(struct kvm_ptdump_guest_state), GFP_KERNEL_ACCOUNT);
|
||||
st = kzalloc_obj(struct kvm_ptdump_guest_state, GFP_KERNEL_ACCOUNT);
|
||||
if (!st)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ static void *vgic_debug_start(struct seq_file *s, loff_t *pos)
|
|||
struct kvm *kvm = s->private;
|
||||
struct vgic_state_iter *iter;
|
||||
|
||||
iter = kmalloc(sizeof(*iter), GFP_KERNEL);
|
||||
iter = kmalloc_obj(*iter);
|
||||
if (!iter)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -375,7 +375,7 @@ static void *vgic_its_debug_start(struct seq_file *s, loff_t *pos)
|
|||
if (!dev)
|
||||
return NULL;
|
||||
|
||||
iter = kmalloc(sizeof(*iter), GFP_KERNEL);
|
||||
iter = kmalloc_obj(*iter);
|
||||
if (!iter)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ static int kvm_vgic_dist_init(struct kvm *kvm, unsigned int nr_spis)
|
|||
int i;
|
||||
|
||||
dist->active_spis = (atomic_t)ATOMIC_INIT(0);
|
||||
dist->spis = kcalloc(nr_spis, sizeof(struct vgic_irq), GFP_KERNEL_ACCOUNT);
|
||||
dist->spis = kzalloc_objs(struct vgic_irq, nr_spis, GFP_KERNEL_ACCOUNT);
|
||||
if (!dist->spis)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -269,9 +269,9 @@ static int vgic_allocate_private_irqs_locked(struct kvm_vcpu *vcpu, u32 type)
|
|||
if (vgic_cpu->private_irqs)
|
||||
return 0;
|
||||
|
||||
vgic_cpu->private_irqs = kcalloc(VGIC_NR_PRIVATE_IRQS,
|
||||
sizeof(struct vgic_irq),
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
vgic_cpu->private_irqs = kzalloc_objs(struct vgic_irq,
|
||||
VGIC_NR_PRIVATE_IRQS,
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
|
||||
if (!vgic_cpu->private_irqs)
|
||||
return -ENOMEM;
|
||||
|
|
@ -654,7 +654,7 @@ static struct gic_kvm_info *gic_kvm_info;
|
|||
void __init vgic_set_kvm_info(const struct gic_kvm_info *info)
|
||||
{
|
||||
BUG_ON(gic_kvm_info != NULL);
|
||||
gic_kvm_info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||
gic_kvm_info = kmalloc_obj(*gic_kvm_info);
|
||||
if (gic_kvm_info)
|
||||
*gic_kvm_info = *info;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ int kvm_vgic_setup_default_irq_routing(struct kvm *kvm)
|
|||
u32 nr = dist->nr_spis;
|
||||
int i, ret;
|
||||
|
||||
entries = kcalloc(nr, sizeof(*entries), GFP_KERNEL_ACCOUNT);
|
||||
entries = kzalloc_objs(*entries, nr, GFP_KERNEL_ACCOUNT);
|
||||
if (!entries)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ static struct vgic_irq *vgic_add_lpi(struct kvm *kvm, u32 intid,
|
|||
if (irq)
|
||||
return irq;
|
||||
|
||||
irq = kzalloc(sizeof(struct vgic_irq), GFP_KERNEL_ACCOUNT);
|
||||
irq = kzalloc_obj(struct vgic_irq, GFP_KERNEL_ACCOUNT);
|
||||
if (!irq)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -960,7 +960,7 @@ static int vgic_its_alloc_collection(struct vgic_its *its,
|
|||
{
|
||||
struct its_collection *collection;
|
||||
|
||||
collection = kzalloc(sizeof(*collection), GFP_KERNEL_ACCOUNT);
|
||||
collection = kzalloc_obj(*collection, GFP_KERNEL_ACCOUNT);
|
||||
if (!collection)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1004,7 +1004,7 @@ static struct its_ite *vgic_its_alloc_ite(struct its_device *device,
|
|||
{
|
||||
struct its_ite *ite;
|
||||
|
||||
ite = kzalloc(sizeof(*ite), GFP_KERNEL_ACCOUNT);
|
||||
ite = kzalloc_obj(*ite, GFP_KERNEL_ACCOUNT);
|
||||
if (!ite)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -1131,7 +1131,7 @@ static struct its_device *vgic_its_alloc_device(struct vgic_its *its,
|
|||
{
|
||||
struct its_device *device;
|
||||
|
||||
device = kzalloc(sizeof(*device), GFP_KERNEL_ACCOUNT);
|
||||
device = kzalloc_obj(*device, GFP_KERNEL_ACCOUNT);
|
||||
if (!device)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -1846,7 +1846,7 @@ static int vgic_its_create(struct kvm_device *dev, u32 type)
|
|||
if (type != KVM_DEV_TYPE_ARM_VGIC_ITS)
|
||||
return -ENODEV;
|
||||
|
||||
its = kzalloc(sizeof(struct vgic_its), GFP_KERNEL_ACCOUNT);
|
||||
its = kzalloc_obj(struct vgic_its, GFP_KERNEL_ACCOUNT);
|
||||
if (!its)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -929,7 +929,7 @@ static int vgic_v3_alloc_redist_region(struct kvm *kvm, uint32_t index,
|
|||
if (vgic_v3_rdist_overlap(kvm, base, size))
|
||||
return -EINVAL;
|
||||
|
||||
rdreg = kzalloc(sizeof(*rdreg), GFP_KERNEL_ACCOUNT);
|
||||
rdreg = kzalloc_obj(*rdreg, GFP_KERNEL_ACCOUNT);
|
||||
if (!rdreg)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -256,8 +256,8 @@ int vgic_v4_init(struct kvm *kvm)
|
|||
|
||||
nr_vcpus = atomic_read(&kvm->online_vcpus);
|
||||
|
||||
dist->its_vm.vpes = kcalloc(nr_vcpus, sizeof(*dist->its_vm.vpes),
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
dist->its_vm.vpes = kzalloc_objs(*dist->its_vm.vpes, nr_vcpus,
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
if (!dist->its_vm.vpes)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,9 +23,20 @@ static inline unsigned long xloops_to_cycles(unsigned long xloops)
|
|||
return (xloops * loops_per_jiffy * HZ) >> 32;
|
||||
}
|
||||
|
||||
/*
|
||||
* Force the use of CNTVCT_EL0 in order to have the same base as WFxT.
|
||||
* This avoids some annoying issues when CNTVOFF_EL2 is not reset 0 on a
|
||||
* KVM host running at EL1 until we do a vcpu_put() on the vcpu. When
|
||||
* running at EL2, the effective offset is always 0.
|
||||
*
|
||||
* Note that userspace cannot change the offset behind our back either,
|
||||
* as the vcpu mutex is held as long as KVM_RUN is in progress.
|
||||
*/
|
||||
#define __delay_cycles() __arch_counter_get_cntvct_stable()
|
||||
|
||||
void __delay(unsigned long cycles)
|
||||
{
|
||||
cycles_t start = get_cycles();
|
||||
cycles_t start = __delay_cycles();
|
||||
|
||||
if (alternative_has_cap_unlikely(ARM64_HAS_WFXT)) {
|
||||
u64 end = start + cycles;
|
||||
|
|
@ -35,17 +46,17 @@ void __delay(unsigned long cycles)
|
|||
* early, use a WFET loop to complete the delay.
|
||||
*/
|
||||
wfit(end);
|
||||
while ((get_cycles() - start) < cycles)
|
||||
while ((__delay_cycles() - start) < cycles)
|
||||
wfet(end);
|
||||
} else if (arch_timer_evtstrm_available()) {
|
||||
const cycles_t timer_evt_period =
|
||||
USECS_TO_CYCLES(ARCH_TIMER_EVT_STREAM_PERIOD_US);
|
||||
|
||||
while ((get_cycles() - start + timer_evt_period) < cycles)
|
||||
while ((__delay_cycles() - start + timer_evt_period) < cycles)
|
||||
wfe();
|
||||
}
|
||||
|
||||
while ((get_cycles() - start) < cycles)
|
||||
while ((__delay_cycles() - start) < cycles)
|
||||
cpu_relax();
|
||||
}
|
||||
EXPORT_SYMBOL(__delay);
|
||||
|
|
|
|||
|
|
@ -2040,7 +2040,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
|||
|
||||
jit_data = prog->aux->jit_data;
|
||||
if (!jit_data) {
|
||||
jit_data = kzalloc(sizeof(*jit_data), GFP_KERNEL);
|
||||
jit_data = kzalloc_obj(*jit_data);
|
||||
if (!jit_data) {
|
||||
prog = orig_prog;
|
||||
goto out;
|
||||
|
|
@ -2078,7 +2078,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
|||
memset(&ctx, 0, sizeof(ctx));
|
||||
ctx.prog = prog;
|
||||
|
||||
ctx.offset = kvcalloc(prog->len + 1, sizeof(int), GFP_KERNEL);
|
||||
ctx.offset = kvzalloc_objs(int, prog->len + 1);
|
||||
if (ctx.offset == NULL) {
|
||||
prog = orig_prog;
|
||||
goto out_off;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ static int __init vdso_init(void)
|
|||
|
||||
vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
|
||||
vdso_pagelist =
|
||||
kcalloc(vdso_pages, sizeof(struct page *), GFP_KERNEL);
|
||||
kzalloc_objs(struct page *, vdso_pages);
|
||||
if (unlikely(vdso_pagelist == NULL)) {
|
||||
pr_err("vdso: pagelist allocation failed\n");
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
|
|||
for_each_mem_range(i, &start, &end)
|
||||
nr_ranges++;
|
||||
|
||||
cmem = kmalloc(struct_size(cmem, ranges, nr_ranges), GFP_KERNEL);
|
||||
cmem = kmalloc_flex(*cmem, ranges, nr_ranges);
|
||||
if (!cmem)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ static int __init add_legacy_isa_io(struct fwnode_handle *fwnode,
|
|||
unsigned long vaddr;
|
||||
struct logic_pio_hwaddr *range;
|
||||
|
||||
range = kzalloc(sizeof(*range), GFP_ATOMIC);
|
||||
range = kzalloc_obj(*range, GFP_ATOMIC);
|
||||
if (!range)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static int __init init_vdso(void)
|
|||
|
||||
vdso_info.size = PAGE_ALIGN(vdso_end - vdso_start);
|
||||
vdso_info.code_mapping.pages =
|
||||
kcalloc(vdso_info.size / PAGE_SIZE, sizeof(struct page *), GFP_KERNEL);
|
||||
kzalloc_objs(struct page *, vdso_info.size / PAGE_SIZE);
|
||||
|
||||
if (!vdso_info.code_mapping.pages)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -622,7 +622,7 @@ static int kvm_eiointc_create(struct kvm_device *dev, u32 type)
|
|||
if (kvm->arch.eiointc)
|
||||
return -EINVAL;
|
||||
|
||||
s = kzalloc(sizeof(struct loongarch_eiointc), GFP_KERNEL);
|
||||
s = kzalloc_obj(struct loongarch_eiointc);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ static int kvm_ipi_create(struct kvm_device *dev, u32 type)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
s = kzalloc(sizeof(struct loongarch_ipi), GFP_KERNEL);
|
||||
s = kzalloc_obj(struct loongarch_ipi);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ static int kvm_setup_default_irq_routing(struct kvm *kvm)
|
|||
u32 nr = KVM_IRQCHIP_NUM_PINS;
|
||||
struct kvm_irq_routing_entry *entries;
|
||||
|
||||
entries = kcalloc(nr, sizeof(*entries), GFP_KERNEL);
|
||||
entries = kzalloc_objs(*entries, nr);
|
||||
if (!entries)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -432,7 +432,7 @@ static int kvm_pch_pic_create(struct kvm_device *dev, u32 type)
|
|||
if (ret)
|
||||
return -ENOMEM;
|
||||
|
||||
s = kzalloc(sizeof(struct loongarch_pch_pic), GFP_KERNEL);
|
||||
s = kzalloc_obj(struct loongarch_pch_pic);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ static int kvm_loongarch_env_init(void)
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
kvm_loongarch_ops = kzalloc(sizeof(*kvm_loongarch_ops), GFP_KERNEL);
|
||||
kvm_loongarch_ops = kzalloc_obj(*kvm_loongarch_ops);
|
||||
if (!kvm_loongarch_ops) {
|
||||
free_percpu(vmcs);
|
||||
vmcs = NULL;
|
||||
|
|
|
|||
|
|
@ -1547,7 +1547,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
|
|||
|
||||
vcpu->arch.handle_exit = kvm_handle_exit;
|
||||
vcpu->arch.guest_eentry = (unsigned long)kvm_loongarch_ops->exc_entry;
|
||||
vcpu->arch.csr = kzalloc(sizeof(struct loongarch_csrs), GFP_KERNEL);
|
||||
vcpu->arch.csr = kzalloc_obj(struct loongarch_csrs);
|
||||
if (!vcpu->arch.csr)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
|
|||
if (!kvm->arch.pgd)
|
||||
return -ENOMEM;
|
||||
|
||||
kvm->arch.phyid_map = kvzalloc(sizeof(struct kvm_phyid_map), GFP_KERNEL_ACCOUNT);
|
||||
kvm->arch.phyid_map = kvzalloc_obj(struct kvm_phyid_map,
|
||||
GFP_KERNEL_ACCOUNT);
|
||||
if (!kvm->arch.phyid_map) {
|
||||
free_page((unsigned long)kvm->arch.pgd);
|
||||
kvm->arch.pgd = NULL;
|
||||
|
|
|
|||
|
|
@ -1943,7 +1943,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
|||
|
||||
jit_data = prog->aux->jit_data;
|
||||
if (!jit_data) {
|
||||
jit_data = kzalloc(sizeof(*jit_data), GFP_KERNEL);
|
||||
jit_data = kzalloc_obj(*jit_data);
|
||||
if (!jit_data) {
|
||||
prog = orig_prog;
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ static struct pci_config_window *arch_pci_ecam_create(struct device *dev,
|
|||
if (busr->start > busr->end)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
|
||||
cfg = kzalloc_obj(*cfg);
|
||||
if (!cfg)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -199,13 +199,13 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
|
|||
int domain = root->segment;
|
||||
int busnum = root->secondary.start;
|
||||
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
info = kzalloc_obj(*info);
|
||||
if (!info) {
|
||||
pr_warn("pci_bus %04x:%02x: ignored (out of memory)\n", domain, busnum);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
root_ops = kzalloc(sizeof(*root_ops), GFP_KERNEL);
|
||||
root_ops = kzalloc_obj(*root_ops);
|
||||
if (!root_ops) {
|
||||
kfree(info);
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ void *amiga_chip_alloc(unsigned long size, const char *name)
|
|||
struct resource *res;
|
||||
void *p;
|
||||
|
||||
res = kzalloc(sizeof(struct resource), GFP_KERNEL);
|
||||
res = kzalloc_obj(struct resource);
|
||||
if (!res)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ void *atari_stram_alloc(unsigned long size, const char *owner)
|
|||
/* round up */
|
||||
size = PAGE_ALIGN(size);
|
||||
|
||||
res = kzalloc(sizeof(struct resource), GFP_KERNEL);
|
||||
res = kzalloc_obj(struct resource);
|
||||
if (!res)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
dev = kmalloc(sizeof(struct nfhd_device), GFP_KERNEL);
|
||||
dev = kmalloc_obj(struct nfhd_device);
|
||||
if (!dev)
|
||||
goto out;
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ static struct vm_struct *get_io_area(unsigned long size)
|
|||
unsigned long addr;
|
||||
struct vm_struct **p, *tmp, *area;
|
||||
|
||||
area = kmalloc(sizeof(*area), GFP_KERNEL);
|
||||
area = kmalloc_obj(*area);
|
||||
if (!area)
|
||||
return NULL;
|
||||
addr = KMAP_START;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ static struct clk __init *alchemy_clk_setup_cpu(const char *parent_name,
|
|||
struct clk_hw *h;
|
||||
struct clk *clk;
|
||||
|
||||
h = kzalloc(sizeof(*h), GFP_KERNEL);
|
||||
h = kzalloc_obj(*h);
|
||||
if (!h)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -249,7 +249,7 @@ static struct clk __init *alchemy_clk_setup_aux(const char *parent_name,
|
|||
struct clk *c;
|
||||
struct alchemy_auxpll_clk *a;
|
||||
|
||||
a = kzalloc(sizeof(*a), GFP_KERNEL);
|
||||
a = kzalloc_obj(*a);
|
||||
if (!a)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -775,7 +775,7 @@ static int __init alchemy_clk_init_fgens(int ctype)
|
|||
}
|
||||
id.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE;
|
||||
|
||||
a = kcalloc(6, sizeof(*a), GFP_KERNEL);
|
||||
a = kzalloc_objs(*a, 6);
|
||||
if (!a)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -996,7 +996,7 @@ static int __init alchemy_clk_setup_imux(int ctype)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
a = kcalloc(6, sizeof(*a), GFP_KERNEL);
|
||||
a = kzalloc_objs(*a, 6);
|
||||
if (!a)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid,
|
|||
* If kmalloc fails, it is caught below same
|
||||
* as a channel not available.
|
||||
*/
|
||||
ctp = kmalloc(sizeof(chan_tab_t), GFP_ATOMIC);
|
||||
ctp = kmalloc_obj(chan_tab_t, GFP_ATOMIC);
|
||||
chan_tab_ptr[i] = ctp;
|
||||
break;
|
||||
}
|
||||
|
|
@ -412,8 +412,8 @@ u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
|
|||
* and if we try that first we are likely to not waste larger
|
||||
* slabs of memory.
|
||||
*/
|
||||
desc_base = (u32)kmalloc_array(entries, sizeof(au1x_ddma_desc_t),
|
||||
GFP_KERNEL|GFP_DMA);
|
||||
desc_base = (u32) kmalloc_objs(au1x_ddma_desc_t, entries,
|
||||
GFP_KERNEL | GFP_DMA);
|
||||
if (desc_base == 0)
|
||||
return 0;
|
||||
|
||||
|
|
@ -1057,7 +1057,7 @@ static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable)
|
|||
{
|
||||
int ret;
|
||||
|
||||
dbdev_tab = kcalloc(DBDEV_TAB_SIZE, sizeof(dbdev_tab_t), GFP_KERNEL);
|
||||
dbdev_tab = kzalloc_objs(dbdev_tab_t, DBDEV_TAB_SIZE);
|
||||
if (!dbdev_tab)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -202,10 +202,10 @@ static unsigned long alchemy_ehci_data[][2] __initdata = {
|
|||
|
||||
static int __init _new_usbres(struct resource **r, struct platform_device **d)
|
||||
{
|
||||
*r = kcalloc(2, sizeof(struct resource), GFP_KERNEL);
|
||||
*r = kzalloc_objs(struct resource, 2);
|
||||
if (!*r)
|
||||
return -ENOMEM;
|
||||
*d = kzalloc(sizeof(struct platform_device), GFP_KERNEL);
|
||||
*d = kzalloc_obj(struct platform_device);
|
||||
if (!*d) {
|
||||
kfree(*r);
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user