All of lore.kernel.org
 help / color / mirror / Atom feed
From: Todd Poynor <toddpoynor@gmail.com>
To: Rob Springer <rspringer@google.com>,
	John Joseph <jnjoseph@google.com>,
	Ben Chan <benchan@chromium.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Todd Poynor <toddpoynor@google.com>
Subject: [PATCH 3/5] staging: gasket: sysfs: remove unnecessary NULL check on device ptr
Date: Fri, 27 Jul 2018 22:21:58 -0700	[thread overview]
Message-ID: <20180728052200.228796-4-toddpoynor@gmail.com> (raw)
In-Reply-To: <20180728052200.228796-1-toddpoynor@gmail.com>

From: Todd Poynor <toddpoynor@google.com>

The device pointer passed into get_mapping() will never be NULL; the
check is unnecessary.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
---
 drivers/staging/gasket/gasket_sysfs.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/gasket/gasket_sysfs.c b/drivers/staging/gasket/gasket_sysfs.c
index 2d8647de697cd..da972ce0e0db0 100644
--- a/drivers/staging/gasket/gasket_sysfs.c
+++ b/drivers/staging/gasket/gasket_sysfs.c
@@ -67,11 +67,6 @@ static struct gasket_sysfs_mapping *get_mapping(struct device *device)
 {
 	int i;
 
-	if (!device) {
-		pr_debug("%s: Received NULL device\n", __func__);
-		return NULL;
-	}
-
 	for (i = 0; i < GASKET_SYSFS_NUM_MAPPINGS; i++) {
 		mutex_lock(&dev_mappings[i].mutex);
 		if (dev_mappings[i].device == device) {
-- 
2.18.0.345.g5c9ce644c3-goog


  parent reply	other threads:[~2018-07-28  5:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-28  5:21 [PATCH 0/5] staging: gasket: fixes and cleanups Todd Poynor
2018-07-28  5:21 ` [PATCH 1/5] staging: gasket: sysfs: remove check for refcount already zero Todd Poynor
2018-07-28  5:21 ` [PATCH 2/5] staging: gasket: apex: fixup undefined PCI class Todd Poynor
2018-07-28  5:21 ` Todd Poynor [this message]
2018-07-28  5:21 ` [PATCH 4/5] staging: gasket: page table: remove code for "no dma_ops" Todd Poynor
2018-07-28  5:22 ` [PATCH 5/5] staging: gasket: core: hold reference on device kobj while in use Todd Poynor
2018-07-28  7:23   ` Greg Kroah-Hartman

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=20180728052200.228796-4-toddpoynor@gmail.com \
    --to=toddpoynor@gmail.com \
    --cc=benchan@chromium.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jnjoseph@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rspringer@google.com \
    --cc=toddpoynor@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.