linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: remove redundant pointer lip
@ 2022-10-10 14:31 Colin Ian King
  2022-10-10 15:30 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-10-10 14:31 UTC (permalink / raw)
  To: Darrick J . Wong, linux-xfs; +Cc: kernel-janitors, bllvm

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]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/xfs/xfs_trans_ail.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 16fbf2a1144c..87db72758d1f 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -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);
-- 
2.37.3


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

* Re: [PATCH] xfs: remove redundant pointer lip
  2022-10-10 14:31 [PATCH] xfs: remove redundant pointer lip Colin Ian King
@ 2022-10-10 15:30 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2022-10-10 15:30 UTC (permalink / raw)
  To: Colin Ian King; +Cc: linux-xfs, kernel-janitors, bllvm

On Mon, Oct 10, 2022 at 03:31:19PM +0100, Colin Ian King wrote:
> 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]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  fs/xfs/xfs_trans_ail.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
> index 16fbf2a1144c..87db72758d1f 100644
> --- a/fs/xfs/xfs_trans_ail.c
> +++ b/fs/xfs/xfs_trans_ail.c
> @@ -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,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

>  		prepare_to_wait(&ailp->ail_empty, &wait, TASK_UNINTERRUPTIBLE);
>  		wake_up_process(ailp->ail_task);
>  		spin_unlock(&ailp->ail_lock);
> -- 
> 2.37.3
> 

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

end of thread, other threads:[~2022-10-10 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10 14:31 [PATCH] xfs: remove redundant pointer lip Colin Ian King
2022-10-10 15:30 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).