Skip to contentSkip to conversation

(10/11) netrom - convert /proc interface to seq_file

PATCH In review Stephen Hemminger 3 participants 5 messages Aug 13, 2003 – Aug 15, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 (10/11) netrom - convert /proc interface to seq_file

Convert netrom /proc interface to seq_file.

include/net/netrom.h +2 -2
diff -Nru a/include/net/netrom.h b/include/net/netrom.h
@@ -209,8 +209,8 @@
 extern int  nr_rt_ioctl(unsigned int, void *);
 extern void nr_link_failed(ax25_cb *, int);
 extern int  nr_route_frame(struct sk_buff *, ax25_cb *);
-extern int  nr_nodes_get_info(char *, char **, off_t, int);
-extern int  nr_neigh_get_info(char *, char **, off_t, int);
+extern struct file_operations nr_nodes_fops;
+extern struct file_operations nr_neigh_fops;
 extern void nr_rt_free(void);
 
 /* nr_subr.c */
net/netrom/af_netrom.c +70 -33

146 lines not on this page · raw message

net/netrom/nr_route.c +127 -53

234 lines not on this page · raw message

#1 lore raw

Em Wed, Aug 13, 2003 at 03:46:35PM -0700, Stephen Hemminger escreveu:

include/net/netrom.h

Quoted 9 lines

Convert netrom /proc interface to seq_file.

diff -Nru a/include/net/netrom.h b/include/net/netrom.h

include/net/netrom.h +4 -0
+		seq_printf(seq, "%-9s ", ax2asc(&nr->user_addr));
+		seq_printf(seq, "%-9s ", ax2asc(&nr->dest_addr));
+		seq_printf(seq, 
+"%-9s %-3s  %02X/%02X %02X/%02X %2d %3d %3d %3d %3lu/%03lu %2lu/%02lu %3lu/%03lu %3lu/%03lu %2d/%02d %3d %5d %5d %ld\n",

<nitpick> why not just one seq_printf call? </nitpick>

#2 lore raw
Quoted 12 lines · On Thu, 14 Aug 2003 14:25:39 -0300 Arnaldo Carvalho de Melo…

Em Wed, Aug 13, 2003 at 03:46:35PM -0700, Stephen Hemminger escreveu:

include/net/netrom.h

Quoted 9 lines

Convert netrom /proc interface to seq_file.

diff -Nru a/include/net/netrom.h b/include/net/netrom.h

include/net/netrom.h +4 -0
+		seq_printf(seq, "%-9s ", ax2asc(&nr->user_addr));
+		seq_printf(seq, "%-9s ", ax2asc(&nr->dest_addr));
+		seq_printf(seq, 
+"%-9s %-3s  %02X/%02X %02X/%02X %2d %3d %3d %3d %3lu/%03lu %2lu/%02lu %3lu/%03lu %3lu/%03lu %2d/%02d %3d %5d %5d %ld\n",

<nitpick> why not just one seq_printf call? </nitpick>

ax2asc() returns a pointer to static buffer.

#3 lore raw

Em Thu, Aug 14, 2003 at 11:30:25AM -0700, Stephen Hemminger escreveu:

Quoted 5 lines
Quoted 1 line · On Thu, 14 Aug 2003 14:25:39 -0300 Arnaldo Carvalho de Melo…

<nitpick> why not just one seq_printf call? </nitpick>

ax2asc() returns a pointer to static buffer.

argh :-\ Even if only for correctness shouldn't it receive a buffer, like snprintf, etc?

- Arnaldo

#4 lore raw

Arnaldo Carvalho de Melo <[email protected]> :
[ax2asc and the static buffer from hell]

Quoted 2 lines

argh :-\ Even if only for correctness shouldn't it receive a buffer, like snprintf, etc?

Then its name would be "ax2asc2".

--
Ueimor