Fixes to the seq_file document

On Friday 2008-03-28 19:20, Jonathan Corbet wrote:
>commit 9756ccfda31b4c4544aa010aacf71b6672d668e8
>Date: Fri Mar 28 11:19:56 2008 -0600
>
> Add the seq_file documentation

patch on top:

- add const qualifiers
- remove void* casts
- use proper specifier (%Ld is not valid)

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>

authored by Jan Engelhardt and committed by Jonathan Corbet f3271f65 ef40203a

+7 -7
+7 -7
Documentation/filesystems/seq_file.txt
··· 107 107 108 108 static void *ct_seq_next(struct seq_file *s, void *v, loff_t *pos) 109 109 { 110 - loff_t *spos = (loff_t *) v; 111 - *pos = ++(*spos); 110 + loff_t *spos = v; 111 + *pos = ++*spos; 112 112 return spos; 113 113 } 114 114 ··· 127 127 128 128 static int ct_seq_show(struct seq_file *s, void *v) 129 129 { 130 - loff_t *spos = (loff_t *) v; 131 - seq_printf(s, "%Ld\n", *spos); 130 + loff_t *spos = v; 131 + seq_printf(s, "%lld\n", (long long)*spos); 132 132 return 0; 133 133 } 134 134 ··· 136 136 seq_file iterator is finished by creating a seq_operations structure with 137 137 the four functions we have just defined: 138 138 139 - static struct seq_operations ct_seq_ops = { 139 + static const struct seq_operations ct_seq_ops = { 140 140 .start = ct_seq_start, 141 141 .next = ct_seq_next, 142 142 .stop = ct_seq_stop, ··· 204 204 static int ct_open(struct inode *inode, struct file *file) 205 205 { 206 206 return seq_open(file, &ct_seq_ops); 207 - }; 207 + } 208 208 209 209 Here, the call to seq_open() takes the seq_operations structure we created 210 210 before, and gets set up to iterate through the virtual file. ··· 219 219 all implemented by the seq_file code itself. So a virtual file's 220 220 file_operations structure will look like: 221 221 222 - static struct file_operations ct_file_ops = { 222 + static const struct file_operations ct_file_ops = { 223 223 .owner = THIS_MODULE, 224 224 .open = ct_open, 225 225 .read = seq_read,