Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4adca1cb authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'akpm' (patches from Andrew Morton)

Merge misc fixes from Andrew Morton:
 "Six fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  drivers/rtc/rtc-s5m.c: terminate s5m_rtc_id array with empty element
  printk: add dummy routine for when CONFIG_PRINTK=n
  mm/vmscan: fix highidx argument type
  memcg: remove extra newlines from memcg oom kill log
  x86, build: replace Perl script with Shell script
  mm: page_alloc: embed OOM killing naturally into allocation slowpath
parents c976a67b 45cd15e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ suffix-$(CONFIG_KERNEL_LZO) := lzo
suffix-$(CONFIG_KERNEL_LZ4) 	:= lz4

RUN_SIZE = $(shell $(OBJDUMP) -h vmlinux | \
	     perl $(srctree)/arch/x86/tools/calc_run_size.pl)
	     $(CONFIG_SHELL) $(srctree)/arch/x86/tools/calc_run_size.sh)
quiet_cmd_mkpiggy = MKPIGGY $@
      cmd_mkpiggy = $(obj)/mkpiggy $< $(RUN_SIZE) > $@ || ( rm -f $@ ; false )

arch/x86/tools/calc_run_size.pl

deleted100644 → 0
+0 −39
Original line number Diff line number Diff line
#!/usr/bin/perl
#
# Calculate the amount of space needed to run the kernel, including room for
# the .bss and .brk sections.
#
# Usage:
# objdump -h a.out | perl calc_run_size.pl
use strict;

my $mem_size = 0;
my $file_offset = 0;

my $sections=" *[0-9]+ \.(?:bss|brk) +";
while (<>) {
	if (/^$sections([0-9a-f]+) +(?:[0-9a-f]+ +){2}([0-9a-f]+)/) {
		my $size = hex($1);
		my $offset = hex($2);
		$mem_size += $size;
		if ($file_offset == 0) {
			$file_offset = $offset;
		} elsif ($file_offset != $offset) {
			# BFD linker shows the same file offset in ELF.
			# Gold linker shows them as consecutive.
			next if ($file_offset + $mem_size == $offset + $size);

			printf STDERR "file_offset: 0x%lx\n", $file_offset;
			printf STDERR "mem_size: 0x%lx\n", $mem_size;
			printf STDERR "offset: 0x%lx\n", $offset;
			printf STDERR "size: 0x%lx\n", $size;

			die ".bss and .brk are non-contiguous\n";
		}
	}
}

if ($file_offset == 0) {
	die "Never found .bss or .brk file offset\n";
}
printf("%d\n", $mem_size + $file_offset);
+42 −0
Original line number Diff line number Diff line
#!/bin/sh
#
# Calculate the amount of space needed to run the kernel, including room for
# the .bss and .brk sections.
#
# Usage:
# objdump -h a.out | sh calc_run_size.sh

NUM='\([0-9a-fA-F]*[ \t]*\)'
OUT=$(sed -n 's/^[ \t0-9]*.b[sr][sk][ \t]*'"$NUM$NUM$NUM$NUM"'.*/\1\4/p')
if [ -z "$OUT" ] ; then
	echo "Never found .bss or .brk file offset" >&2
	exit 1
fi

OUT=$(echo ${OUT# })
sizeA=$(printf "%d" 0x${OUT%% *})
OUT=${OUT#* }
offsetA=$(printf "%d" 0x${OUT%% *})
OUT=${OUT#* }
sizeB=$(printf "%d" 0x${OUT%% *})
OUT=${OUT#* }
offsetB=$(printf "%d" 0x${OUT%% *})

run_size=$(( $offsetA + $sizeA + $sizeB ))

# BFD linker shows the same file offset in ELF.
if [ "$offsetA" -ne "$offsetB" ] ; then
	# Gold linker shows them as consecutive.
	endB=$(( $offsetB + $sizeB ))
	if [ "$endB" != "$run_size" ] ; then
		printf "sizeA: 0x%x\n" $sizeA >&2
		printf "offsetA: 0x%x\n" $offsetA >&2
		printf "sizeB: 0x%x\n" $sizeB >&2
		printf "offsetB: 0x%x\n" $offsetB >&2
		echo ".bss and .brk are non-contiguous" >&2
		exit 1
	fi
fi

printf "%d\n" $run_size
exit 0
+1 −0
Original line number Diff line number Diff line
@@ -832,6 +832,7 @@ static SIMPLE_DEV_PM_OPS(s5m_rtc_pm_ops, s5m_rtc_suspend, s5m_rtc_resume);
static const struct platform_device_id s5m_rtc_id[] = {
	{ "s5m-rtc",		S5M8767X },
	{ "s2mps14-rtc",	S2MPS14X },
	{ },
};

static struct platform_driver s5m_rtc_driver = {
+0 −5
Original line number Diff line number Diff line
@@ -85,11 +85,6 @@ static inline void oom_killer_enable(void)
	oom_killer_disabled = false;
}

static inline bool oom_gfp_allowed(gfp_t gfp_mask)
{
	return (gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY);
}

extern struct task_struct *find_lock_task_mm(struct task_struct *p);

static inline bool task_will_free_mem(struct task_struct *task)
Loading