public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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>
Subject: [PATCH v1 3/3] parport: Drop unneeded NULL or 0 assignments
Date: Fri,  1 Sep 2023 16:42:50 +0300	[thread overview]
Message-ID: <20230901134250.1172990-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20230901134250.1172990-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


  parent reply	other threads:[~2023-09-01 13:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230901134310eucas1p1d9be610c894d46f19bb6c12576aef94b@eucas1p1.samsung.com>
2023-09-01 13:42 ` [PATCH v1 1/3] parport: Use kasprintf() instead of fixed buffer formatting Andy Shevchenko
2023-09-01 13:42   ` [PATCH v1 2/3] parport: Use list_for_each() helper Andy Shevchenko
2023-09-01 13:42   ` Andy Shevchenko [this message]
2023-09-04 13:11   ` [PATCH v1 1/3] parport: Use kasprintf() instead of fixed buffer formatting Joel Granados
2023-09-04 13:44     ` Andy Shevchenko
2023-10-02 13:06   ` Andy Shevchenko

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=20230901134250.1172990-3-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --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