Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753692AbcJKKQ5 (ORCPT ); Tue, 11 Oct 2016 06:16:57 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:56792 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752822AbcJKKLj (ORCPT ); Tue, 11 Oct 2016 06:11:39 -0400 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Andy Lutomirski , Johannes Stezenbach , Jiri Kosina , Patrick Boettcher , Linux Kernel Mailing List , Andy Lutomirski , Michael Krufky , Mauro Carvalho Chehab , =?UTF-8?q?J=C3=B6rg=20Otte?= Subject: [PATCH v2 24/31] dvb-usb: warn if return value for USB read/write routines is not checked Date: Tue, 11 Oct 2016 07:09:39 -0300 Message-Id: <81bf337cfb66f34d6c7417cd363a11fd220bd284.1476179975.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1263 Lines: 31 the return values for dvb_usb_generic_rw() and dvb_usb_generic_write() should be checked, as otherwise the drivers won't be doing the right thing in the case of errors. So, add __must_check to both declarations. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/dvb-usb/dvb-usb.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/dvb-usb/dvb-usb.h b/drivers/media/usb/dvb-usb/dvb-usb.h index 639c4678c65b..1448c3d27ea2 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb.h +++ b/drivers/media/usb/dvb-usb/dvb-usb.h @@ -462,8 +462,10 @@ extern int dvb_usb_device_init(struct usb_interface *, extern void dvb_usb_device_exit(struct usb_interface *); /* the generic read/write method for device control */ -extern int dvb_usb_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16,int); -extern int dvb_usb_generic_write(struct dvb_usb_device *, u8 *, u16); +extern int __must_check +dvb_usb_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16, int); +extern int __must_check +dvb_usb_generic_write(struct dvb_usb_device *, u8 *, u16); /* commonly used remote control parsing */ extern int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *, u8[], u32 *, int *); -- 2.7.4