Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18029
b: refs/heads/master
c: 7408187
h: refs/heads/master
i:
  18027: 0703a06
v: v3
  • Loading branch information
Panagiotis Issaris authored and Mauro Carvalho Chehab committed Jan 11, 2006
1 parent 5fba614 commit 8a0d228
Show file tree
Hide file tree
Showing 83 changed files with 119 additions and 255 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b3af1b6df82cfdb54ae294ed860263011fa0408
refs/heads/master: 7408187d223f63d46a13b6a35b8f96b032c2f623
9 changes: 3 additions & 6 deletions trunk/drivers/media/common/saa7146_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
struct page *pg;
int i;

sglist = kmalloc(sizeof(struct scatterlist)*nr_pages, GFP_KERNEL);
sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL);
if (NULL == sglist)
return NULL;
memset(sglist,0,sizeof(struct scatterlist)*nr_pages);
for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) {
pg = vmalloc_to_page(virt);
if (NULL == pg)
Expand Down Expand Up @@ -306,15 +305,13 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
struct saa7146_dev *dev;
int err = -ENOMEM;

dev = kmalloc(sizeof(struct saa7146_dev), GFP_KERNEL);
/* clear out mem for sure */
dev = kzalloc(sizeof(struct saa7146_dev), GFP_KERNEL);
if (!dev) {
ERR(("out of memory.\n"));
goto out;
}

/* clear out mem for sure */
memset(dev, 0x0, sizeof(struct saa7146_dev));

DEB_EE(("pci:%p\n",pci));

err = pci_enable_device(pci);
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/media/common/saa7146_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,12 @@ static int fops_open(struct inode *inode, struct file *file)
}

/* allocate per open data */
fh = kmalloc(sizeof(*fh),GFP_KERNEL);
fh = kzalloc(sizeof(*fh),GFP_KERNEL);
if (NULL == fh) {
DEB_S(("cannot allocate memory for per open data.\n"));
result = -ENOMEM;
goto out;
}
memset(fh,0,sizeof(*fh));

file->private_data = fh;
fh->dev = dev;
Expand Down Expand Up @@ -464,12 +463,11 @@ static struct video_device device_template =

int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
{
struct saa7146_vv *vv = kmalloc (sizeof(struct saa7146_vv),GFP_KERNEL);
struct saa7146_vv *vv = kzalloc (sizeof(struct saa7146_vv),GFP_KERNEL);
if( NULL == vv ) {
ERR(("out of memory. aborting.\n"));
return -1;
}
memset(vv, 0x0, sizeof(*vv));

DEB_EE(("dev:%p\n",dev));

Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/media/dvb/b2c2/flexcop.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,18 @@ EXPORT_SYMBOL(flexcop_reset_block_300);
struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len)
{
void *bus;
struct flexcop_device *fc = kmalloc(sizeof(struct flexcop_device), GFP_KERNEL);
struct flexcop_device *fc = kzalloc(sizeof(struct flexcop_device), GFP_KERNEL);
if (!fc) {
err("no memory");
return NULL;
}
memset(fc, 0, sizeof(struct flexcop_device));

bus = kmalloc(bus_specific_len, GFP_KERNEL);
bus = kzalloc(bus_specific_len, GFP_KERNEL);
if (!bus) {
err("no memory");
kfree(fc);
return NULL;
}
memset(bus, 0, bus_specific_len);

fc->bus_specific = bus;

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,9 @@ static int dvb_bt8xx_probe(struct device *dev)
struct pci_dev* bttv_pci_dev;
int ret;

if (!(card = kmalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
return -ENOMEM;

memset(card, 0, sizeof(*card));
init_MUTEX(&card->lock);
card->bttv_nr = sub->core->nr;
strncpy(card->card_name, sub->core->name, sizeof(sub->core->name));
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
Original file line number Diff line number Diff line change
Expand Up @@ -1649,21 +1649,17 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
return -EINVAL;

/* initialise the system data */
if ((ca =
(struct dvb_ca_private *) kmalloc(sizeof(struct dvb_ca_private),
GFP_KERNEL)) == NULL) {
if ((ca = kzalloc(sizeof(struct dvb_ca_private), GFP_KERNEL)) == NULL) {
ret = -ENOMEM;
goto error;
}
memset(ca, 0, sizeof(struct dvb_ca_private));
ca->pub = pubca;
ca->flags = flags;
ca->slot_count = slot_count;
if ((ca->slot_info = kmalloc(sizeof(struct dvb_ca_slot) * slot_count, GFP_KERNEL)) == NULL) {
if ((ca->slot_info = kcalloc(slot_count, sizeof(struct dvb_ca_slot), GFP_KERNEL)) == NULL) {
ret = -ENOMEM;
goto error;
}
memset(ca->slot_info, 0, sizeof(struct dvb_ca_slot) * slot_count);
init_waitqueue_head(&ca->wait_queue);
ca->thread_pid = 0;
init_waitqueue_head(&ca->thread_queue);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,13 +1024,12 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
if (down_interruptible (&frontend_mutex))
return -ERESTARTSYS;

fe->frontend_priv = kmalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL);
fe->frontend_priv = kzalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL);
if (fe->frontend_priv == NULL) {
up(&frontend_mutex);
return -ENOMEM;
}
fepriv = fe->frontend_priv;
memset(fe->frontend_priv, 0, sizeof(struct dvb_frontend_private));

init_MUTEX (&fepriv->sem);
init_waitqueue_head (&fepriv->wait_queue);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/dvb-usb/dtt200u-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,9 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d)
struct dtt200u_fe_state* state = NULL;

/* allocate memory for the internal state */
state = (struct dtt200u_fe_state*) kmalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
if (state == NULL)
goto error;
memset(state,0,sizeof(struct dtt200u_fe_state));

deb_info("attaching frontend dtt200u\n");

Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/media/dvb/dvb-usb/dvb-usb-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,26 +154,24 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties
}

info("found a '%s' in warm state.",desc->name);
d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL);
d = kzalloc(sizeof(struct dvb_usb_device),GFP_KERNEL);
if (d == NULL) {
err("no memory for 'struct dvb_usb_device'");
return ret;
}
memset(d,0,sizeof(struct dvb_usb_device));

d->udev = udev;
memcpy(&d->props,props,sizeof(struct dvb_usb_properties));
d->desc = desc;
d->owner = owner;

if (d->props.size_of_priv > 0) {
d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL);
d->priv = kzalloc(d->props.size_of_priv,GFP_KERNEL);
if (d->priv == NULL) {
err("no memory for priv in 'struct dvb_usb_device'");
kfree(d);
return -ENOMEM;
}
memset(d->priv,0,d->props.size_of_priv);
}

usb_set_intfdata(intf, d);
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,13 @@ static int dvb_usb_allocate_stream_buffers(struct dvb_usb_device *d, int num, un

deb_mem("all in all I will use %lu bytes for streaming\n",num*size);

if ((d->buf_list = kmalloc(num*sizeof(u8 *), GFP_ATOMIC)) == NULL)
if ((d->buf_list = kcalloc(num, sizeof(u8 *), GFP_ATOMIC)) == NULL)
return -ENOMEM;

if ((d->dma_addr = kmalloc(num*sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) {
if ((d->dma_addr = kcalloc(num, sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) {
kfree(d->buf_list);
return -ENOMEM;
}
memset(d->buf_list,0,num*sizeof(u8 *));
memset(d->dma_addr,0,num*sizeof(dma_addr_t));

d->state |= DVB_USB_STATE_URB_BUF;

Expand Down Expand Up @@ -285,10 +283,9 @@ int dvb_usb_urb_init(struct dvb_usb_device *d)
usb_clear_halt(d->udev,usb_rcvbulkpipe(d->udev,d->props.urb.endpoint));

/* allocate the array for the data transfer URBs */
d->urb_list = kmalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL);
d->urb_list = kzalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL);
if (d->urb_list == NULL)
return -ENOMEM;
memset(d->urb_list,0,d->props.urb.count * sizeof(struct urb *));
d->state |= DVB_USB_STATE_URB_LIST;

switch (d->props.urb.type) {
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/dvb-usb/vp702x-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,9 @@ static struct dvb_frontend_ops vp702x_fe_ops;

struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d)
{
struct vp702x_fe_state *s = kmalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL);
struct vp702x_fe_state *s = kzalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL);
if (s == NULL)
goto error;
memset(s,0,sizeof(struct vp702x_fe_state));

s->d = d;
s->fe.ops = &vp702x_fe_ops;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/dvb-usb/vp7045-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ static struct dvb_frontend_ops vp7045_fe_ops;

struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d)
{
struct vp7045_fe_state *s = kmalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL);
struct vp7045_fe_state *s = kzalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL);
if (s == NULL)
goto error;
memset(s,0,sizeof(struct vp7045_fe_state));

s->d = d;
s->fe.ops = &vp7045_fe_ops;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/frontends/bcm3510.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,10 +782,9 @@ struct dvb_frontend* bcm3510_attach(const struct bcm3510_config *config,
bcm3510_register_value v;

/* allocate memory for the internal state */
state = kmalloc(sizeof(struct bcm3510_state), GFP_KERNEL);
state = kzalloc(sizeof(struct bcm3510_state), GFP_KERNEL);
if (state == NULL)
goto error;
memset(state,0,sizeof(struct bcm3510_state));

/* setup the state */

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/frontends/dib3000mb.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,9 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
struct dib3000_state* state = NULL;

/* allocate memory for the internal state */
state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL);
state = kzalloc(sizeof(struct dib3000_state), GFP_KERNEL);
if (state == NULL)
goto error;
memset(state,0,sizeof(struct dib3000_state));

/* setup the state */
state->i2c = i2c;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/frontends/dib3000mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,9 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config,
u16 devid;

/* allocate memory for the internal state */
state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL);
state = kzalloc(sizeof(struct dib3000_state), GFP_KERNEL);
if (state == NULL)
goto error;
memset(state,0,sizeof(struct dib3000_state));

