public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix sparse shadowed variable warnings
@ 2007-07-14 16:08 Christoph Hellwig
  2007-07-14 16:44 ` Eric Sandeen
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2007-07-14 16:08 UTC (permalink / raw)
  To: xfs

 - in xfs_probe_cluster rename the inner len to pg_len.  There's no harm
   here because the utter len isn't used after the inner len comes into
   existance but it keeps the code clean.
 - in xfs_da_do_buf remove the inner i because both useage don't overlap
   and they are the same type.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_aops.c	2007-07-14 16:02:19.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c	2007-07-14 16:03:09.000000000 +0200
@@ -652,7 +652,7 @@ xfs_probe_cluster(
 
 		for (i = 0; i < pagevec_count(&pvec); i++) {
 			struct page *page = pvec.pages[i];
-			size_t pg_offset, len = 0;
+			size_t pg_offset, pg_len = 0;
 
 			if (tindex == tlast) {
 				pg_offset =
@@ -665,16 +665,16 @@ xfs_probe_cluster(
 				pg_offset = PAGE_CACHE_SIZE;
 
 			if (page->index == tindex && !TestSetPageLocked(page)) {
-				len = xfs_probe_page(page, pg_offset, mapped);
+				pg_len = xfs_probe_page(page, pg_offset, mapped);
 				unlock_page(page);
 			}
 
-			if (!len) {
+			if (!pg_len) {
 				done = 1;
 				break;
 			}
 
-			total += len;
+			total += pg_len;
 			tindex++;
 		}
 
Index: linux-2.6-xfs/fs/xfs/xfs_da_btree.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_da_btree.c	2007-07-14 16:01:43.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/xfs_da_btree.c	2007-07-14 16:02:01.000000000 +0200
@@ -1975,7 +1975,6 @@ xfs_da_do_buf(
 		error = mappedbno == -2 ? 0 : XFS_ERROR(EFSCORRUPTED);
 		if (unlikely(error == EFSCORRUPTED)) {
 			if (xfs_error_level >= XFS_ERRLEVEL_LOW) {
-				int	i;
 				cmn_err(CE_ALERT, "xfs_da_do_buf: bno %lld\n",
 					(long long)bno);
 				cmn_err(CE_ALERT, "dir: inode %lld\n",

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

* Re: [PATCH] fix sparse shadowed variable warnings
  2007-07-14 16:08 [PATCH] fix sparse shadowed variable warnings Christoph Hellwig
@ 2007-07-14 16:44 ` Eric Sandeen
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Sandeen @ 2007-07-14 16:44 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

Christoph Hellwig wrote:
>  - in xfs_probe_cluster rename the inner len to pg_len.  There's no harm
>    here because the utter len isn't used after the inner len comes into
>    existance but it keeps the code clean.
>  - in xfs_da_do_buf remove the inner i because both useage don't overlap
>    and they are the same type.
> 

Looks fine

-Eric

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_aops.c	2007-07-14 16:02:19.000000000 +0200
> +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c	2007-07-14 16:03:09.000000000 +0200
> @@ -652,7 +652,7 @@ xfs_probe_cluster(
>  
>  		for (i = 0; i < pagevec_count(&pvec); i++) {
>  			struct page *page = pvec.pages[i];
> -			size_t pg_offset, len = 0;
> +			size_t pg_offset, pg_len = 0;
>  
>  			if (tindex == tlast) {
>  				pg_offset =
> @@ -665,16 +665,16 @@ xfs_probe_cluster(
>  				pg_offset = PAGE_CACHE_SIZE;
>  
>  			if (page->index == tindex && !TestSetPageLocked(page)) {
> -				len = xfs_probe_page(page, pg_offset, mapped);
> +				pg_len = xfs_probe_page(page, pg_offset, mapped);
>  				unlock_page(page);
>  			}
>  
> -			if (!len) {
> +			if (!pg_len) {
>  				done = 1;
>  				break;
>  			}
>  
> -			total += len;
> +			total += pg_len;
>  			tindex++;
>  		}
>  
> Index: linux-2.6-xfs/fs/xfs/xfs_da_btree.c
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/xfs_da_btree.c	2007-07-14 16:01:43.000000000 +0200
> +++ linux-2.6-xfs/fs/xfs/xfs_da_btree.c	2007-07-14 16:02:01.000000000 +0200
> @@ -1975,7 +1975,6 @@ xfs_da_do_buf(
>  		error = mappedbno == -2 ? 0 : XFS_ERROR(EFSCORRUPTED);
>  		if (unlikely(error == EFSCORRUPTED)) {
>  			if (xfs_error_level >= XFS_ERRLEVEL_LOW) {
> -				int	i;
>  				cmn_err(CE_ALERT, "xfs_da_do_buf: bno %lld\n",
>  					(long long)bno);
>  				cmn_err(CE_ALERT, "dir: inode %lld\n",
> 
> 

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

end of thread, other threads:[~2007-07-14 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-14 16:08 [PATCH] fix sparse shadowed variable warnings Christoph Hellwig
2007-07-14 16:44 ` Eric Sandeen

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