Skip to contentSkip to conversation

Remove member .name from struct netpoll

RFC Joe Perches 2 participants 2 messages Jul 1, 2011 – Jul 4, 2011

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

struct netpoll has member .name

struct netpoll {
	struct net_device *dev;
	char dev_name[IFNAMSIZ];
	const char *name;

[...]
};

that is set only by netconsole.c

static struct netconsole_target *alloc_param_target(char *target_config) {
[...]

	nt->np.name = "netconsole";

and used only by net/core/netpoll.c to emit "netconsole: " on logging messages.

e.g.

void netpoll_print_options(struct netpoll *np)

{
	printk(KERN_INFO "%s: local port %d\n",
			 np->name, np->local_port);

I think it'd be more common to use pr_fmt and pr_<level> to emit these logging messages.

Are there out of tree users or plans to use "struct netpoll" by other modules?

If not, I propose to remove name from the struct.

#1 lore raw
Quoted 11 lines · Joe Perches

struct netpoll has member .name

struct netpoll {
	struct net_device *dev;
	char dev_name[IFNAMSIZ];
	const char *name;

[...]
};

that is set only by netconsole.c

Quoted 8 lines

static struct netconsole_target *alloc_param_target(char *target_config) {
[...]

	nt->np.name = "netconsole";

and used only by net/core/netpoll.c to emit "netconsole: " on logging messages.

Probably this is due to that in history netdump was another user of it.

Quoted 4 lines

Are there out of tree users or plans to use "struct netpoll" by other modules?

AFAIK, netoops will use it too, see
https://lkml.org/lkml/2010/11/2/299

Cc'ing Matt in case I miss something...

Thanks.