2011-05-20 19:13:27

by Gustavo Padovan

[permalink] [raw]
Subject: [PATCH 1/8] mm: Kill set but not used var in bdi_debug_stats_show()

Signed-off-by: Gustavo F. Padovan <[email protected]>
---
mm/backing-dev.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index befc875..f032e6e 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -63,10 +63,10 @@ static int bdi_debug_stats_show(struct seq_file *m, void *v)
unsigned long background_thresh;
unsigned long dirty_thresh;
unsigned long bdi_thresh;
- unsigned long nr_dirty, nr_io, nr_more_io, nr_wb;
+ unsigned long nr_dirty, nr_io, nr_more_io;
struct inode *inode;

- nr_wb = nr_dirty = nr_io = nr_more_io = 0;
+ nr_dirty = nr_io = nr_more_io = 0;
spin_lock(&inode_wb_list_lock);
list_for_each_entry(inode, &wb->b_dirty, i_wb_list)
nr_dirty++;
--
1.7.5.1


2011-05-20 19:13:34

by Gustavo Padovan

[permalink] [raw]
Subject: [PATCH 2/8] x86: Fix set but not used in ghash_async_setkey()

Signed-off-by: Gustavo F. Padovan <[email protected]>
---
arch/x86/crypto/ghash-clmulni-intel_glue.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c
index 7a6e68e..976aa64 100644
--- a/arch/x86/crypto/ghash-clmulni-intel_glue.c
+++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c
@@ -245,7 +245,7 @@ static int ghash_async_setkey(struct crypto_ahash *tfm, const u8 *key,
crypto_ahash_set_flags(tfm, crypto_ahash_get_flags(child)
& CRYPTO_TFM_RES_MASK);

- return 0;
+ return err;
}

static int ghash_async_init_tfm(struct crypto_tfm *tfm)
--
1.7.5.1

2011-05-20 19:13:38

by Gustavo Padovan

[permalink] [raw]
Subject: [PATCH 3/8] x86: Kill set but not used warning

Signed-off-by: Gustavo F. Padovan <[email protected]>
---
arch/x86/kernel/amd_iommu.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 873e7e1..cd8cbeb5 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1538,13 +1538,11 @@ static void do_detach(struct device *dev)
{
struct iommu_dev_data *dev_data;
struct amd_iommu *iommu;
- struct pci_dev *pdev;
u16 devid;

devid = get_device_id(dev);
iommu = amd_iommu_rlookup_table[devid];
dev_data = get_dev_data(dev);
- pdev = to_pci_dev(dev);

/* decrease reference counters */
dev_data->domain->dev_iommu[iommu->index] -= 1;
@@ -1703,10 +1701,9 @@ static struct protection_domain *domain_for_device(struct device *dev)
struct protection_domain *dom;
struct iommu_dev_data *dev_data, *alias_data;
unsigned long flags;
- u16 devid, alias;
+ u16 devid;

devid = get_device_id(dev);
- alias = amd_iommu_alias_table[devid];
dev_data = get_dev_data(dev);
alias_data = get_dev_data(dev_data->alias);
if (!alias_data)
--
1.7.5.1

2011-05-20 19:13:42

by Gustavo Padovan

[permalink] [raw]
Subject: [PATCH 4/8] x86: Kill set but not used warnings in tlb_uv.c

Signed-off-by: Gustavo F. Padovan <[email protected]>
---
arch/x86/platform/uv/tlb_uv.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index c58e0ea..0f296e8 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -134,7 +134,6 @@ static inline void uv_bau_process_retry_msg(struct msg_desc *mdp,
{
int i;
int cancel_count = 0;
- int slot2;
unsigned long msg_res;
unsigned long mmr = 0;
struct bau_payload_queue_entry *msg;
@@ -159,7 +158,6 @@ static inline void uv_bau_process_retry_msg(struct msg_desc *mdp,
msg->sw_ack_vector) == 0) &&
(msg2->sending_cpu == msg->sending_cpu) &&
(msg2->msg_type != MSG_NOOP)) {
- slot2 = msg2 - mdp->va_queue_first;
mmr = uv_read_local_mmr
(UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE);
msg_res = msg2->sw_ack_vector;
@@ -278,7 +276,6 @@ static void
uv_do_reset(void *ptr)
{
int i;
- int slot;
int count = 0;
unsigned long mmr;
unsigned long msg_res;
@@ -310,7 +307,6 @@ uv_do_reset(void *ptr)
* make everyone else ignore this message
*/
msg->canceled = 1;
- slot = msg - bcp->va_queue_first;
count++;
/*
* only reset the resource if it is still pending
@@ -404,9 +400,6 @@ static int uv_wait_completion(struct bau_desc *bau_desc,
unsigned long descriptor_status;
cycles_t ttime;
struct ptc_stats *stat = bcp->statp;
- struct bau_control *hmaster;
-
- hmaster = bcp->uvhub_master;

/* spin on the status MMR, waiting for it to go idle */
while ((descriptor_status = (((unsigned long)
@@ -1409,14 +1402,12 @@ uv_payload_queue_init(int node, int pnode)
char *cp;
unsigned long pa;
struct bau_payload_queue_entry *pqp;
- struct bau_payload_queue_entry *pqp_malloc;
struct bau_control *bcp;

pqp = kmalloc_node((DEST_Q_SIZE + 1)
* sizeof(struct bau_payload_queue_entry),
GFP_KERNEL, node);
BUG_ON(!pqp);
- pqp_malloc = pqp;

cp = (char *)pqp + 31;
pqp = (struct bau_payload_queue_entry *)(((unsigned long)cp >> 5) << 5);
--
1.7.5.1

2011-05-20 19:13:48

by Gustavo Padovan

[permalink] [raw]
Subject: [PATCH 5/8] x86: Kill set but not used warning in test_NX()

Signed-off-by: Gustavo F. Padovan <[email protected]>
---
arch/x86/kernel/test_nx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/test_nx.c b/arch/x86/kernel/test_nx.c
index 787a5e4..3f92ce0 100644
--- a/arch/x86/kernel/test_nx.c
+++ b/arch/x86/kernel/test_nx.c
@@ -161,7 +161,7 @@ static int test_NX(void)
}

#endif
- return 0;
+ return ret;
}

static void test_exit(void)
--
1.7.5.1

2011-05-20 19:14:29

by Gustavo Padovan

[permalink] [raw]
Subject: [PATCH 6/8] x86: Kill set but not used warnings in pf_in.c

Signed-off-by: Gustavo F. Padovan <[email protected]>
---
arch/x86/mm/pf_in.c | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/x86/mm/pf_in.c b/arch/x86/mm/pf_in.c
index 38e6d17..9f0614d 100644
--- a/arch/x86/mm/pf_in.c
+++ b/arch/x86/mm/pf_in.c
@@ -414,22 +414,17 @@ unsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs)
unsigned char *p;
struct prefix_bits prf;
int i;
- unsigned long rv;

p = (unsigned char *)ins_addr;
p += skip_prefix(p, &prf);
p += get_opcode(p, &opcode);
for (i = 0; i < ARRAY_SIZE(reg_rop); i++)
- if (reg_rop[i] == opcode) {
- rv = REG_READ;
+ if (reg_rop[i] == opcode)
goto do_work;
- }

for (i = 0; i < ARRAY_SIZE(reg_wop); i++)
- if (reg_wop[i] == opcode) {
- rv = REG_WRITE;
+ if (reg_wop[i] == opcode)
goto do_work;
- }

printk(KERN_ERR "mmiotrace: Not a register instruction, opcode "
"0x%02x\n", opcode);
@@ -474,16 +469,13 @@ unsigned long get_ins_imm_val(unsigned long ins_addr)
unsigned char *p;
struct prefix_bits prf;
int i;
- unsigned long rv;

p = (unsigned char *)ins_addr;
p += skip_prefix(p, &prf);
p += get_opcode(p, &opcode);
for (i = 0; i < ARRAY_SIZE(imm_wop); i++)
- if (imm_wop[i] == opcode) {
- rv = IMM_WRITE;
+ if (imm_wop[i] == opcode)
goto do_work;
- }

printk(KERN_ERR "mmiotrace: Not an immediate instruction, opcode "
"0x%02x\n", opcode);
--
1.7.5.1

2011-05-20 19:13:52

by Gustavo Padovan

[permalink] [raw]
Subject: [PATCH 7/8] 9p: Kill set but not used warnings

Signed-off-by: Gustavo F. Padovan <[email protected]>
---
fs/9p/cache.c | 2 --
fs/9p/vfs_file.c | 2 --
fs/9p/vfs_inode.c | 5 +----
3 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/fs/9p/cache.c b/fs/9p/cache.c
index 5b335c5..18e6e1f 100644
--- a/fs/9p/cache.c
+++ b/fs/9p/cache.c
@@ -241,13 +241,11 @@ void v9fs_cache_inode_flush_cookie(struct inode *inode)
void v9fs_cache_inode_set_cookie(struct inode *inode, struct file *filp)
{
struct v9fs_inode *v9inode = V9FS_I(inode);
- struct p9_fid *fid;

if (!v9inode->fscache)
return;

spin_lock(&v9inode->fscache_lock);
- fid = filp->private_data;
if ((filp->f_flags & O_ACCMODE) != O_RDONLY)
v9fs_cache_inode_flush_cookie(inode);
else
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index ffed558..0a04ad9 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -446,14 +446,12 @@ v9fs_file_write_internal(struct inode *inode, struct p9_fid *fid,
int n;
loff_t i_size;
size_t total = 0;
- struct p9_client *clnt;
loff_t origin = *offset;
unsigned long pg_start, pg_end;

P9_DPRINTK(P9_DEBUG_VFS, "data %p count %d offset %x\n", data,
(int)count, (int)*offset);

- clnt = fid->clnt;
do {
n = p9_client_write(fid, NULL, data+total, origin+total, count);
if (n <= 0)
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 7f6c677..13a3ab9 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -738,7 +738,6 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nameidata)
{
- struct super_block *sb;
struct v9fs_session_info *v9ses;
struct p9_fid *dfid, *fid;
struct inode *inode;
@@ -751,7 +750,6 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
if (dentry->d_name.len > NAME_MAX)
return ERR_PTR(-ENAMETOOLONG);

- sb = dir->i_sb;
v9ses = v9fs_inode2v9ses(dir);
/* We can walk d_parent because we hold the dir->i_mutex */
dfid = v9fs_fid_lookup(dentry->d_parent);
@@ -929,13 +927,12 @@ static int
v9fs_vfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat)
{
- int err;
struct v9fs_session_info *v9ses;
struct p9_fid *fid;
struct p9_wstat *st;

P9_DPRINTK(P9_DEBUG_VFS, "dentry: %p\n", dentry);
- err = -EPERM;
+
v9ses = v9fs_dentry2v9ses(dentry);
if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
generic_fillattr(dentry->d_inode, stat);
--
1.7.5.1

2011-05-20 19:13:55

by Gustavo Padovan

[permalink] [raw]
Subject: [PATCH 8/8] apparmor: Kill set but no used warning in common_mmap()

Signed-off-by: Gustavo F. Padovan <[email protected]>
---
security/apparmor/lsm.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index ae3a698..4c1e4ca 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -470,7 +470,6 @@ static int apparmor_file_lock(struct file *file, unsigned int cmd)
static int common_mmap(int op, struct file *file, unsigned long prot,
unsigned long flags)
{
- struct dentry *dentry;
int mask = 0;

if (!file || !file->f_security)
@@ -487,7 +486,6 @@ static int common_mmap(int op, struct file *file, unsigned long prot,
if (prot & PROT_EXEC)
mask |= AA_EXEC_MMAP;

- dentry = file->f_path.dentry;
return common_file_perm(op, file, mask);
}

--
1.7.5.1

2011-05-20 19:23:09

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH 1/8] mm: Kill set but not used var in bdi_debug_stats_show()

On 2011-05-20 21:12, Gustavo F. Padovan wrote:
> Signed-off-by: Gustavo F. Padovan <[email protected]>
> ---
> mm/backing-dev.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index befc875..f032e6e 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -63,10 +63,10 @@ static int bdi_debug_stats_show(struct seq_file *m, void *v)
> unsigned long background_thresh;
> unsigned long dirty_thresh;
> unsigned long bdi_thresh;
> - unsigned long nr_dirty, nr_io, nr_more_io, nr_wb;
> + unsigned long nr_dirty, nr_io, nr_more_io;
> struct inode *inode;
>
> - nr_wb = nr_dirty = nr_io = nr_more_io = 0;
> + nr_dirty = nr_io = nr_more_io = 0;
> spin_lock(&inode_wb_list_lock);
> list_for_each_entry(inode, &wb->b_dirty, i_wb_list)
> nr_dirty++;

Good catch, nr_wb should have been killed with the removal of the worker
list. I'll queue this up.

--
Jens Axboe

2011-05-21 17:21:50

by Gustavo Padovan

[permalink] [raw]
Subject: [tip:x86/urgent] x86: Eliminate various 'set but not used' warnings

Commit-ID: 6ec5ff4bc3a90b7716eadc4c8a686e904131f03a
Gitweb: http://git.kernel.org/tip/6ec5ff4bc3a90b7716eadc4c8a686e904131f03a
Author: Gustavo F. Padovan <[email protected]>
AuthorDate: Fri, 20 May 2011 16:13:00 -0300
Committer: Ingo Molnar <[email protected]>
CommitDate: Sat, 21 May 2011 19:10:33 +0200

x86: Eliminate various 'set but not used' warnings

Signed-off-by: Gustavo F. Padovan <[email protected]>
Cc: Joerg Roedel <[email protected]> (supporter:AMD IOMMU (AMD-VI))
Cc: [email protected] (open list:AMD IOMMU (AMD-VI))
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/kernel/amd_iommu.c | 5 +----
arch/x86/kernel/test_nx.c | 2 +-
arch/x86/mm/pf_in.c | 14 +++-----------
3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 873e7e1..cd8cbeb 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1538,13 +1538,11 @@ static void do_detach(struct device *dev)
{
struct iommu_dev_data *dev_data;
struct amd_iommu *iommu;
- struct pci_dev *pdev;
u16 devid;

devid = get_device_id(dev);
iommu = amd_iommu_rlookup_table[devid];
dev_data = get_dev_data(dev);
- pdev = to_pci_dev(dev);

/* decrease reference counters */
dev_data->domain->dev_iommu[iommu->index] -= 1;
@@ -1703,10 +1701,9 @@ static struct protection_domain *domain_for_device(struct device *dev)
struct protection_domain *dom;
struct iommu_dev_data *dev_data, *alias_data;
unsigned long flags;
- u16 devid, alias;
+ u16 devid;

devid = get_device_id(dev);
- alias = amd_iommu_alias_table[devid];
dev_data = get_dev_data(dev);
alias_data = get_dev_data(dev_data->alias);
if (!alias_data)
diff --git a/arch/x86/kernel/test_nx.c b/arch/x86/kernel/test_nx.c
index 787a5e4..3f92ce0 100644
--- a/arch/x86/kernel/test_nx.c
+++ b/arch/x86/kernel/test_nx.c
@@ -161,7 +161,7 @@ static int test_NX(void)
}

#endif
- return 0;
+ return ret;
}

static void test_exit(void)
diff --git a/arch/x86/mm/pf_in.c b/arch/x86/mm/pf_in.c
index 38e6d17..9f0614d 100644
--- a/arch/x86/mm/pf_in.c
+++ b/arch/x86/mm/pf_in.c
@@ -414,22 +414,17 @@ unsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs)
unsigned char *p;
struct prefix_bits prf;
int i;
- unsigned long rv;

p = (unsigned char *)ins_addr;
p += skip_prefix(p, &prf);
p += get_opcode(p, &opcode);
for (i = 0; i < ARRAY_SIZE(reg_rop); i++)
- if (reg_rop[i] == opcode) {
- rv = REG_READ;
+ if (reg_rop[i] == opcode)
goto do_work;
- }

for (i = 0; i < ARRAY_SIZE(reg_wop); i++)
- if (reg_wop[i] == opcode) {
- rv = REG_WRITE;
+ if (reg_wop[i] == opcode)
goto do_work;
- }

printk(KERN_ERR "mmiotrace: Not a register instruction, opcode "
"0x%02x\n", opcode);
@@ -474,16 +469,13 @@ unsigned long get_ins_imm_val(unsigned long ins_addr)
unsigned char *p;
struct prefix_bits prf;
int i;
- unsigned long rv;

p = (unsigned char *)ins_addr;
p += skip_prefix(p, &prf);
p += get_opcode(p, &opcode);
for (i = 0; i < ARRAY_SIZE(imm_wop); i++)
- if (imm_wop[i] == opcode) {
- rv = IMM_WRITE;
+ if (imm_wop[i] == opcode)
goto do_work;
- }

printk(KERN_ERR "mmiotrace: Not an immediate instruction, opcode "
"0x%02x\n", opcode);

2011-05-23 10:17:04

by Joerg Roedel

[permalink] [raw]
Subject: Re: [PATCH 3/8] x86: Kill set but not used warning

On Fri, May 20, 2011 at 03:13:00PM -0400, Gustavo F. Padovan wrote:
> Signed-off-by: Gustavo F. Padovan <[email protected]>

Please provide a short and meaningful commit-msg.

> ---
> arch/x86/kernel/amd_iommu.c | 5 +----
> 1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
> index 873e7e1..cd8cbeb5 100644
> --- a/arch/x86/kernel/amd_iommu.c
> +++ b/arch/x86/kernel/amd_iommu.c
> @@ -1538,13 +1538,11 @@ static void do_detach(struct device *dev)
> {
> struct iommu_dev_data *dev_data;
> struct amd_iommu *iommu;
> - struct pci_dev *pdev;
> u16 devid;
>
> devid = get_device_id(dev);
> iommu = amd_iommu_rlookup_table[devid];
> dev_data = get_dev_data(dev);
> - pdev = to_pci_dev(dev);
>
> /* decrease reference counters */
> dev_data->domain->dev_iommu[iommu->index] -= 1;

This is already gone upstream.

> @@ -1703,10 +1701,9 @@ static struct protection_domain *domain_for_device(struct device *dev)
> struct protection_domain *dom;
> struct iommu_dev_data *dev_data, *alias_data;
> unsigned long flags;
> - u16 devid, alias;
> + u16 devid;
>
> devid = get_device_id(dev);
> - alias = amd_iommu_alias_table[devid];
> dev_data = get_dev_data(dev);
> alias_data = get_dev_data(dev_data->alias);
> if (!alias_data)

This is still there. Can you please rebase this patch against
linus/master and send again?

Thanks,

Joerg

2011-05-23 10:18:59

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 3/8] x86: Kill set but not used warning


* Roedel, Joerg <[email protected]> wrote:

> This is still there. Can you please rebase this patch against
> linus/master and send again?

a better base would be latest -tip:

http://people.redhat.com/mingo/tip.git/README

as i've already applied some of the changes in:

6ec5ff4bc3a9: x86: Eliminate various 'set but not used' warnings

Thanks,

Ingo

2011-05-26 03:30:12

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 2/8] x86: Fix set but not used in ghash_async_setkey()

On Fri, May 20, 2011 at 04:12:59PM -0300, Gustavo F. Padovan wrote:
> Signed-off-by: Gustavo F. Padovan <[email protected]>

Patch applied. Thanks a lot.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt