summaryrefslogtreecommitdiff
path: root/util.c
blob: 0ec10b97acbcc7c5f6304a6da02fb526762001ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
 *
 * This file is part of nios2sim-ng.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License. See the file "COPYING" in the main directory of this archive
 * for more details.
 */

#include <stdlib.h>
#include <string.h>

#include "nios2sim-ng.h"
#include "util.h"

/**
 * Allocate memory which is set to zero.
 *
 * @param size  requested size of memory in bytes
 * @return      pointer to the allocated and zeroed memory on success, NULL on
 *              error
 */
void *zalloc(const size_t size)
{
	void *ret = malloc(size);

	if (likely(ret != NULL))
		memset(ret, 0x00, size);
	return ret;
}
75e01056a5a2de (patch) tree3f3991255ab0c97e387657749a31a7f3b93a586b /fs/ocfs2 parentf3d8496e9c841874faf4f2c850d2322453c89e94 (diff)
time: don't inline EXPORT_SYMBOL functions
How is the compiler even handling exported functions that are marked inline? Anyway, these shouldn't be inline because of that, so remove that marking. Based on a larger patch by Mark Charlebois to get LLVM to build the kernel. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Mark Charlebois <mcharleb@qualcomm.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: hank <pyu@redhat.com> Cc: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')