Skip to contentSkip to conversation

xfs: remove redundant pointer lip

PATCH Superseded Colin Ian King 2 participants 2 messages Oct 10, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: remove redundant pointer lip

The assignment to pointer lip is not really required, the pointer lip is redundant and can be removed.

Cleans up clang-scan warning:
warning: Although the value stored to 'lip' is used in the enclosing expression, the value is never actually read from 'lip' [deadcode.DeadStores]

---
 fs/xfs/xfs_trans_ail.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/xfs_trans_ail.c +1 -2
index 16fbf2a1144c..87db72758d1f 100644
@@ -730,11 +730,10 @@ void
 xfs_ail_push_all_sync(
 	struct xfs_ail  *ailp)
 {
-	struct xfs_log_item	*lip;
 	DEFINE_WAIT(wait);
 
 	spin_lock(&ailp->ail_lock);
-	while ((lip = xfs_ail_max(ailp)) != NULL) {
+	while (xfs_ail_max(ailp)) {
 		prepare_to_wait(&ailp->ail_empty, &wait, TASK_UNINTERRUPTIBLE);
 		wake_up_process(ailp->ail_task);
 		spin_unlock(&ailp->ail_lock);
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Colin Ian King

The assignment to pointer lip is not really required, the pointer lip is redundant and can be removed.

Cleans up clang-scan warning:
warning: Although the value stored to 'lip' is used in the enclosing expression, the value is never actually read from 'lip' [deadcode.DeadStores]

---
 fs/xfs/xfs_trans_ail.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/xfs_trans_ail.c +0 -0
index 16fbf2a1144c..87db72758d1f 100644

fs/xfs/xfs_trans_ail.c void · line 736

Quoted 9 lines
fs/xfs/xfs_trans_ail.c +1 -2
@@ -730,11 +730,10 @@ void
 xfs_ail_push_all_sync(
 	struct xfs_ail  *ailp)
 {
-	struct xfs_log_item	*lip;
 	DEFINE_WAIT(wait);
 
 	spin_lock(&ailp->ail_lock);
-	while ((lip = xfs_ail_max(ailp)) != NULL) {
+	while (xfs_ail_max(ailp)) {

I've a slight stylistic preference for leaving the pointer comparison explicit here, but I agree that @lip is no longer needed.

	while (xfs_ail_max(ailp) != NULL) {

With that fixed,

--D

Quoted 6 lines
fs/xfs/xfs_trans_ail.c +0 -0
 		prepare_to_wait(&ailp->ail_empty, &wait, TASK_UNINTERRUPTIBLE);
 		wake_up_process(ailp->ail_task);
 		spin_unlock(&ailp->ail_lock);
Signature · 1 line
2.37.3