mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: tytso@mit.edu, linux-ext4@vger.kernel.org,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [PATCH] [17/23] EXT3: Fix set but unused variables
Date: Thu, 10 Jun 2010 13:10:53 +0200 (CEST)	[thread overview]
Message-ID: <20100610111053.43E78B1A2B@basil.firstfloor.org> (raw)
In-Reply-To: <20100610110.764742110@firstfloor.org>


I think it's mostly dead code, but needs more review. I was not fully sure
about the jbd case.

cc: tytso@mit.edu
cc: linux-ext4@vger.kernel.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 fs/ext3/namei.c   |    3 +--
 fs/ext3/resize.c  |    2 --
 fs/jbd/journal.c  |    7 -------
 fs/jbd/recovery.c |    7 -------
 4 files changed, 1 insertion(+), 18 deletions(-)

Index: linux-2.6.35-rc2-gcc/fs/ext3/namei.c
===================================================================
--- linux-2.6.35-rc2-gcc.orig/fs/ext3/namei.c
+++ linux-2.6.35-rc2-gcc/fs/ext3/namei.c
@@ -1447,7 +1447,6 @@ static int ext3_add_entry (handle_t *han
 	struct inode *inode)
 {
 	struct inode *dir = dentry->d_parent->d_inode;
-	unsigned long offset;
 	struct buffer_head * bh;
 	struct ext3_dir_entry_2 *de;
 	struct super_block * sb;
@@ -1469,7 +1468,7 @@ static int ext3_add_entry (handle_t *han
 		ext3_mark_inode_dirty(handle, dir);
 	}
 	blocks = dir->i_size >> sb->s_blocksize_bits;
-	for (block = 0, offset = 0; block < blocks; block++) {
+	for (block = 0; block < blocks; block++) {
 		bh = ext3_bread(handle, dir, block, 0, &retval);
 		if(!bh)
 			return retval;
Index: linux-2.6.35-rc2-gcc/fs/ext3/resize.c
===================================================================
--- linux-2.6.35-rc2-gcc.orig/fs/ext3/resize.c
+++ linux-2.6.35-rc2-gcc/fs/ext3/resize.c
@@ -964,7 +964,6 @@ int ext3_group_extend(struct super_block
 		      ext3_fsblk_t n_blocks_count)
 {
 	ext3_fsblk_t o_blocks_count;
-	unsigned long o_groups_count;
 	ext3_grpblk_t last;
 	ext3_grpblk_t add;
 	struct buffer_head * bh;
@@ -976,7 +975,6 @@ int ext3_group_extend(struct super_block
 	 * yet: we're going to revalidate es->s_blocks_count after
 	 * taking the s_resize_lock below. */
 	o_blocks_count = le32_to_cpu(es->s_blocks_count);
-	o_groups_count = EXT3_SB(sb)->s_groups_count;
 
 	if (test_opt(sb, DEBUG))
 		printk(KERN_DEBUG "EXT3-fs: extending last group from "E3FSBLK" uto "E3FSBLK" blocks\n",
Index: linux-2.6.35-rc2-gcc/fs/jbd/journal.c
===================================================================
--- linux-2.6.35-rc2-gcc.orig/fs/jbd/journal.c
+++ linux-2.6.35-rc2-gcc/fs/jbd/journal.c
@@ -1281,13 +1281,9 @@ int journal_check_used_features (journal
 int journal_check_available_features (journal_t *journal, unsigned long compat,
 				      unsigned long ro, unsigned long incompat)
 {
-	journal_superblock_t *sb;
-
 	if (!compat && !ro && !incompat)
 		return 1;
 
-	sb = journal->j_superblock;
-
 	/* We can support any known requested features iff the
 	 * superblock is in version 2.  Otherwise we fail to support any
 	 * extended sb features. */
@@ -1481,7 +1477,6 @@ int journal_flush(journal_t *journal)
 
 int journal_wipe(journal_t *journal, int write)
 {
-	journal_superblock_t *sb;
 	int err = 0;
 
 	J_ASSERT (!(journal->j_flags & JFS_LOADED));
@@ -1490,8 +1485,6 @@ int journal_wipe(journal_t *journal, int
 	if (err)
 		return err;
 
-	sb = journal->j_superblock;
-
 	if (!journal->j_tail)
 		goto no_recovery;
 
Index: linux-2.6.35-rc2-gcc/fs/jbd/recovery.c
===================================================================
--- linux-2.6.35-rc2-gcc.orig/fs/jbd/recovery.c
+++ linux-2.6.35-rc2-gcc/fs/jbd/recovery.c
@@ -283,12 +283,10 @@ int journal_recover(journal_t *journal)
 int journal_skip_recovery(journal_t *journal)
 {
 	int			err;
-	journal_superblock_t *	sb;
 
 	struct recovery_info	info;
 
 	memset (&info, 0, sizeof(info));
-	sb = journal->j_superblock;
 
 	err = do_one_pass(journal, &info, PASS_SCAN);
 
@@ -321,11 +319,6 @@ static int do_one_pass(journal_t *journa
 	unsigned int		sequence;
 	int			blocktype;
 
-	/* Precompute the maximum metadata descriptors in a descriptor block */
-	int			MAX_BLOCKS_PER_DESC;
-	MAX_BLOCKS_PER_DESC = ((journal->j_blocksize-sizeof(journal_header_t))
-			       / sizeof(journal_block_tag_t));
-
 	/*
 	 * First thing is to establish what we expect to find in the log
 	 * (in terms of transaction IDs), and where (in terms of log

  parent reply	other threads:[~2010-06-10 11:12 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10 11:10 [PATCH] [0/23] Fix gcc 4.6 set but unused variable warnings Andi Kleen
2010-06-10 11:10 ` [PATCH] [1/23] x86: percpu: Avoid warnings of unused variables in per cpu Andi Kleen
2010-06-10 11:14   ` Tejun Heo
2010-06-10 12:09     ` Ingo Molnar
2010-06-10 17:43       ` Justin P. Mattock
2010-06-10 18:10         ` Andi Kleen
2010-06-10 18:26           ` Justin P. Mattock
2010-06-10 20:10           ` Justin P. Mattock
2010-06-10 12:24     ` [tip:x86/urgent] percpu, x86: " tip-bot for Andi Kleen
2010-06-10 11:10 ` [PATCH] [2/23] IRQ: Move alloc_desk_mask variables inside ifdef Andi Kleen
2010-06-10 11:10 ` [PATCH] [3/23] x86: Avoid unused by set variables in rdmsr Andi Kleen
2010-06-10 11:10 ` [PATCH] [4/23] pagemap: Avoid unused-but-set variable Andi Kleen
2010-06-18 23:28   ` Andrew Morton
2010-06-19  7:44     ` Andi Kleen
2010-06-10 11:10 ` [PATCH] [5/23] x86 boot: Set ax register in boot vga query Andi Kleen
2010-06-10 17:13   ` H. Peter Anvin
2010-06-10 23:42   ` [tip:x86/urgent] x86, setup: " tip-bot for Andi Kleen
2010-06-10 11:10 ` [PATCH] [6/23] perf: Fix set but unused variables in perf Andi Kleen
2010-06-10 11:10 ` [PATCH] [7/23] x86: fix set but not read variables Andi Kleen
2010-06-10 11:10 ` [PATCH] [8/23] KGDB: Remove set but unused newPC Andi Kleen
2010-07-30 11:59   ` Jason Wessel
2010-06-10 11:10 ` [PATCH] [9/23] PRINTK: Use stable variable to dump kmsg buffer Andi Kleen
2010-06-10 11:10 ` [PATCH] [10/23] SCHED: Only allocate per cpu cpu mask buffer with offstack cpumasks Andi Kleen
2010-06-10 14:43   ` Peter Zijlstra
2010-06-10 14:52     ` Andi Kleen
2010-06-10 14:55       ` Peter Zijlstra
2010-06-10 15:06         ` Andi Kleen
2010-06-10 15:19           ` Peter Zijlstra
2010-06-10 15:34             ` Andi Kleen
2010-06-10 11:10 ` [PATCH] [11/23] KVM: Fix KVM_SET_SIGNAL_MASK Andi Kleen
2010-06-10 14:16   ` Avi Kivity
2010-06-10 11:10 ` [PATCH] [12/23] BTRFS: Clean up unused variables -- bugs Andi Kleen
2010-06-10 11:10 ` [PATCH] [13/23] BTRFS: Clean up unused variables -- nonbugs Andi Kleen
2010-06-10 11:10 ` [PATCH] [14/23] NFSD: Fix initialized but not read warnings Andi Kleen
2010-06-10 11:10 ` [PATCH] [15/23] EXT4: Fix initialized but not read variables Andi Kleen
2010-06-14 17:20   ` tytso
2010-06-10 11:10 ` [PATCH] [16/23] XFS: Fix gcc 4.6 set but not read and unused statement warnings Andi Kleen
2010-06-11 16:20   ` Christoph Hellwig
2010-06-11 16:36     ` Andi Kleen
2010-06-14  4:27   ` Dave Chinner
2010-06-14  7:43     ` Andi Kleen
2010-06-14 13:37       ` Dave Chinner
2010-06-14 14:37         ` Andi Kleen
2010-06-14 22:24           ` Dave Chinner
2010-06-15  7:02             ` Andi Kleen
2010-06-15  7:40               ` Christoph Hellwig
2010-06-15  7:46                 ` Andi Kleen
2010-06-10 11:10 ` Andi Kleen [this message]
2010-06-14 17:21   ` [PATCH] [17/23] EXT3: Fix set but unused variables tytso
2010-06-14 17:27   ` tytso
2010-06-15 14:01     ` Jan Kara
2010-06-10 11:10 ` [PATCH] [18/23] ACPI: Fix unused but set variables in ACPI Andi Kleen
2010-06-10 11:10 ` [PATCH] [19/23] KVM: Fix unused but set warnings Andi Kleen
2010-06-10 14:19   ` Avi Kivity
2010-06-10 11:10 ` [PATCH] [20/23] MM: " Andi Kleen
2010-06-10 11:10 ` [PATCH] [21/23] kernel/*: " Andi Kleen
2010-06-10 11:10 ` [PATCH] [22/23] BLOCK: Fix unused but set variables in blk-merge Andi Kleen
2010-06-10 11:10 ` [PATCH] [23/23] FS: Fix unused but set warnings Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100610111053.43E78B1A2B@basil.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome