|
|
|
[PATCH 4/7] FRV: Eliminate NULL test and memset after alloc_bootmem | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
From: Julia Lawall <julia@xxxxxxx> As noted by Akinobu Mita in patch b1fceac2b9e04d278316b2faddf276015fc06e3b, alloc_bootmem and related functions never return NULL and always return a zeroed region of memory. Thus a NULL test or memset after calls to these functions is unnecessary. arch/frv/mm/init.c | 2 -- 1 file changed, 2 deletions(-) This was fixed using the following semantic patch. (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression E; statement S; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...) ... when != E ( - BUG_ON (E == NULL); | - if (E == NULL) S ) @@ expression E,E1; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...) ... when != E - memset(E,0,E1); // </smpl> Signed-off-by: Julia Lawall <julia@xxxxxxx> Signed-off-by: David Howells <dhowells@xxxxxxxxxx> --- arch/frv/mm/init.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c index 1b851db..0708284 100644 --- a/arch/frv/mm/init.c +++ b/arch/frv/mm/init.c @@ -87,8 +87,6 @@ void __init paging_init(void) pkmap_page_table = alloc_bootmem_pages(PAGE_SIZE); - memset(pkmap_page_table, 0, PAGE_SIZE); - pge = swapper_pg_dir + pgd_index_k(PKMAP_BASE); pue = pud_offset(pge, PKMAP_BASE); pme = pmd_offset(pue, PKMAP_BASE); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Site Home] [Other Archives] [Linux Kernel Newbies] [Linux Kernel Testers] [Linux SH] [Linux Omap] [Linux Kbuild] [Linux Tape] [Linux Input] [Linux Kernel Janitors] [Linux Doc] [Linux Man Pages] [Linux Standards] [Kernel Announce] [Memory] [Netdev] [Git] [Linux PCI] [NUMA] [Netfilter] [Netfilter Devel] [SELinux] [Bugtraq] [Writing Drivers] [Linux Serial] [Linux PPP] [Linux ISDN] [Linux Next] [Kernel Stable Commits] [Kernel MM Commits] [Linux Security Module] [Ext4] [Linux BTRFS] [Linux NFS] [Linux Cachefs] [Reiser FS] [Fastboot] [Linux RT Users] [Linux Virtualization] [LVS Devel] [KVM] [KVM PPC] [KVM ia64] [Linux Containers] [Util Linux NG] [Sk Drivers] [Wireless] [Linux Bluetooth] [Ethernet Bridging] [Embedded Linux] [Sparse] [Linux Arch] [Linux ACPI] [Linux IBM ACPI] [Linux OpenGL] [CPU Freq] [Linux Power Management] [Linux DCCP] [ALSA Devel] [Linux USB] [Large Format Photos] [DVD Store] [Tux] [Gimp] [Yosemite News] [Linux PA RISC] [MIPS Linux] [S390 Linux] [ARM Linux] [ARM Kernel] [Sparc Linux] [Linux Security] [Linux Sound] [Video 4 Linux] [Linux for the blind] [Linux IDE] [Linux RAID] [Linux SCSI] [Linux SCSI Target Infrastructure] [Linux SMP] [Linux AXP] [Linux Alpha] [Linux M68K] [Linux ia64] [Linux 8086] [Linux x86_64] [Linux Apps] [Linux X.25] [Linux Crypto] [DM Crypt] [LInux Btrace] [Utrace Devel] [Yosemite Photos] [Linux Resources] [Older Kernel Mail]
![]() |
![]() |