On Thu, 2010-11-11 at 20:07 -0500, Dan Rosenberg wrote: > diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c > index 1f85ef2..0ac8ff2 100644 > --- a/net/ipv4/raw.c > +++ b/net/ipv4/raw.c [...] > + /* Only expose kernel addresses to privileged readers */ > + if (capable(CAP_NET_ADMIN)) > + seq_printf(seq, "%4d: %08X:%04X %08X:%04X" > + " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d\n", > + i, src, srcp, dest, destp, sp->sk_state, > + sk_wmem_alloc_get(sp), > + sk_rmem_alloc_get(sp), > + 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), > + atomic_read(&sp->sk_refcnt), > + sp, atomic_read(&sp->sk_drops)); > + else > + seq_printf(seq, "%4d: %08X:%04X %08X:%04X" > + " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %d %d\n", > + i, src, srcp, dest, destp, sp->sk_state, > + sk_wmem_alloc_get(sp), > + sk_rmem_alloc_get(sp), > + 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), > + atomic_read(&sp->sk_refcnt), > + 0, atomic_read(&sp->sk_drops)); [...] This could just be written as: seq_printf(seq, "%4d: %08X:%04X %08X:%04X" " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %lx %d\n", i, src, srcp, dest, destp, sp->sk_state, sk_wmem_alloc_get(sp), sk_rmem_alloc_get(sp), 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), atomic_read(&sp->sk_refcnt), capable(CAP_NET_ADMIN) ? (unsigned long)sp : 0UL, atomic_read(&sp->sk_drops)); Similarly for other formats that you want to make conditional on CAP_NET_ADMIN. Ben. -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked. -- To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html