From: Thadeu Lima de Souza Cascardo Date: Wed, 19 May 2010 19:25:46 +0000 (-0400) Subject: Return pointers to the character, instead of the character itself. X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fkernel%2Fsamples%2Fproc2%2F.git;a=commitdiff_plain;h=HEAD Return pointers to the character, instead of the character itself. --- diff --git a/helloproc.c b/helloproc.c index 4fc799b..7e641a4 100644 --- a/helloproc.c +++ b/helloproc.c @@ -30,7 +30,7 @@ static void *hp_start(struct seq_file *s, loff_t *pos) *pos += 1; if (hp_pos >= sizeof(hello)) return NULL; - return (void *) hello[hp_pos]; + return &hello[hp_pos]; } static void hp_stop(struct seq_file *s, void *v) @@ -44,12 +44,12 @@ static void *hp_next(struct seq_file *s, void *v, loff_t *pos) *pos += 1; if (hp_pos >= sizeof(hello)) return NULL; - return (void *) hello[hp_pos]; + return &hello[hp_pos]; } static int hp_show(struct seq_file *s, void *v) { - seq_putc(s, (char) v); + seq_putc(s, *(char *)v); return 0; }