Skip to content

Commit

Permalink
Merge branch 'akpm' (incoming from Andrew)
Browse files Browse the repository at this point in the history
Merge misc updates from Andrew Morton:

 - a few hotfixes

 - dynamic-debug updates

 - ipc updates

 - various other sweepings off the factory floor

* akpm: (31 commits)
  firmware/google: drop 'select EFI' to avoid recursive dependency
  compat: fix sys_fanotify_mark
  checkpatch.pl: check for function declarations without arguments
  mm/migrate.c: fix setting of cpupid on page migration twice against normal page
  softirq: use const char * const for softirq_to_name, whitespace neatening
  softirq: convert printks to pr_<level>
  softirq: use ffs() in __do_softirq()
  kernel/kexec.c: use vscnprintf() instead of vsnprintf() in vmcoreinfo_append_str()
  splice: fix unexpected size truncation
  ipc: fix compat msgrcv with negative msgtyp
  ipc,msg: document barriers
  ipc: delete seq_max field in struct ipc_ids
  ipc: simplify sysvipc_proc_open() return
  ipc: remove useless return statement
  ipc: remove braces for single statements
  ipc: standardize code comments
  ipc: whitespace cleanup
  ipc: change kern_ipc_perm.deleted type to bool
  ipc: introduce ipc_valid_object() helper to sort out IPC_RMID races
  ipc/sem.c: avoid overflow of semop undo (semadj) value
  ...
  • Loading branch information
torvalds committed Jan 28, 2014
2 parents 1b17366 + c2218e2 commit 54c0a4b
Show file tree
Hide file tree
Showing 33 changed files with 448 additions and 416 deletions.
2 changes: 1 addition & 1 deletion arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
kernel_data.end = virt_to_phys(_end - 1);

