Skip to content

Commit f7572e9

Browse files
andy-shevgregkh
authored andcommitted
parport: Drop unneeded NULL or 0 assignments
kzalloc() gives us a zeroed memory, no need to explicitly assing 0 or NULL or similar to the members of the data structure that has been allocated with the above mentioned API. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20231016133135.1203643-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b8cb855 commit f7572e9

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

drivers/parport/share.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,9 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
449449
tmp->irq = irq;
450450
tmp->dma = dma;
451451
tmp->muxport = tmp->daisy = tmp->muxsel = -1;
452-
tmp->modes = 0;
453452
INIT_LIST_HEAD(&tmp->list);
454-
tmp->devices = tmp->cad = NULL;
455-
tmp->flags = 0;
456453
tmp->ops = ops;
457454
tmp->physport = tmp;
458-
memset(tmp->probe_info, 0, 5 * sizeof(struct parport_device_info));
459455
rwlock_init(&tmp->cad_lock);
460456
spin_lock_init(&tmp->waitlist_lock);
461457
spin_lock_init(&tmp->pardevice_lock);

0 commit comments

Comments
 (0)