All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Ramakrishnan Muthukrishnan <ramakrmu@cisco.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Subject: [PATCH 07/11] [media] tm6000: remove needless check
Date: Fri,  5 Jun 2015 11:27:40 -0300	[thread overview]
Message-ID: <c849e2ce6d9085a6b3ee5c61db3d87a6ffa4c9b6.1433514004.git.mchehab@osg.samsung.com> (raw)
In-Reply-To: <cover.1433514004.git.mchehab@osg.samsung.com>
In-Reply-To: <cover.1433514004.git.mchehab@osg.samsung.com>

Smatch reports a warning:
	drivers/media/usb/tm6000/tm6000-video.c:646 tm6000_prepare_isoc() error: we previously assumed 'dev->urb_buffer' could be null (see line 624)

This is not really a problem, but it actually shows that the check
if urb_buffer is NULL is being done twice: at the if and at
tm6000_alloc_urb_buffers().

We don't need to do it twice. So, remove the extra check. The code
become cleaner, and, as a collateral effect, smatch becomes happy.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
index 77ce9efe1f24..5287d2960282 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -621,7 +621,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev)
 		    dev->isoc_in.maxsize, size);
 
 
-	if (!dev->urb_buffer && tm6000_alloc_urb_buffers(dev) < 0) {
+	if (tm6000_alloc_urb_buffers(dev) < 0) {
 		tm6000_err("cannot allocate memory for urb buffers\n");
 
 		/* call free, as some buffers might have been allocated */
-- 
2.4.2


  parent reply	other threads:[~2015-06-05 14:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 14:27 [PATCH 00/11] Some smatch fixups Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 0/9] " Mauro Carvalho Chehab
2015-06-05 14:43   ` Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 01/11] [media] drxk: better handle errors Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 02/11] [media] em28xx: remove dead code Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 03/11] [media] sh_vou: avoid going past arrays Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 04/11] [media] dib0090: Remove a dead code Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 05/11] [media] bt8xx: remove needless check Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 06/11] [media] ivtv: fix two smatch warnings Mauro Carvalho Chehab
2015-06-05 14:27 ` Mauro Carvalho Chehab [this message]
2015-06-05 14:27 ` [PATCH 08/11] [media] ir: Fix IR_MAX_DURATION enforcement Mauro Carvalho Chehab
2015-06-05 14:55   ` Sean Young
2015-06-05 15:00     ` Sean Young
2015-06-05 15:04       ` Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 09/11] [media] rc: set IR_MAX_DURATION to 500 ms Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 10/11] [media] usbvision: cleanup the code Mauro Carvalho Chehab
2015-06-05 14:27 ` [PATCH 11/11] [media] lirc_imon: simplify error handling code Mauro Carvalho Chehab

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=c849e2ce6d9085a6b3ee5c61db3d87a6ffa4c9b6.1433514004.git.mchehab@osg.samsung.com \
    --to=mchehab@osg.samsung.com \
    --cc=hans.verkuil@cisco.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=ramakrmu@cisco.com \
    --cc=sakari.ailus@linux.intel.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.