[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8e0409dd-0228-c15d-260c-b8d4e18eb07b@users.sourceforge.net>
Date: Wed, 20 Sep 2017 19:01:34 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-media@...r.kernel.org,
Arvind Yadav <arvind.yadav.cs@...il.com>,
Bhumika Goyal <bhumirks@...il.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Mike Isely <isely@...ox.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 4/5] [media] s2255drv: Use common error handling code in
read_pipe_completion()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 20 Sep 2017 17:45:13 +0200
Add a jump target so that a bit of exception handling can be better
reused at the end of this function.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/media/usb/s2255/s2255drv.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index 29bc73ad7d8a..5a5d5ae833ff 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -2065,11 +2065,9 @@ static void read_pipe_completion(struct urb *purb)
pipe_info = purb->context;
- if (!pipe_info) {
- dev_err(&purb->dev->dev, "no context!\n");
- return;
- }
+ if (!pipe_info)
+ goto report_failure;
+
dev = pipe_info->dev;
- if (!dev) {
- dev_err(&purb->dev->dev, "no context!\n");
- return;
- }
+ if (!dev)
+ goto report_failure;
+
status = purb->status;
@@ -2107,6 +2105,9 @@ static void read_pipe_completion(struct urb *purb)
dprintk(dev, 2, "%s :complete state 0\n", __func__);
}
return;
+
+report_failure:
+ dev_err(&purb->dev->dev, "no context!\n");
}
static int s2255_start_readpipe(struct s2255_dev *dev)
--
2.14.1
Powered by blists - more mailing lists