Commit 32a92f8c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Convert more 'alloc_obj' cases to default GFP_KERNEL arguments



This converts some of the visually simpler cases that have been split
over multiple lines.  I only did the ones that are easy to verify the
resulting diff by having just that final GFP_KERNEL argument on the next
line.

Somebody should probably do a proper coccinelle script for this, but for
me the trivial script actually resulted in an assertion failure in the
middle of the script.  I probably had made it a bit _too_ trivial.

So after fighting that far a while I decided to just do some of the
syntactically simpler cases with variations of the previous 'sed'
scripts.

The more syntactically complex multi-line cases would mostly really want
whitespace cleanup anyway.

Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 323bbfcf
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -294,8 +294,7 @@ static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
{
	int i;

	omap_mcbsp_devices = kzalloc_objs(struct platform_device *, size,
					  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;
+1 −2
Original line number Diff line number Diff line
@@ -81,8 +81,7 @@ static int __init __vdso_init(enum vdso_abi abi)
			vdso_info[abi].vdso_code_start) >>
			PAGE_SHIFT;

	vdso_pagelist = kzalloc_objs(struct page *, vdso_info[abi].vdso_pages,
				     GFP_KERNEL);
	vdso_pagelist = kzalloc_objs(struct page *, vdso_info[abi].vdso_pages);
	if (vdso_pagelist == NULL)
		return -ENOMEM;

+1 −2
Original line number Diff line number Diff line
@@ -52,8 +52,7 @@ static int __init init_vdso(void)

	vdso_info.size = PAGE_ALIGN(vdso_end - vdso_start);
	vdso_info.code_mapping.pages =
		kzalloc_objs(struct page *, vdso_info.size / PAGE_SIZE,
			     GFP_KERNEL);
		kzalloc_objs(struct page *, vdso_info.size / PAGE_SIZE);

	if (!vdso_info.code_mapping.pages)
		return -ENOMEM;
+1 −2
Original line number Diff line number Diff line
@@ -1738,8 +1738,7 @@ static int kvmppc_core_vcpu_create_pr(struct kvm_vcpu *vcpu)
	vcpu->arch.book3s = vcpu_book3s;

#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
	vcpu->arch.shadow_vcpu = kzalloc_obj(*vcpu->arch.shadow_vcpu,
					     GFP_KERNEL);
	vcpu->arch.shadow_vcpu = kzalloc_obj(*vcpu->arch.shadow_vcpu);
	if (!vcpu->arch.shadow_vcpu)
		goto free_vcpu3s;
#endif
+2 −4
Original line number Diff line number Diff line
@@ -96,8 +96,7 @@ static int hash__init_new_context(struct mm_struct *mm)
{
	int index;

	mm->context.hash_context = kmalloc_obj(struct hash_mm_context,
					       GFP_KERNEL);
	mm->context.hash_context = kmalloc_obj(struct hash_mm_context);
	if (!mm->context.hash_context)
		return -ENOMEM;

@@ -124,8 +123,7 @@ static int hash__init_new_context(struct mm_struct *mm)
#ifdef CONFIG_PPC_SUBPAGE_PROT
		/* inherit subpage prot details if we have one. */
		if (current->mm->context.hash_context->spt) {
			mm->context.hash_context->spt = kmalloc_obj(struct subpage_prot_table,
								    GFP_KERNEL);
			mm->context.hash_context->spt = kmalloc_obj(struct subpage_prot_table);
			if (!mm->context.hash_context->spt) {
				kfree(mm->context.hash_context);
				return -ENOMEM;
Loading