From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A7D93E4C80 for ; Wed, 6 May 2026 14:50:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778079051; cv=none; b=HNMxuz3hv5uE5D3irD4pDUs+JHhy+BWWpuepqsjhMHZyC8on4dF27jfwnGA0ONJIpxokc6Ic1sNppFPSwK2NMC/H505aPlnhDSo8zVftyxFl29omRwdmrYF+AQVptCG+8gLOWdV/52WeoJ9MnepMdwRxDsHikH6CmQ+wfEGQA9w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778079051; c=relaxed/simple; bh=+BzPqwLY+8FlwIFVReviIfjGGsukZ0iJGHlL48cnGBw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=M3fKtHo2EpGwhPB3iDAhRtrHPlOZ+H92NWpqtr8vFOKeeGO9QAdxqhw4WhupBxTSWROddOxxlAXbK0ktXnJs13PYuRXoR35a08BcJUUCrDKt/28an3X3/YNX/A9Fvo5K5UhuWnaojxRzllU18biNBj6jfuhlpXeYVCYDCtjmp/Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=M0raNVWU; arc=none smtp.client-ip=209.85.208.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M0raNVWU" Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-38ee0fe3bdeso4516151fa.2 for ; Wed, 06 May 2026 07:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778079048; x=1778683848; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RETNPiO12m2Ypci15ihv5Hd/tHPFt3Lht0sBTcH1260=; b=M0raNVWUHfoBSfw/A9ikk3Ci7KbbU1xsYzAt5DDfoYSoV4sTb2pWMNpOLEbShWLN3f MZQLfjApIbCVY2wCukF+cT/FrZd9dZsj/zgvhqGqcjBPwwKrHB+7Ow8DRqwkM0fLQ9PC nDNQVtYlTwy9xvrmNT7UG2DwawxZ8EyR8dEwrZ3qV8goL7zdeFW06Zn/pI3VWHyu4F8W FUorlSq3L2Q0M/G3HXTtIjDndqi+I00hZeHyH9MPcteZpyVj2DoPLPxDLBoVtyeb4Z8V KBRhizXmetTR6eaVrJzWcwSoGHhcLkDPa5uvmfLtuW987dcGQefzz62nNKUU3olEO4SH BG4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778079048; x=1778683848; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RETNPiO12m2Ypci15ihv5Hd/tHPFt3Lht0sBTcH1260=; b=DDXsIm2WrZrNyGjjXMmEtG8IrQPEbbXVSQddcMbPwESApaZK7JK7du1pjaWS3kYvWn fmrmFw9HhvTA81dzoT7F7M+iqlTwyOPI+w7gzUf+4+BGce7zLCvnvPVwBjbFXLfPQOPz T1fM2S98tv/D0/IS5eT4u/DztSMqPTymdswxD0PsVOWm0L5mFWv5+kNrCaGcb0N0YgZK CbBGh18Me4eqF4PWCoVnTpc6iMg/GW4GHZNcnWfsiZHPlRYncK+zAXMmkwaXxmGoenc2 59ttIx4Sc+bL6L+ihgLPHek2qpR5Nm6xy+e92LYjbcASvwZV0UrvdZAp7VXCNI5WZ91/ fYbQ== X-Forwarded-Encrypted: i=1; AFNElJ8Z1N2MBPYMID+Wjaui6eagNn1FFc2go1ajB4L8KFy74K0jV3Lz+5GhIdwusUkrt+rt7o0XeFL0StB+P1A=@vger.kernel.org X-Gm-Message-State: AOJu0YzySVISdN9s+CL472eysDHSO/VJGbGpzPEP8Iy6UxshGOr1Gdw6 RiBQ2V2+jGp/0VXq/Ap3wv4apanT/y9xcxN7eu9VqV1cYrGdPQjwxgNKjJU3jhmA4vk= X-Gm-Gg: AeBDieta0t1NB6T0afysRf6w6iOI8+/LkPWkSxG4MBdRLvgvSBiLaQEzxW9uCccSK2P Lkw+Uv6sX0CDKas8ovESyPNOcQQc7xHngS47nW+6Ta8WZjSWt+dtuhfmQ9JMRpuLOFuKqSKY/LM fbuBkK+wGoX548WVclPhSi9bOH5jJsTmCTNIJptRVZgr1QuEQCnDvhoVWUjp1uR5g7NYxgIJ/aK a6Y6tJqk28xAAhhV25NEeLo/gmbMQW0i0VPv7kkf6Zqoae626a0Ne3/Y1MhJPs2ksrdVph1kwka Va5nv4l0KxzDjPCvmOD58Nzfwsir+8YBS7Xv0Kit/7u8Gc8FLINjCEkD10JFv36kdEGGMM4Edmn gUTj78Qvg8Y8L1R22oblzc3WuLLoSPmsIaUMnZke4Arb1oTCg/N7DwI5zPp9urv/OMAC+uetoSw IpqJUp8CQoG8j9iSjxnzWlFS2pRUz9aIDeW79C+cdb59Z3Ar6AdSZOnMY= X-Received: by 2002:a2e:ad85:0:b0:38c:da42:124f with SMTP id 38308e7fff4ca-393c6571f48mr5934871fa.8.1778079047164; Wed, 06 May 2026 07:50:47 -0700 (PDT) Received: from LAPTOP-9UC0RPH4.localdomain ([144.124.192.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-39361300984sm51071201fa.21.2026.05.06.07.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 07:50:46 -0700 (PDT) From: Stepan Ionichev To: gregkh@linuxfoundation.org Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Stepan Ionichev Subject: [PATCH] staging: vme_user: drop dead NULL checks inside list_for_each_entry() Date: Wed, 6 May 2026 19:48:26 +0500 Message-ID: <20260506144826.399-1-sozdayvek@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit list_for_each_entry() walks list entries via container_of() on the list head pointer; the iterator is never NULL during iteration. The "if (!iter)" branches inside vme_slave_request(), vme_master_request(), vme_dma_request() and vme_lm_request() are therefore unreachable. smatch flags the inconsistency: drivers/staging/vme_user/vme.c:266 vme_slave_request() error: we previously assumed slave_image could be null (see line 267) drivers/staging/vme_user/vme.c:460 vme_master_request() error: we previously assumed master_image could be null (see line 461) drivers/staging/vme_user/vme.c:834 vme_dma_request() error: we previously assumed dma_ctrlr could be null (see line 835) drivers/staging/vme_user/vme.c:1439 vme_lm_request() error: we previously assumed lm could be null (see line 1440) Drop the dead checks. No functional change. Signed-off-by: Stepan Ionichev --- drivers/staging/vme_user/vme.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c index 7220aba7b..ca6c43fb3 100644 --- a/drivers/staging/vme_user/vme.c +++ b/drivers/staging/vme_user/vme.c @@ -264,12 +264,6 @@ struct vme_resource *vme_slave_request(struct vme_dev *vdev, u32 address, /* Loop through slave resources */ list_for_each_entry(slave_image, &bridge->slave_resources, list) { - if (!slave_image) { - dev_err(bridge->parent, - "Registered NULL Slave resource\n"); - continue; - } - /* Find an unlocked and compatible image */ mutex_lock(&slave_image->mtx); if (((slave_image->address_attr & address) == address) && @@ -458,12 +452,6 @@ struct vme_resource *vme_master_request(struct vme_dev *vdev, u32 address, /* Loop through master resources */ list_for_each_entry(master_image, &bridge->master_resources, list) { - if (!master_image) { - dev_warn(bridge->parent, - "Registered NULL master resource\n"); - continue; - } - /* Find an unlocked and compatible image */ spin_lock(&master_image->lock); if (((master_image->address_attr & address) == address) && @@ -832,12 +820,6 @@ struct vme_resource *vme_dma_request(struct vme_dev *vdev, u32 route) /* Loop through DMA resources */ list_for_each_entry(dma_ctrlr, &bridge->dma_resources, list) { - if (!dma_ctrlr) { - dev_err(bridge->parent, - "Registered NULL DMA resource\n"); - continue; - } - /* Find an unlocked and compatible controller */ mutex_lock(&dma_ctrlr->mtx); if (((dma_ctrlr->route_attr & route) == route) && @@ -1437,12 +1419,6 @@ struct vme_resource *vme_lm_request(struct vme_dev *vdev) /* Loop through LM resources */ list_for_each_entry(lm, &bridge->lm_resources, list) { - if (!lm) { - dev_err(bridge->parent, - "Registered NULL Location Monitor resource\n"); - continue; - } - /* Find an unlocked controller */ mutex_lock(&lm->mtx); if (lm->locked == 0) { -- 2.43.0