Commit 50dc57c4 authored by Tom Rini's avatar Tom Rini Committed by Sam Ravnborg

kbuild: warning fixes on Solaris 9

The following set of patches is based loosely on the patches that
Jean-Christophe Dubois came up with for 2.6.7.  Where as the original
patches added a number of casts to unsigned char, I went the route of
making the chars be explicitly signed.  I honestly don't know which
route is better to go down.  Doing this is the bulk of the patch.  Out
of the rest of the odds 'n ends is that on Solaris, Elf32_Word is a
ulong, which means all of the printf's are unhappy (uint format, ulong
arg) for most of the typedefs.
Signed-off-by: default avatarTom Rini <trini@kernel.crashing.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 298039e7
......@@ -96,7 +96,7 @@ void write_bugboot_header(int32_t out_fd, uint32_t boot_size)
uint8_t header_block[HEADER_SIZE];
bug_boot_header_t *bbh = (bug_boot_header_t *)&header_block[0];
bzero(header_block, HEADER_SIZE);
memset(header_block, 0, HEADER_SIZE);
/* Fill in the PPCBUG ROM boot header */
strncpy(bbh->magic_word, "BOOT", 4); /* PPCBUG magic word */
......
......@@ -52,7 +52,7 @@ FILEONLY *internalfunctions;
FILEONLY *externalfunctions;
FILEONLY *symbolsonly;
typedef void FILELINE(char * file, char * line);
typedef void FILELINE(char * file, signed char * line);
FILELINE * singlefunctions;
FILELINE * entity_system;
......@@ -148,9 +148,9 @@ struct symfile * filename_exist(char * filename)
* Files are separated by tabs.
*/
void adddep(char * file) { printf("\t%s", file); }
void adddep2(char * file, char * line) { line = line; adddep(file); }
void adddep2(char * file, signed char * line) { line = line; adddep(file); }
void noaction(char * line) { line = line; }
void noaction2(char * file, char * line) { file = file; line = line; }
void noaction2(char * file, signed char * line) { file = file; line = line; }
/* Echo the line without further action */
void printline(char * line) { printf("%s", line); }
......@@ -179,8 +179,8 @@ void find_export_symbols(char * filename)
perror(real_filename);
}
while(fgets(line, MAXLINESZ, fp)) {
char *p;
char *e;
signed char *p;
signed char *e;
if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != 0) ||
((p = strstr(line, "EXPORT_SYMBOL")) != 0)) {
/* Skip EXPORT_SYMBOL{_GPL} */
......@@ -253,7 +253,7 @@ void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
* Call kernel-doc with the following parameters:
* kernel-doc -docbook -function function1 [-function function2]
*/
void singfunc(char * filename, char * line)
void singfunc(char * filename, signed char * line)
{
char *vec[200]; /* Enough for specific functions */
int i, idx = 0;
......@@ -290,7 +290,7 @@ void singfunc(char * filename, char * line)
void parse_file(FILE *infile)
{
char line[MAXLINESZ];
char * s;
signed char * s;
while(fgets(line, MAXLINESZ, infile)) {
if (line[0] == '!') {
s = line + 2;
......
......@@ -217,12 +217,12 @@ void use_config(char *m, int slen)
printf(" $(wildcard include/config/%s.h) \\\n", s);
}
void parse_config_file(char *map, size_t len)
void parse_config_file(signed char *map, size_t len)
{
int *end = (int *) (map + len);
/* start at +1, so that p can never be < map */
int *m = (int *) map + 1;
char *p, *q;
signed char *p, *q;
for (; m < end; m++) {
if (*m == INT_CONF) { p = (char *) m ; goto conf; }
......@@ -291,9 +291,9 @@ void do_config_file(char *filename)
void parse_dep_file(void *map, size_t len)
{
char *m = map;
char *end = m + len;
char *p;
signed char *m = map;
signed char *end = m + len;
signed char *p;
char s[PATH_MAX];
p = strchr(m, ':');
......
......@@ -104,7 +104,7 @@ int main(int argc, const char * argv [])
/* Read config lines. */
while (fgets(line, buffer_size, fp_config))
{
const char * str_config;
const signed char * str_config;
int is_same;
int itarget;
......
......@@ -33,7 +33,7 @@ void usage(char *argv0)
int getunicode(char **p0)
{
char *p = *p0;
unsigned char *p = *p0;
while (*p == ' ' || *p == '\t')
p++;
......
......@@ -31,14 +31,14 @@ char *defconfig_file;
static int indent = 1;
static int valid_stdin = 1;
static int conf_cnt;
static char line[128];
static signed char line[128];
static struct menu *rootEntry;
static char nohelp_text[] = "Sorry, no help available for this option yet.\n";
static void strip(char *str)
static void strip(signed char *str)
{
char *p = str;
signed char *p = str;
int l;
while ((isspace(*p)))
......
......@@ -27,10 +27,10 @@ const char *conf_confnames[] = {
NULL,
};
static char *conf_expand_value(const char *in)
static char *conf_expand_value(const signed char *in)
{
struct symbol *sym;
const char *src;
const signed char *src;
static char res_value[SYMBOL_MAXLENGTH];
char *dst, name[SYMBOL_MAXLENGTH];
......@@ -295,7 +295,7 @@ int conf_write(const char *name)
} else
basename = conf_def_filename;
sprintf(newname, "%s.tmpconfig.%d", dirname, getpid());
sprintf(newname, "%s.tmpconfig.%d", dirname, (int)getpid());
out = fopen(newname, "w");
if (!out)
return 1;
......
......@@ -82,8 +82,8 @@ save_config_help[] =
"leave this blank.\n"
;
static char buf[4096], *bufptr = buf;
static char input_buf[4096];
static signed char buf[4096], *bufptr = buf;
static signed char input_buf[4096];
static char filename[PATH_MAX+1] = ".config";
static char *args[1024], **argptr = args;
static int indent;
......
......@@ -421,7 +421,7 @@ tristate sym_toggle_tristate_value(struct symbol *sym)
bool sym_string_valid(struct symbol *sym, const char *str)
{
char ch;
signed char ch;
switch (sym->type) {
case S_STRING:
......
......@@ -12,16 +12,21 @@
#include "modpost.h"
/* We use the ELF typedefs, since we can't rely on stdint.h being present. */
/* We use the ELF typedefs for kernel_ulong_t but bite the bullet and
* use either stdint.h or inttypes.h for the rest. */
#if KERNEL_ELFCLASS == ELFCLASS32
typedef Elf32_Addr kernel_ulong_t;
#else
typedef Elf64_Addr kernel_ulong_t;
#endif
#ifdef __sun__
#include <inttypes.h>
#else
#include <stdint.h>
#endif
typedef Elf32_Word __u32;
typedef Elf32_Half __u16;
typedef uint32_t __u32;
typedef uint16_t __u16;
typedef unsigned char __u8;
/* Big exception to the "don't include kernel headers into userspace, which
......
......@@ -219,7 +219,7 @@ get_next_line(unsigned long *pos, void *file, unsigned long size)
static char line[4096];
int skip = 1;
size_t len = 0;
char *p = (char *)file + *pos;
signed char *p = (char *)file + *pos;
char *s = line;
for (; *pos < size ; (*pos)++)
......
......@@ -252,9 +252,9 @@ static int parse_comment(const char *file, unsigned long len)
}
/* FIXME: Handle .s files differently (eg. # starts comments) --RR */
static int parse_file(const char *fname, struct md4_ctx *md)
static int parse_file(const signed char *fname, struct md4_ctx *md)
{
char *file;
signed char *file;
unsigned long i, len;
file = grab_file(fname, &len);
......@@ -332,7 +332,7 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md)
Sum all files in the same dir or subdirs.
*/
while ((line = get_next_line(&pos, file, flen)) != NULL) {
char* p = line;
signed char* p = line;
if (strncmp(line, "deps_", sizeof("deps_")-1) == 0) {
check_files = 1;
continue;
......@@ -456,7 +456,7 @@ static void write_version(const char *filename, const char *sum,
close(fd);
}
static int strip_rcs_crap(char *version)
static int strip_rcs_crap(signed char *version)
{
unsigned int len, full_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment