projects
/
cascardo
/
kernel
/
samples
/
proc2
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Return pointers to the character, instead of the character itself.
[cascardo/kernel/samples/proc2/.git]
/
helloproc.c
diff --git
a/helloproc.c
b/helloproc.c
index
4fc799b
..
7e641a4
100644
(file)
--- 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;
*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)
}
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;
*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)
{
}
static int hp_show(struct seq_file *s, void *v)
{
- seq_putc(s,
(char)
v);
+ seq_putc(s,
*(char *)
v);
return 0;
}
return 0;
}