[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061213211649.GA6307@hexapodia.org>
Date: Wed, 13 Dec 2006 13:16:49 -0800
From: Andy Isaacson <adi@...apodia.org>
To: Matt Mackall <mpm@...enic.com>
Cc: Keiichi KII <k-keiichi@...jp.nec.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 2.6.19 2/6] support multiple logging agents
On Tue, Dec 12, 2006 at 12:42:50PM -0600, Matt Mackall wrote:
> > + new_dev = (struct netconsole_device*)kmalloc(
> > + sizeof(struct netconsole_device), GFP_ATOMIC);
>
> Cast of void * is unnecessary.
Also,
1. use kzalloc rather than kmalloc+memset
2. use p = kzalloc(sizeof(*p) rather than p = kzalloc(sizeof(struct foo)
3. use goto to common error exit code rather than local return
> > + if (!new_dev) {
> > + printk(KERN_INFO "netconsole: kmalloc() failed!\n");
> > + kfree(netcon_dev_config);
> > + return -ENOMEM;
> > + }
> > + memset(new_dev, 0, sizeof(struct netconsole_device));
-andy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists