9
0
Fork 0

Cosmetic fixes, including format attributes for printf() and friends.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Krzysztof Halasa 2010-12-21 00:02:02 +01:00 committed by Sascha Hauer
parent b754bc4cf0
commit d66ae58cd8
10 changed files with 22 additions and 22 deletions

View File

@ -134,7 +134,7 @@ static int do_crc(struct command *cmdtp, int argc, char *argv[])
#endif
if (verify && crc != vcrc) {
printf(" != 0x%08x ** ERROR **", vcrc);
printf(" != 0x%08lx ** ERROR **", vcrc);
err = 1;
}

View File

@ -63,7 +63,7 @@ static int do_flerase(struct command *cmdtp, int argc, char *argv[])
fd = open(filename, O_WRONLY);
if (fd < 0) {
printf("open %s:", filename, errno_str());
printf("open %s: %s", filename, errno_str());
return 1;
}
@ -139,7 +139,7 @@ static int do_protect(struct command *cmdtp, int argc, char *argv[])
fd = open(filename, O_WRONLY);
if (fd < 0) {
printf("open %s:", filename, errno_str());
printf("open %s: %s", filename, errno_str());
return 1;
}

View File

@ -55,7 +55,7 @@ static int do_go(struct command *cmdtp, int argc, char *argv[])
} else
addr = (void *)simple_strtoul(argv[1], NULL, 16);
printf("## Starting application at 0x%08lX ...\n", addr);
printf("## Starting application at 0x%p ...\n", addr);
console_flush();

View File

@ -625,7 +625,6 @@ static ulong load_serial_ymodem(void)
int res, wr;
connection_info_t info;
char ymodemBuf[1024];
ulong store_addr = ~0;
ulong addr = 0;
size = 0;

View File

@ -32,10 +32,10 @@
static void ls_one(const char *path, struct stat *s)
{
char modestr[11];
unsigned long namelen = strlen(path);
unsigned int namelen = strlen(path);
mkmodestr(s->st_mode, modestr);
printf("%s %10u %*.*s\n", modestr, s->st_size, namelen, namelen, path);
printf("%s %10lu %*.*s\n", modestr, s->st_size, namelen, namelen, path);
}
int ls(const char *path, ulong flags)

View File

@ -119,7 +119,7 @@ static int do_menu_entry_remove(struct cmd_menu *cm)
me = menu_entry_get_by_num(m, cm->num);
if (!me) {
eprintf("Entry '%s' not found\n", cm->num);
eprintf("Entry '%i' not found\n", cm->num);
return -EINVAL;
}

View File

@ -7,7 +7,6 @@
#include <mach/netx-eth.h>
#include <mach/netx-regs.h>
#include <xfuncs.h>
#include <miidev.h>
#include <init.h>
#include <driver.h>

View File

@ -485,7 +485,7 @@ static int __cfi_erase(struct cdev *cdev, size_t count, unsigned long offset,
unsigned long start, end;
int i, ret = 0;
debug("%s: erase 0x%08x (size %d)\n", __func__, offset, count);
debug("%s: erase 0x%08lx (size %d)\n", __func__, offset, count);
start = find_sector(finfo, cdev->dev->map_base + offset);
end = find_sector(finfo, cdev->dev->map_base + offset + count - 1);
@ -656,8 +656,8 @@ static int cfi_protect(struct cdev *cdev, size_t count, unsigned long offset, in
int i, ret = 0;
const char *action = (prot? "protect" : "unprotect");
printf("%s: %s 0x%08x (size %d)\n", __FUNCTION__,
action, cdev->dev->map_base + offset, count);
printf("%s: %s 0x%08lx (size %d)\n", __FUNCTION__,
action, cdev->dev->map_base + offset, count);
start = find_sector(finfo, cdev->dev->map_base + offset);
end = find_sector(finfo, cdev->dev->map_base + offset + count - 1);
@ -1012,7 +1012,7 @@ static int cfi_probe (struct device_d *dev)
info->base = (void __iomem *)dev->map_base;
if (dev->size == 0) {
printf("cfi_probe: size : 0x%08x\n", info->size);
printf("cfi_probe: size : 0x%08lx\n", info->size);
dev->size = info->size;
}

View File

@ -9,7 +9,7 @@
*/
/* serial stuff */
void serial_printf (const char *fmt, ...);
void serial_printf(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
/* stdin */
int tstc(void);
@ -20,20 +20,22 @@ int getc(void);
void console_puts(unsigned int ch, const char *s);
void console_flush(void);
static inline void puts(const char *s) {
static inline void puts(const char *s)
{
console_puts(CONSOLE_STDOUT, s);
}
static inline void putchar(char c) {
static inline void putchar(char c)
{
console_putc(CONSOLE_STDOUT, c);
}
int printf(const char *fmt, ...);
int printf(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
int vprintf(const char *fmt, va_list args);
int sprintf(char * buf, const char *fmt, ...);
int snprintf(char *buf, size_t size, const char *fmt, ...);
int sprintf(char *buf, const char *fmt, ...) __attribute__ ((format(printf, 2, 3)));
int snprintf(char *buf, size_t size, const char *fmt, ...) __attribute__ ((format(printf, 3, 4)));
int vsprintf(char *buf, const char *fmt, va_list args);
char *asprintf(const char *fmt, ...);
char *asprintf(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
char *vasprintf(const char *fmt, va_list ap);
int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
@ -52,7 +54,7 @@ int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
#define stderr 2
#define MAX_FILES 128
void fprintf(int file, const char *fmt, ...);
void fprintf(int file, const char *fmt, ...) __attribute__ ((format(printf, 2, 3)));
int fputs(int file, const char *s);
int fputc(int file, const char c);
int ftstc(int file);

View File

@ -218,7 +218,7 @@ static void tftp_handler(char *packet, unsigned len)
tftp_last_block = 0;
if (tftp_block != 1) { /* Assertion */
printf("error: First block is not block 1 (%ld)\n",
printf("error: First block is not block 1 (%d)\n",
tftp_block);
tftp_err = -EINVAL;
tftp_state = STATE_DONE;