for_each_memblock(memory, region) {
res = memblock_virt_alloc(sizeof(*res), 0);
res = memblock_virt_alloc_low(sizeof(*res), 0);
res->name = "System RAM";
res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
Expand Down
8 changes: 1 addition & 7 deletions arch/unicore32/kernel/early_printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,11 @@ static struct console early_ocd_console = {

static int __init setup_early_printk(char *buf)
{
int keep_early;

if (!buf || early_console)
return 0;

if (strstr(buf, "keep"))
keep_early = 1;

early_console = &early_ocd_console;

if (keep_early)
if (strstr(buf, "keep"))
early_console->flags &= ~CON_BOOT;
else
early_console->flags |= CON_BOOT;
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/include/asm/page_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ extern int devmem_is_allowed(unsigned long pagenr);
extern unsigned long max_low_pfn_mapped;
extern unsigned long max_pfn_mapped;

static inline phys_addr_t get_max_low_mapped(void)
static inline phys_addr_t get_max_mapped(void)
{
return (phys_addr_t)max_low_pfn_mapped << PAGE_SHIFT;
return (phys_addr_t)max_pfn_mapped << PAGE_SHIFT;
}

bool pfn_range_is_mapped(unsigned long start_pfn, unsigned long end_pfn);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ void __init setup_arch(char **cmdline_p)

setup_real_mode();

memblock_set_current_limit(get_max_low_mapped());
memblock_set_current_limit(get_max_mapped());
dma_contiguous_reserve(0);

/*
Expand Down
3 changes: 1 addition & 2 deletions drivers/firmware/google/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ menu "Google Firmware Drivers"

config GOOGLE_SMI
tristate "SMI interface for Google platforms"
depends on ACPI && DMI
select EFI
depends on ACPI && DMI && EFI
select EFI_VARS
help
Say Y here if you want to enable SMI callbacks for Google
Expand Down
4 changes: 2 additions & 2 deletions fs/notify/fanotify/fanotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,9 @@ COMPAT_SYSCALL_DEFINE6(fanotify_mark,
{
return sys_fanotify_mark(fanotify_fd, flags,
#ifdef __BIG_ENDIAN
((__u64)mask1 << 32) | mask0,
#else
((__u64)mask0 << 32) | mask1,
#else
((__u64)mask1 << 32) | mask0,
#endif
dfd, pathname);
}
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ static int ocfs2_unlink(struct inode *dir,
ocfs2_free_dir_lookup_result(&orphan_insert);
ocfs2_free_dir_lookup_result(&lookup);

if (status && (status != -ENOTEMPTY))
if (status && (status != -ENOTEMPTY) && (status != -ENOENT))
mlog_errno(status);

return status;
Expand Down
37 changes: 37 additions & 0 deletions include/linux/bootmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,27 @@ static inline void * __init memblock_virt_alloc_nopanic(
NUMA_NO_NODE);
}

#ifndef ARCH_LOW_ADDRESS_LIMIT
#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
#endif

static inline void * __init memblock_virt_alloc_low(
phys_addr_t size, phys_addr_t align)
{
return memblock_virt_alloc_try_nid(size, align,
BOOTMEM_LOW_LIMIT,
ARCH_LOW_ADDRESS_LIMIT,
NUMA_NO_NODE);
}
static inline void * __init memblock_virt_alloc_low_nopanic(
phys_addr_t size, phys_addr_t align)
{
return memblock_virt_alloc_try_nid_nopanic(size, align,
BOOTMEM_LOW_LIMIT,
ARCH_LOW_ADDRESS_LIMIT,
NUMA_NO_NODE);
}

static inline void * __init memblock_virt_alloc_from_nopanic(
phys_addr_t size, phys_addr_t align, phys_addr_t min_addr)
{
Expand Down Expand Up @@ -238,6 +259,22 @@ static inline void * __init memblock_virt_alloc_nopanic(
return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT);
}

static inline void * __init memblock_virt_alloc_low(
phys_addr_t size, phys_addr_t align)
{
if (!align)
align = SMP_CACHE_BYTES;
return __alloc_bootmem_low(size, align, BOOTMEM_LOW_LIMIT);
}

static inline void * __init memblock_virt_alloc_low_nopanic(
phys_addr_t size, phys_addr_t align)
{
if (!align)
align = SMP_CACHE_BYTES;
return __alloc_bootmem_low_nopanic(size, align, BOOTMEM_LOW_LIMIT);
}

static inline void * __init memblock_virt_alloc_from_nopanic(
phys_addr_t size, phys_addr_t align, phys_addr_t min_addr)
{
Expand Down
2 changes: 1 addition & 1 deletion include/linux/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ enum
/* map softirq index to softirq name. update 'softirq_to_name' in
* kernel/softirq.c when adding a new softirq.
*/
extern char *softirq_to_name[NR_SOFTIRQS];
extern const char * const softirq_to_name[NR_SOFTIRQS];

/* softirq mask and active fields moved to irq_cpustat_t in
* asm/hardirq.h to get better cache usage. KAO
Expand Down
2 changes: 1 addition & 1 deletion include/linux/ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
struct kern_ipc_perm
{
spinlock_t lock;
int deleted;
bool deleted;
int id;
key_t key;
kuid_t uid;
Expand Down
1 change: 0 additions & 1 deletion include/linux/ipc_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ struct user_namespace;
struct ipc_ids {
int in_use;
unsigned short seq;
unsigned short seq_max;
struct rw_semaphore rwsem;
struct idr ipcs_idr;
int next_id;
Expand Down
2 changes: 1 addition & 1 deletion include/linux/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct msg_msg {
struct list_head m_list;
long m_type;
size_t m_ts; /* message text size */
struct msg_msgseg* next;
struct msg_msgseg *next;
void *security;
/* the actual message follows immediately */
};
Expand Down
2 changes: 1 addition & 1 deletion include/linux/shm.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
struct shmid_kernel /* private to the kernel */
{
struct kern_ipc_perm shm_perm;
struct file * shm_file;
struct file *shm_file;
unsigned long shm_nattch;
unsigned long shm_segsz;
time_t shm_atim;
Expand Down
3 changes: 2 additions & 1 deletion include/linux/splice.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
* Passed to the actors
*/
struct splice_desc {
unsigned int len, total_len; /* current and remaining length */
size_t total_len; /* remaining length */
unsigned int len; /* current length */
unsigned int flags; /* splice flags */
/*
* actor() private data
Expand Down
2 changes: 0 additions & 2 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ static int kernel_init(void *);

extern void init_IRQ(void);
extern void fork_init(unsigned long);
extern void mca_init(void);
extern void sbus_init(void);
extern void radix_tree_init(void);
#ifndef CONFIG_DEBUG_RODATA
static inline void mark_rodata_ro(void) { }
Expand Down
30 changes: 15 additions & 15 deletions ipc/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ static inline int __put_compat_ipc_perm(struct ipc64_perm *p,
static inline int get_compat_semid64_ds(struct semid64_ds *s64,
struct compat_semid64_ds __user *up64)
{
if (!access_ok (VERIFY_READ, up64, sizeof(*up64)))
if (!access_ok(VERIFY_READ, up64, sizeof(*up64)))
return -EFAULT;
return __get_compat_ipc64_perm(&s64->sem_perm, &up64->sem_perm);
}

static inline int get_compat_semid_ds(struct semid64_ds *s,
struct compat_semid_ds __user *up)
{
if (!access_ok (VERIFY_READ, up, sizeof(*up)))
if (!access_ok(VERIFY_READ, up, sizeof(*up)))
return -EFAULT;
return __get_compat_ipc_perm(&s->sem_perm, &up->sem_perm);
}
Expand All @@ -215,7 +215,7 @@ static inline int put_compat_semid64_ds(struct semid64_ds *s64,
{
int err;

if (!access_ok (VERIFY_WRITE, up64, sizeof(*up64)))
if (!access_ok(VERIFY_WRITE, up64, sizeof(*up64)))
return -EFAULT;
err = __put_compat_ipc64_perm(&s64->sem_perm, &up64->sem_perm);
err |= __put_user(s64->sem_otime, &up64->sem_otime);
Expand All @@ -229,7 +229,7 @@ static inline int put_compat_semid_ds(struct semid64_ds *s,
{
int err;

if (!access_ok (VERIFY_WRITE, up, sizeof(*up)))
if (!access_ok(VERIFY_WRITE, up, sizeof(*up)))
return -EFAULT;
err = __put_compat_ipc_perm(&s->sem_perm, &up->sem_perm);
err |= __put_user(s->sem_otime, &up->sem_otime);
Expand Down Expand Up @@ -288,11 +288,11 @@ static long do_compat_semctl(int first, int second, int third, u32 pad)
break;

case IPC_SET:
if (version == IPC_64) {
if (version == IPC_64)
err = get_compat_semid64_ds(&s64, compat_ptr(pad));
} else {
else
err = get_compat_semid_ds(&s64, compat_ptr(pad));
}

up64 = compat_alloc_user_space(sizeof(s64));
if (copy_to_user(up64, &s64, sizeof(s64)))
err = -EFAULT;
Expand Down Expand Up @@ -376,12 +376,12 @@ COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second,
struct compat_ipc_kludge ipck;
if (!uptr)
return -EINVAL;
if (copy_from_user (&ipck, uptr, sizeof(ipck)))
if (copy_from_user(&ipck, uptr, sizeof(ipck)))
return -EFAULT;
uptr = compat_ptr(ipck.msgp);
fifth = ipck.msgtyp;
}
return do_msgrcv(first, uptr, second, fifth, third,
return do_msgrcv(first, uptr, second, (s32)fifth, third,
compat_do_msg_fill);
}
case MSGGET:
Expand Down Expand Up @@ -515,11 +515,11 @@ long compat_sys_msgctl(int first, int second, void __user *uptr)
break;

case IPC_SET:
if (version == IPC_64) {
if (version == IPC_64)
err = get_compat_msqid64(&m64, uptr);
} else {
else
err = get_compat_msqid(&m64, uptr);
}

if (err)
break;
p = compat_alloc_user_space(sizeof(m64));
Expand Down Expand Up @@ -702,11 +702,11 @@ long compat_sys_shmctl(int first, int second, void __user *uptr)


case IPC_SET:
if (version == IPC_64) {
if (version == IPC_64)
err = get_compat_shmid64_ds(&s64, uptr);
} else {
else
err = get_compat_shmid_ds(&s64, uptr);
}

if (err)
break;
p = compat_alloc_user_space(sizeof(s64));
Expand Down
2 changes: 1 addition & 1 deletion ipc/compat_mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ asmlinkage long compat_sys_mq_open(const char __user *u_name,
return sys_mq_open(u_name, oflag, mode, p);
}

static int compat_prepare_timeout(struct timespec __user * *p,
static int compat_prepare_timeout(struct timespec __user **p,
const struct compat_timespec __user *u)
{
struct timespec ts;
Expand Down
14 changes: 7 additions & 7 deletions ipc/ipc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,21 +164,21 @@ static struct ctl_table ipc_kern_table[] = {
{
.procname = "shmmax",
.data = &init_ipc_ns.shm_ctlmax,
.maxlen = sizeof (init_ipc_ns.shm_ctlmax),
.maxlen = sizeof(init_ipc_ns.shm_ctlmax),
.mode = 0644,
.proc_handler = proc_ipc_doulongvec_minmax,
},
{
.procname = "shmall",
.data = &init_ipc_ns.shm_ctlall,
.maxlen = sizeof (init_ipc_ns.shm_ctlall),
.maxlen = sizeof(init_ipc_ns.shm_ctlall),
.mode = 0644,
.proc_handler = proc_ipc_doulongvec_minmax,
},
{
.procname = "shmmni",
.data = &init_ipc_ns.shm_ctlmni,
.maxlen = sizeof (init_ipc_ns.shm_ctlmni),
.maxlen = sizeof(init_ipc_ns.shm_ctlmni),
.mode = 0644,
.proc_handler = proc_ipc_dointvec,
},
Expand All @@ -194,7 +194,7 @@ static struct ctl_table ipc_kern_table[] = {
{
.procname = "msgmax",
.data = &init_ipc_ns.msg_ctlmax,
.maxlen = sizeof (init_ipc_ns.msg_ctlmax),
.maxlen = sizeof(init_ipc_ns.msg_ctlmax),
.mode = 0644,
.proc_handler = proc_ipc_dointvec_minmax,
.extra1 = &zero,
Expand All @@ -203,7 +203,7 @@ static struct ctl_table ipc_kern_table[] = {
{
.procname = "msgmni",
.data = &init_ipc_ns.msg_ctlmni,
.maxlen = sizeof (init_ipc_ns.msg_ctlmni),
.maxlen = sizeof(init_ipc_ns.msg_ctlmni),
.mode = 0644,
.proc_handler = proc_ipc_callback_dointvec_minmax,
.extra1 = &zero,
Expand All @@ -212,7 +212,7 @@ static struct ctl_table ipc_kern_table[] = {
{
.procname = "msgmnb",
.data = &init_ipc_ns.msg_ctlmnb,
.maxlen = sizeof (init_ipc_ns.msg_ctlmnb),
.maxlen = sizeof(init_ipc_ns.msg_ctlmnb),
.mode = 0644,
.proc_handler = proc_ipc_dointvec_minmax,
.extra1 = &zero,
Expand All @@ -221,7 +221,7 @@ static struct ctl_table ipc_kern_table[] = {
{
.procname = "sem",
.data = &init_ipc_ns.sem_ctls,
.maxlen = 4*sizeof (int),
.maxlen = 4*sizeof(int),
.mode = 0644,
.proc_handler = proc_ipc_dointvec,
},
Expand Down
Loading

0 comments on commit 54c0a4b

Please sign in to comment.