Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus-20130628' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-mn10300

Pull two MN10300 fixes from David Howells:
"The first fixes a problem with passing arrays rather than pointers to
get_user() where __typeof__ then wants to declare and initialise an
array variable which gcc doesn't like.

The second fixes a problem whereby putting mem=xxx into the kernel
command line causes init=xxx to get an incorrect value."

* tag 'for-linus-20130628' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-mn10300:
mn10300: Use early_param() to parse "mem=" parameter
mn10300: Allow to pass array name to get_user()

+22 -34
+1 -1
arch/mn10300/include/asm/uaccess.h
··· 161 161 162 162 #define __get_user_check(x, ptr, size) \ 163 163 ({ \ 164 - const __typeof__(ptr) __guc_ptr = (ptr); \ 164 + const __typeof__(*(ptr))* __guc_ptr = (ptr); \ 165 165 int _e; \ 166 166 if (likely(__access_ok((unsigned long) __guc_ptr, (size)))) \ 167 167 _e = __get_user_nocheck((x), __guc_ptr, (size)); \
+21 -33
arch/mn10300/kernel/setup.c
··· 38 38 /* For PCI or other memory-mapped resources */ 39 39 unsigned long pci_mem_start = 0x18000000; 40 40 41 + static char __initdata cmd_line[COMMAND_LINE_SIZE]; 41 42 char redboot_command_line[COMMAND_LINE_SIZE] = 42 43 "console=ttyS0,115200 root=/dev/mtdblock3 rw"; 43 44 ··· 75 74 }; 76 75 77 76 /* 78 - * 77 + * Pick out the memory size. We look for mem=size, 78 + * where size is "size[KkMm]" 79 79 */ 80 - static void __init parse_mem_cmdline(char **cmdline_p) 80 + static int __init early_mem(char *p) 81 81 { 82 - char *from, *to, c; 83 - 84 - /* save unparsed command line copy for /proc/cmdline */ 85 - strcpy(boot_command_line, redboot_command_line); 86 - 87 - /* see if there's an explicit memory size option */ 88 - from = redboot_command_line; 89 - to = redboot_command_line; 90 - c = ' '; 91 - 92 - for (;;) { 93 - if (c == ' ' && !memcmp(from, "mem=", 4)) { 94 - if (to != redboot_command_line) 95 - to--; 96 - memory_size = memparse(from + 4, &from); 97 - } 98 - 99 - c = *(from++); 100 - if (!c) 101 - break; 102 - 103 - *(to++) = c; 104 - } 105 - 106 - *to = '\0'; 107 - *cmdline_p = redboot_command_line; 82 + memory_size = memparse(p, &p); 108 83 109 84 if (memory_size == 0) 110 85 panic("Memory size not known\n"); 111 86 112 - memory_end = (unsigned long) CONFIG_KERNEL_RAM_BASE_ADDRESS + 113 - memory_size; 114 - if (memory_end > phys_memory_end) 115 - memory_end = phys_memory_end; 87 + return 0; 116 88 } 89 + early_param("mem", early_mem); 117 90 118 91 /* 119 92 * architecture specific setup ··· 100 125 cpu_init(); 101 126 unit_setup(); 102 127 smp_init_cpus(); 103 - parse_mem_cmdline(cmdline_p); 128 + 129 + /* save unparsed command line copy for /proc/cmdline */ 130 + strlcpy(boot_command_line, redboot_command_line, COMMAND_LINE_SIZE); 131 + 132 + /* populate cmd_line too for later use, preserving boot_command_line */ 133 + strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE); 134 + *cmdline_p = cmd_line; 135 + 136 + parse_early_param(); 137 + 138 + memory_end = (unsigned long) CONFIG_KERNEL_RAM_BASE_ADDRESS + 139 + memory_size; 140 + if (memory_end > phys_memory_end) 141 + memory_end = phys_memory_end; 104 142 105 143 init_mm.start_code = (unsigned long)&_text; 106 144 init_mm.end_code = (unsigned long) &_etext;