Commit 078d9fe4 authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman

[PATCH] i2c: kzalloc cleanups, 1 of 2

Drop useless casts on kzalloc returned values, as suggested by
Jiri Slaby.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5263ebb5
...@@ -535,7 +535,7 @@ create_iface(struct device_node *np, struct device *dev) ...@@ -535,7 +535,7 @@ create_iface(struct device_node *np, struct device *dev)
tsize = sizeof(struct keywest_iface) + tsize = sizeof(struct keywest_iface) +
(sizeof(struct keywest_chan) + 4) * nchan; (sizeof(struct keywest_chan) + 4) * nchan;
iface = (struct keywest_iface *) kzalloc(tsize, GFP_KERNEL); iface = kzalloc(tsize, GFP_KERNEL);
if (iface == NULL) { if (iface == NULL) {
printk(KERN_ERR "i2c-keywest: can't allocate inteface !\n"); printk(KERN_ERR "i2c-keywest: can't allocate inteface !\n");
pmac_low_i2c_unlock(np); pmac_low_i2c_unlock(np);
......
...@@ -313,8 +313,7 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_ ...@@ -313,8 +313,7 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_
int res1, res2; int res1, res2;
/* we support 2 SMBus adapters */ /* we support 2 SMBus adapters */
if (!(smbuses = (void *)kzalloc(2*sizeof(struct nforce2_smbus), if (!(smbuses = kzalloc(2*sizeof(struct nforce2_smbus), GFP_KERNEL)))
GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
pci_set_drvdata(dev, smbuses); pci_set_drvdata(dev, smbuses);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment