[PATCH 3/6] staging: most: cdev: remove overcautious parameter checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The interface pointer passed to a component API function cannot be NULL.
This patch removes unnecessary sanity checks of the pointer.

Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx>
---
 drivers/staging/most/cdev/cdev.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/most/cdev/cdev.c b/drivers/staging/most/cdev/cdev.c
index 394c762..9fc84fa 100644
--- a/drivers/staging/most/cdev/cdev.c
+++ b/drivers/staging/most/cdev/cdev.c
@@ -324,9 +324,6 @@ static int comp_disconnect_channel(struct most_interface *iface, int channel_id)
 {
 	struct comp_channel *c;
 
-	if (!iface)
-		return -EINVAL;
-
 	c = get_channel(iface, channel_id);
 	if (!c)
 		return -ENXIO;
@@ -391,9 +388,6 @@ static int comp_tx_completion(struct most_interface *iface, int channel_id)
 {
 	struct comp_channel *c;
 
-	if (!iface)
-		return -EINVAL;
-
 	c = get_channel(iface, channel_id);
 	if (!c)
 		return -ENXIO;
@@ -426,7 +420,7 @@ static int comp_probe(struct most_interface *iface, int channel_id,
 	int retval;
 	int current_minor;
 
-	if ((!iface) || (!cfg) || (!name))
+	if ((!cfg) || (!name))
 		return -EINVAL;
 
 	c = get_channel(iface, channel_id);
-- 
2.7.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux