drivers/macintosh: Conversions from kmalloc/memset to kzalloc.
Subsystems (2)
PATCH 1/1 drivers/macintosh: Conversions from kmalloc/memset to kzalloc.
drivers/macintosh: Conversion from kmalloc/memset to kzalloc.
Signed-off-by Panagiotis Issaris <[email protected]>
---
drivers/macintosh/macio_asic.c | 3 +-- drivers/macintosh/smu.c | 3 +-- drivers/macintosh/therm_adt746x.c | 5 +---- drivers/macintosh/therm_pm72.c | 3 +-- drivers/macintosh/therm_windtunnel.c | 3 +-- drivers/macintosh/windfarm_lm75_sensor.c | 3 +-- 6 files changed, 6 insertions(+), 14 deletions(-)
applies-to: 3d8c8b2fd07ad2c1df959421121451207373f78f 08cda0f8be0769031ce5060c3c8f52f71e341281
drivers/macintosh/macio_asic.c +1 -2
@@ -305,10 +305,9 @@ static struct macio_dev * macio_add_one_if (np ==NULL )return NULL ; - dev =kmalloc (sizeof (*dev),GFP_KERNEL ); + dev =kzalloc (sizeof (*dev),GFP_KERNEL );if (!dev)return NULL ; -memset (dev,0 ,sizeof (*dev)); dev->bus = &chip->lbus; dev->media_bay = in_bay;
drivers/macintosh/smu.c +1 -2
@@ -1032,10 +1032,9 @@ static int smu_open(struct inode *inode,struct smu_private *pp;unsigned long flags; - pp =kmalloc (sizeof (struct smu_private ),GFP_KERNEL ); + pp =kzalloc (sizeof (struct smu_private ),GFP_KERNEL );if (pp ==0 )return -ENOMEM ; -memset (pp,0 ,sizeof (struct smu_private ));spin_lock_init (&pp->lock); pp->mode = smu_file_commands;init_waitqueue_head (&pp->wait);
drivers/macintosh/therm_adt746x.c +1 -4
@@ -370,13 +370,10 @@ static int attach_one_thermostat(structif (thermostat)return 0 ; - th = (struct thermostat *) -kmalloc (sizeof (struct thermostat ),GFP_KERNEL ); - + th =kzalloc (sizeof (struct thermostat ),GFP_KERNEL );if (!th)return -ENOMEM ; -memset (th,0 ,sizeof (*th)); th->clt.addr = addr; th->clt.adapter = adapter; th->clt.driver = &thermostat_driver;
drivers/macintosh/therm_pm72.c +1 -2
@@ -308,10 +308,9 @@ static struct i2c_client *attach_i2c_chiif (adap ==NULL )return NULL ; - clt =kmalloc (sizeof (struct i2c_client ),GFP_KERNEL ); + clt =kzalloc (sizeof (struct i2c_client ),GFP_KERNEL );if (clt ==NULL )return NULL ; -memset (clt,0 ,sizeof (struct i2c_client )); clt->addr = (id >>1 ) &0x7f ; clt->adapter = adap;
drivers/macintosh/therm_windtunnel.c +1 -2
@@ -431,9 +431,8 @@ do_probe( struct i2c_adapter *adapter, i | I2C_FUNC_SMBUS_WRITE_BYTE) )return 0 ; -if ( !(cl=kmalloc (sizeof (*cl),GFP_KERNEL )) ) +if ( !(cl=kzalloc (sizeof (*cl),GFP_KERNEL )) )return -ENOMEM ; -memset ( cl,0 ,sizeof (struct i2c_client ) ); cl->addr = addr; cl->adapter = adapter;
drivers/macintosh/windfarm_lm75_sensor.c +1 -2
@@ -116,10 +116,9 @@ static struct wf_lm75_sensor *wf_lm75_crDBG ("wf_lm75: creating %s device at address 0x%02x\n" , ds1775 ?"ds1775" :"lm75" , addr); - lm =kmalloc (sizeof (struct wf_lm75_sensor ),GFP_KERNEL ); + lm =kzalloc (sizeof (struct wf_lm75_sensor ),GFP_KERNEL );if (lm ==NULL )return NULL ; -memset (lm,0 ,sizeof (struct wf_lm75_sensor ));/* Usual rant about sensor names not beeing very consistent in * the device-tree, oh well ...
---
0.99.9.GIT