/* setup the state */
state->i2c = i2c;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/frontends/lgdt330x.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,9 @@ struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
u8 buf[1];

/* Allocate memory for the internal state */
state = (struct lgdt330x_state*) kmalloc(sizeof(struct lgdt330x_state), GFP_KERNEL);
state = kzalloc(sizeof(struct lgdt330x_state), GFP_KERNEL);
if (state == NULL)
goto error;
memset(state,0,sizeof(*state));

/* Setup the state */
state->config = config;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/frontends/mt352.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,8 @@ struct dvb_frontend* mt352_attach(const struct mt352_config* config,
struct mt352_state* state = NULL;

/* allocate memory for the internal state */
state = kmalloc(sizeof(struct mt352_state), GFP_KERNEL);
state = kzalloc(sizeof(struct mt352_state), GFP_KERNEL);
if (state == NULL) goto error;
memset(state,0,sizeof(*state));

/* setup the state */
state->i2c = i2c;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/frontends/nxt200x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,10 +1110,9 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config,
u8 buf [] = {0,0,0,0,0};

/* allocate memory for the internal state */
state = (struct nxt200x_state*) kmalloc(sizeof(struct nxt200x_state), GFP_KERNEL);
state = kzalloc(sizeof(struct nxt200x_state), GFP_KERNEL);
if (state == NULL)
goto error;
memset(state,0,sizeof(*state));

/* setup the state */
state->config = config;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/dvb/pluto2/pluto2.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,10 @@ static int __devinit pluto2_probe(struct pci_dev *pdev,
struct dmx_demux *dmx;
int ret = -ENOMEM;

pluto = kmalloc(sizeof(struct pluto), GFP_KERNEL);
pluto = kzalloc(sizeof(struct pluto), GFP_KERNEL);
if (!pluto)
goto out;

memset(pluto, 0, sizeof(struct pluto));
pluto->pdev = pdev;

ret = pci_enable_device(pdev);
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/media/dvb/ttpci/av7110.c
Original file line number Diff line number Diff line change
Expand Up @@ -2565,14 +2565,12 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
}

/* prepare the av7110 device struct */
av7110 = kmalloc(sizeof(struct av7110), GFP_KERNEL);
av7110 = kzalloc(sizeof(struct av7110), GFP_KERNEL);
if (!av7110) {
dprintk(1, "out of memory\n");
return -ENOMEM;
}

memset(av7110, 0, sizeof(struct av7110));

av7110->card_name = (char*) pci_ext->ext_priv;
av7110->dev = dev;
dev->ext_priv = av7110;
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/media/dvb/ttpci/budget-av.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,11 +1027,9 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio

dprintk(2, "dev: %p\n", dev);

if (!(budget_av = kmalloc(sizeof(struct budget_av), GFP_KERNEL)))
if (!(budget_av = kzalloc(sizeof(struct budget_av), GFP_KERNEL)))
return -ENOMEM;

memset(budget_av, 0, sizeof(struct budget_av));

budget_av->has_saa7113 = 0;
budget_av->budget.ci_present = 0;

Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,11 +1489,9 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i

if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV;

if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL)))
if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL)))
return -ENOMEM;

memset(ttusb, 0, sizeof(struct ttusb));

ttusb->dev = udev;
ttusb->c = 0;
ttusb->mux_state = 0;
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/media/dvb/ttusb-dec/ttusb_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1606,15 +1606,13 @@ static int ttusb_dec_probe(struct usb_interface *intf,

udev = interface_to_usbdev(intf);

if (!(dec = kmalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) {
if (!(dec = kzalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) {
printk("%s: couldn't allocate memory.\n", __FUNCTION__);
return -ENOMEM;
}

usb_set_intfdata(intf, (void *)dec);

memset(dec, 0, sizeof(struct ttusb_dec));

switch (le16_to_cpu(id->idProduct)) {
case 0x1006:
ttusb_dec_set_model(dec, TTUSB_DEC3000S);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/media/radio/radio-gemtek-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,10 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci
struct gemtek_pci_card *card;
struct video_device *devradio;

if ( (card = kmalloc( sizeof( struct gemtek_pci_card ), GFP_KERNEL )) == NULL ) {
if ( (card = kzalloc( sizeof( struct gemtek_pci_card ), GFP_KERNEL )) == NULL ) {
printk( KERN_ERR "gemtek_pci: out of memory\n" );
return -ENOMEM;
}
memset( card, 0, sizeof( struct gemtek_pci_card ) );

if ( pci_enable_device( pci_dev ) )
goto err_pci;
Expand Down
Loading

0 comments on commit 8a0d228

Please sign in to comment.