Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH v1] driver:staging:vme:Remove NULL check of list_entry()
@ 2024-08-22  2:57 Yuesong Li
  2024-08-22  7:47 ` Greg KH
  2024-08-22  9:52 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Yuesong Li @ 2024-08-22  2:57 UTC (permalink / raw)
  To: gregkh
  Cc: soumya.negi97, piroyangg, andi.shyti, alexondunkan, linux-kernel,
	linux-staging, opensource.kernel, Yuesong Li

list_entry() will never return a NULL pointer, thus remove the
check.

Signed-off-by: Yuesong Li <liyuesong@vivo.com>
---
 drivers/staging/vme_user/vme.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c
index 218b19db6dac..42304c9f83a2 100644
--- a/drivers/staging/vme_user/vme.c
+++ b/drivers/staging/vme_user/vme.c
@@ -416,10 +416,6 @@ void vme_slave_free(struct vme_resource *resource)
 
 	slave_image = list_entry(resource->entry, struct vme_slave_resource,
 				 list);
-	if (!slave_image) {
-		dev_err(bridge->parent, "Can't find slave resource\n");
-		return;
-	}
 
 	/* Unlock image */
 	mutex_lock(&slave_image->mtx);
@@ -794,10 +790,6 @@ void vme_master_free(struct vme_resource *resource)
 
 	master_image = list_entry(resource->entry, struct vme_master_resource,
 				  list);
-	if (!master_image) {
-		dev_err(bridge->parent, "Can't find master resource\n");
-		return;
-	}
 
 	/* Unlock image */
 	spin_lock(&master_image->lock);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-22  9:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-22  2:57 [PATCH v1] driver:staging:vme:Remove NULL check of list_entry() Yuesong Li
2024-08-22  7:47 ` Greg KH
2024-08-22  9:52 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox