From: Dan Carpenter <error27@gmail.com>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: "Dean Anderson" <dean@sensoray.com>,
"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
"Mike Isely" <isely@pobox.com>,
"André Goddard Rosa" <andre.goddard@gmail.com>,
linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] video/s255drv: cleanup. remove uneeded NULL check
Date: Sun, 28 Mar 2010 11:29:09 +0000 [thread overview]
Message-ID: <20100328112909.GP5069@bicker> (raw)
"dev" can never be NULL there so there is no need to check it.
Also I made a couple of white space changes to the declaration of "dev".
This eliminates a smatch warning about checking for NULL after a
dereference.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index fb742f1..e70af5d 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -2582,8 +2582,9 @@ error:
/* disconnect routine. when board is removed physically or with rmmod */
static void s2255_disconnect(struct usb_interface *interface)
{
- struct s2255_dev *dev = NULL;
+ struct s2255_dev *dev;
int i;
+
dprintk(1, "s2255: disconnect interface %p\n", interface);
dev = usb_get_intfdata(interface);
@@ -2602,11 +2603,9 @@ static void s2255_disconnect(struct usb_interface *interface)
usb_set_intfdata(interface, NULL);
mutex_unlock(&dev->open_lock);
- if (dev) {
- kref_put(&dev->kref, s2255_destroy);
- dprintk(1, "s2255drv: disconnect\n");
- dev_info(&interface->dev, "s2255usb now disconnected\n");
- }
+ kref_put(&dev->kref, s2255_destroy);
+ dprintk(1, "s2255drv: disconnect\n");
+ dev_info(&interface->dev, "s2255usb now disconnected\n");
}
static struct usb_driver s2255_driver = {
next reply other threads:[~2010-03-28 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-28 11:29 Dan Carpenter [this message]
2010-03-29 15:54 ` [patch] video/s255drv: cleanup. remove uneeded NULL check David Ellingsworth
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=20100328112909.GP5069@bicker \
--to=error27@gmail.com \
--cc=andre.goddard@gmail.com \
--cc=dean@sensoray.com \
--cc=isely@pobox.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).