Skip to content

Commit 421359c

Browse files
andy-shevgregkh
authored andcommitted
parport: Drop even more 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. Note, the initializstion of full_list member is not needed anymore as list_add_tail will rewrite the contents of the prev and next pointers. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20231018145948.1367648-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 12280cc commit 421359c

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

drivers/parport/share.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
459459
sema_init(&tmp->ieee1284.irq, 0);
460460
tmp->spintime = parport_default_spintime;
461461
atomic_set(&tmp->ref_count, 1);
462-
INIT_LIST_HEAD(&tmp->full_list);
463462

464463
/* Search for the lowest free parport number. */
465464

@@ -489,8 +488,6 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
489488
/* assume the worst */
490489
tmp->probe_info[device].class = PARPORT_CLASS_LEGACY;
491490

492-
tmp->waithead = tmp->waittail = NULL;
493-
494491
ret = device_register(&tmp->bus_dev);
495492
if (ret) {
496493
put_device(&tmp->bus_dev);

0 commit comments

Comments
 (0)