+ binfmt_elf-macro-cleanup.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     binfmt_elf: macro cleanup

has been added to the -mm tree.  Its filename is

     binfmt_elf-macro-cleanup.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: binfmt_elf: macro cleanup
From: Andrew Morton <akpm@xxxxxxxx>

We have a few macros in there which hide `goto' and `return' statements. 
Expans them by hand and remove them.


Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/binfmt_elf.c |   60 ++++++++++++++++++++++++++--------------------
 1 files changed, 34 insertions(+), 26 deletions(-)

diff -puN fs/binfmt_elf.c~binfmt_elf-macro-cleanup fs/binfmt_elf.c
--- a/fs/binfmt_elf.c~binfmt_elf-macro-cleanup
+++ a/fs/binfmt_elf.c
@@ -1207,11 +1207,6 @@ static int notesize(struct memelfnote *e
 	return sz;
 }
 
-#define DUMP_WRITE(addr, nr)	\
-	do { if (!dump_write(file, (addr), (nr))) return 0; } while(0)
-#define DUMP_SEEK(off)	\
-	do { if (!dump_seek(file, (off))) return 0; } while(0)
-
 static int writenote(struct memelfnote *men, struct file *file)
 {
 	struct elf_note en;
@@ -1220,24 +1215,21 @@ static int writenote(struct memelfnote *
 	en.n_descsz = men->datasz;
 	en.n_type = men->type;
 
-	DUMP_WRITE(&en, sizeof(en));
-	DUMP_WRITE(men->name, en.n_namesz);
+	if (!dump_write(&en, sizeof(en)))
+		goto err;
+	if (!dump_write(men->name, en.n_namesz))
+		goto err;
 	/* XXX - cast from long long to long to avoid need for libgcc.a */
-	DUMP_SEEK(roundup((unsigned long)file->f_pos, 4));	/* XXX */
-	DUMP_WRITE(men->data, men->datasz);
-	DUMP_SEEK(roundup((unsigned long)file->f_pos, 4));	/* XXX */
-
+	if (!dump_seek(roundup((unsigned long)file->f_pos, 4)))
+		goto err;
+	if (!dump_write(men->data, men->datasz))
+		goto err;
+	if (!dump_seek(roundup((unsigned long)file->f_pos, 4)))
+		goto err;
 	return 1;
+err:
+	return 0;
 }
-#undef DUMP_WRITE
-#undef DUMP_SEEK
-
-#define DUMP_WRITE(addr, nr)	\
-	if ((size += (nr)) > limit || !dump_write(file, (addr), (nr))) \
-		goto end_coredump;
-#define DUMP_SEEK(off)	\
-	if (!dump_seek(file, (off))) \
-		goto end_coredump;
 
 static void fill_elf_header(struct elfhdr *elf, int segs)
 {
@@ -1555,7 +1547,11 @@ static int elf_core_dump(long signr, str
 	fs = get_fs();
 	set_fs(KERNEL_DS);
 
-	DUMP_WRITE(elf, sizeof(*elf));
+	size += sizeof(*elf);
+	if (size > limit)
+		goto end_coredump;
+	if (!dump_write(file, elf, sizeof(*elf))
+		goto end_coredump;
 	offset += sizeof(*elf);				/* Elf header */
 	offset += (segs+1) * sizeof(struct elf_phdr);	/* Program headers */
 
@@ -1571,7 +1567,11 @@ static int elf_core_dump(long signr, str
 
 		fill_elf_note_phdr(&phdr, sz, offset);
 		offset += sz;
-		DUMP_WRITE(&phdr, sizeof(phdr));
+		size += sizeof(phdr);
+		if (size > limit)
+			goto end_coredump;
+		if (!dump_write(file, &phdr, sizeof(phdr))
+			goto end_coredump;
 	}
 
 	/* Page-align dumped data */
@@ -1598,7 +1598,11 @@ static int elf_core_dump(long signr, str
 			phdr.p_flags |= PF_X;
 		phdr.p_align = ELF_EXEC_PAGESIZE;
 
-		DUMP_WRITE(&phdr, sizeof(phdr));
+		size += sizeof(phdr);
+		if (size > limit)
+			goto end_coredump;
+		if (!dump_write(file, &phdr, sizeof(phdr))
+			goto end_coredump;
 	}
 
 #ifdef ELF_CORE_WRITE_EXTRA_PHDRS
@@ -1620,7 +1624,8 @@ static int elf_core_dump(long signr, str
 				goto end_coredump;
 	}
  
-	DUMP_SEEK(dataoff);
+	if (!dump_seek(file, dataoff))
+		goto end_coredump;
 
 	for (vma = current->mm->mmap; vma != NULL; vma = vma->vm_next) {
 		unsigned long addr;
@@ -1636,10 +1641,13 @@ static int elf_core_dump(long signr, str
 
 			if (get_user_pages(current, current->mm, addr, 1, 0, 1,
 						&page, &vma) <= 0) {
-				DUMP_SEEK(file->f_pos + PAGE_SIZE);
+				if (!dump_seek(file, file->f_pos + PAGE_SIZE))
+					goto end_coredump
 			} else {
 				if (page == ZERO_PAGE(addr)) {
-					DUMP_SEEK(file->f_pos + PAGE_SIZE);
+					if (!dump_seek(file,
+						       file->f_pos + PAGE_SIZE))
+						goto end_coredump;
 				} else {
 					void *kaddr;
 					flush_cache_page(vma, addr,
_

Patches currently in -mm which might be from akpm@xxxxxxxx are

dont-select-config_hotplug.patch
x86_64-e820c-needs-pgtableh.patch
count_vm_events-fix.patch
add-computone-intelliport-plus-serial-hotplug-support.patch
add-specialix-io8-card-support-hotplug-support.patch
fadvise-remove-dead-comments.patch
vt-remove-vt-specific-declarations-and-definitions-from.patch
tty-remove-include-of-screen_infoh-from-ttyh.patch
md-include-sector-number-in-messages-about-corrected-read-errors.patch
md-oops-workaround.patch
disable-debugging-version-of-write_lock.patch
acpi-initialise-cm_sbs_sem.patch
acpi-asus-s3-resume-fix-fix.patch
sony_apci-resume.patch
maestro3-section-fix.patch
kauditd_thread-warning-fix.patch
git-geode-fixup.patch
git-gfs2.patch
git-gfs2-fixup.patch
git-ia64.patch
git-ia64-fixup.patch
git-ieee1394-fixup.patch
git-input.patch
git-klibc.patch
git-hdrcleanup-vs-git-klibc-on-ia64.patch
git-hdrcleanup-vs-git-klibc-on-ia64-2.patch
git-libata-all.patch
sata-is-bust-on-s390.patch
git-netdev-all.patch
e1000-irq-naming-update.patch
8139cp-printk-fix.patch
82596-section-fixes.patch
ac3200-section-fixes.patch
cops-section-fix.patch
cs89x0-section-fix.patch
at1700-section-fix.patch
e2100-section-fix.patch
eepro-section-fix.patch
eexpress-section-fix.patch
es3210-section-fix.patch
eth16i-section-fix.patch
lance-section-fix.patch
lne390-section-fix.patch
ni52-section-fix.patch
ibmtr-section-fix.patch
smctr-section-fix.patch
wd-section-fix.patch
ni65-section-fix.patch
seeq8005-section-fix.patch
winbond-840-section-fix.patch
fealnx-section-fix.patch
sundance-section-fix.patch
drivers-net-ns83820c-add-paramter-to-disable-auto.patch
git-sas.patch
serial-8250-sysrq-deadlock-fix.patch
serial-fix-uart_bug_txen-test.patch
revert-gregkh-pci-pci-test-that-drivers-properly-call-pci_set_master.patch
revert-gregkh-pci-msi-drop-pci_msi_quirk.patch
revert-gregkh-pci-msi-stop-inheriting-bus-flags-and-check-root-chipset-bus-flags-instead.patch
revert-gregkh-pci-msi-factorize-common-msi-detection-code-from-pci_enable_msi-and-msix.patch
revert-gregkh-pci-msi-blacklist-pci-e-chipsets-depending-on-hypertransport-msi-capabality.patch
revert-gregkh-pci-msi-rename-pci_cap_id_ht_irqconf-into-pci_cap_id_ht.patch
revert-gregkh-pci-msi-merge-existing-msi-disabling-quirks.patch
revert-VIA-quirk-fixup-additional-PCI-IDs.patch
revert-PCI-quirk-VIA-IRQ-fixup-should-only-run-for-VIA-southbridges.patch
NCR_D700-section-fix.patch
areca-raid-linux-scsi-driver.patch
git-scsi-target-fixup.patch
usb-storage-uname-in-pr-sc-unneeded-message-fix.patch
pm-usb-hcds-use-pm_event_prethaw-fix.patch
kill-usb-kconfig-warning.patch
git-supertrak-fixup.patch
bcm43xx-opencoded-locking.patch
mm-x86_64-mm-init-rdtscp-warning-fix.patch
sleazy-fpu-feature-x86_64-support-fix.patch
x86_64-wire-up-oops_enter-oops_exit.patch
adix-tree-rcu-lockless-readside-update-tidy.patch
mm-tracking-shared-dirty-pages-checks.patch
mm-tracking-shared-dirty-pages-wimp.patch
convert-i386-numa-kva-space-to-bootmem-tidy.patch
acx1xx-wireless-driver.patch
tiacx-pci-build-fix.patch
tiacx-ia64-fix.patch
tiacx-build-fix.patch
binfmt_elf-macro-cleanup.patch
frv-fix-frv-arch-compile-errors-fix.patch
deprecate-smbfs-in-favour-of-cifs.patch
edac-new-opteron-athlon64-memory-controller-driver-tidy.patch
x86-microcode-microcode-driver-cleanup-tidy.patch
x86-microcode-add-sysfs-and-hotplug-support-fix.patch
x86-microcode-add-sysfs-and-hotplug-support-fix-fix.patch
add-address_space_operationsbatch_write-tidy.patch
fix-weird-logic-in-alloc_fdtable.patch
alloc_fdtable-cleanup.patch
reiserfs-on-demand-bitmap-loading.patch
per-task-delay-accounting-taskstats-interface.patch
per-task-delay-accounting-proc-export-of-aggregated-block-i-o-delays.patch
delay-accounting-taskstats-interface-send-tgid-once.patch
per-task-delay-accounting-taskstats-interface-control-exit-data-through-cpumasks-fix.patch
task-watchers-task-watchers.patch
task-watchers-add-support-for-per-task-watchers.patch
swap_prefetch-vs-zoned-counters.patch
ecryptfs-mmap-operations.patch
ecryptfs-alpha-build-fix.patch
ecryptfs-more-elegant-aes-key-size-manipulation.patch
ecryptfs-get_sb_dev-fix.patch
namespaces-add-nsproxy-dont-include-compileh.patch
namespaces-utsname-switch-to-using-uts-namespaces.patch
namespaces-utsname-use-init_utsname-when-appropriate.patch
namespaces-utsname-implement-utsname-namespaces.patch
namespaces-utsname-sysctl-hack.patch
ipc-namespace-core.patch
readahead-sysctl-parameters-fix.patch
make-copy_from_user_inatomic-not-zero-the-tail-on-i386-vs-reiser4.patch
reiser4-hardirq-include-fix.patch
reiser4-run-truncate_inode_pages-in-reiser4_delete_inode.patch
reiser4-get_sb_dev-fix.patch
reiser4-vs-zoned-allocator.patch
hpt3xx-rework-rate-filtering-tidy.patch
cirrus-logic-framebuffer-i2c-support-fix.patch
genirq-convert-the-i386-architecture-to-irq-chips.patch
genirq-x86_64-irq-reenable-migrating-irqs-to-other-cpus.patch
genirq-msi-simplify-msi-enable-and-disable.patch
genirq-ia64-irq-dynamic-irq-support.patch
genirq-msi-only-build-msi-apicc-on-ia64-fix.patch
genirq-i386-irq-remove-the-msi-assumption-that-irq-==-vector.patch
nr_blockdev_pages-in_interrupt-warning.patch
device-suspend-debug.patch
revert-tty-buffering-comment-out-debug-code.patch
slab-leaks3-default-y.patch
x86-kmap_atomic-debugging.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux