From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Luis Chamberlain <mcgrof@kernel.org>,
Joel Granados <j.granados@samsung.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [resend, PATCH v1 3/3] parport: Drop unneeded NULL or 0 assignments
Date: Mon, 16 Oct 2023 16:31:35 +0300 [thread overview]
Message-ID: <20231016133135.1203643-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20231016133135.1203643-1-andriy.shevchenko@linux.intel.com>
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>
---
drivers/parport/share.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index 38780f6a9119..a9a9cb0477ea 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -449,13 +449,9 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
tmp->irq = irq;
tmp->dma = dma;
tmp->muxport = tmp->daisy = tmp->muxsel = -1;
- tmp->modes = 0;
INIT_LIST_HEAD(&tmp->list);
- tmp->devices = tmp->cad = NULL;
- tmp->flags = 0;
tmp->ops = ops;
tmp->physport = tmp;
- memset(tmp->probe_info, 0, 5 * sizeof(struct parport_device_info));
rwlock_init(&tmp->cad_lock);
spin_lock_init(&tmp->waitlist_lock);
spin_lock_init(&tmp->pardevice_lock);
--
2.40.0.1.gaa8946217a0b
next prev parent reply other threads:[~2023-10-16 13:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-16 13:31 [resend, PATCH v1 0/3] parport: Switch to some modern APIs Andy Shevchenko
2023-10-16 13:31 ` [resend, PATCH v1 1/3] parport: Use kasprintf() instead of fixed buffer formatting Andy Shevchenko
2023-10-16 13:31 ` [resend, PATCH v1 2/3] parport: Use list_for_each() helper Andy Shevchenko
2023-10-16 13:31 ` Andy Shevchenko [this message]
2023-10-16 19:38 ` [resend, PATCH v1 0/3] parport: Switch to some modern APIs Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231016133135.1203643-4-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=j.granados@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox