aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-04-27 05:39:56 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-04-28 06:28:17 -0400
commit7719e437fac119e57b17588bab3a8e39ff9d22eb (patch)
tree56b08aec09225ac5587d9d8b7fee089181e26d25 /kernel
parentc782f242f0602edf848355d41e3676753c2280c8 (diff)
[PATCH 2/2] audit: fix sparse shadowed variable warnings
Use msglen as the identifier. kernel/audit.c:724:10: warning: symbol 'len' shadows an earlier one kernel/audit.c:575:8: originally declared here Don't use ino_f to check the inode field at the end of the functions. kernel/auditfilter.c:429:22: warning: symbol 'f' shadows an earlier one kernel/auditfilter.c:420:21: originally declared here kernel/auditfilter.c:542:22: warning: symbol 'f' shadows an earlier one kernel/auditfilter.c:529:21: originally declared here i always used as a counter for a for loop and initialized to zero before use. Eliminate the inner i variables. kernel/auditsc.c:1295:8: warning: symbol 'i' shadows an earlier one kernel/auditsc.c:1152:6: originally declared here kernel/auditsc.c:1320:7: warning: symbol 'i' shadows an earlier one kernel/auditsc.c:1152:6: originally declared here Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.c10
-rw-r--r--kernel/auditfilter.c16
-rw-r--r--kernel/auditsc.c2
3 files changed, 13 insertions, 15 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 5b9ad3dda885..f4799eb6977a 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -813,21 +813,21 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
813 case AUDIT_MAKE_EQUIV: { 813 case AUDIT_MAKE_EQUIV: {
814 void *bufp = data; 814 void *bufp = data;
815 u32 sizes[2]; 815 u32 sizes[2];
816 size_t len = nlmsg_len(nlh); 816 size_t msglen = nlmsg_len(nlh);
817 char *old, *new; 817 char *old, *new;
818 818
819 err = -EINVAL; 819 err = -EINVAL;
820 if (len < 2 * sizeof(u32)) 820 if (msglen < 2 * sizeof(u32))
821 break; 821 break;
822 memcpy(sizes, bufp, 2 * sizeof(u32)); 822 memcpy(sizes, bufp, 2 * sizeof(u32));
823 bufp += 2 * sizeof(u32); 823 bufp += 2 * sizeof(u32);
824 len -= 2 * sizeof(u32); 824 msglen -= 2 * sizeof(u32);
825 old = audit_unpack_string(&bufp, &len, sizes[0]); 825 old = audit_unpack_string(&bufp, &msglen, sizes[0]);
826 if (IS_ERR(old)) { 826 if (IS_ERR(old)) {
827 err = PTR_ERR(old); 827 err = PTR_ERR(old);
828 break; 828 break;
829 } 829 }
830 new = audit_unpack_string(&bufp, &len, sizes[1]); 830 new = audit_unpack_string(&bufp, &msglen, sizes[1]);
831 if (IS_ERR(new)) { 831 if (IS_ERR(new)) {
832 err = PTR_ERR(new); 832 err = PTR_ERR(new);
833 kfree(old); 833 kfree(old);
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index bcf1fb7c7f32..7c3450d063fe 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -417,7 +417,7 @@ exit_err:
417static struct audit_entry *audit_rule_to_entry(struct audit_rule *rule) 417static struct audit_entry *audit_rule_to_entry(struct audit_rule *rule)
418{ 418{
419 struct audit_entry *entry; 419 struct audit_entry *entry;
420 struct audit_field *f; 420 struct audit_field *ino_f;
421 int err = 0; 421 int err = 0;
422 int i; 422 int i;
423 423
@@ -499,9 +499,9 @@ static struct audit_entry *audit_rule_to_entry(struct audit_rule *rule)
499 } 499 }
500 } 500 }
501 501
502 f = entry->rule.inode_f; 502 ino_f = entry->rule.inode_f;
503 if (f) { 503 if (ino_f) {
504 switch(f->op) { 504 switch(ino_f->op) {
505 case AUDIT_NOT_EQUAL: 505 case AUDIT_NOT_EQUAL:
506 entry->rule.inode_f = NULL; 506 entry->rule.inode_f = NULL;
507 case AUDIT_EQUAL: 507 case AUDIT_EQUAL:
@@ -526,7 +526,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
526{ 526{
527 int err = 0; 527 int err = 0;
528 struct audit_entry *entry; 528 struct audit_entry *entry;
529 struct audit_field *f; 529 struct audit_field *ino_f;
530 void *bufp; 530 void *bufp;
531 size_t remain = datasz - sizeof(struct audit_rule_data); 531 size_t remain = datasz - sizeof(struct audit_rule_data);
532 int i; 532 int i;
@@ -654,9 +654,9 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
654 } 654 }
655 } 655 }
656 656
657 f = entry->rule.inode_f; 657 ino_f = entry->rule.inode_f;
658 if (f) { 658 if (ino_f) {
659 switch(f->op) { 659 switch(ino_f->op) {
660 case AUDIT_NOT_EQUAL: 660 case AUDIT_NOT_EQUAL:
661 entry->rule.inode_f = NULL; 661 entry->rule.inode_f = NULL;
662 case AUDIT_EQUAL: 662 case AUDIT_EQUAL:
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index e128adcb33c2..091409996577 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1293,7 +1293,6 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
1293 break; } 1293 break; }
1294 1294
1295 case AUDIT_SOCKETCALL: { 1295 case AUDIT_SOCKETCALL: {
1296 int i;
1297 struct audit_aux_data_socketcall *axs = (void *)aux; 1296 struct audit_aux_data_socketcall *axs = (void *)aux;
1298 audit_log_format(ab, "nargs=%d", axs->nargs); 1297 audit_log_format(ab, "nargs=%d", axs->nargs);
1299 for (i=0; i<axs->nargs; i++) 1298 for (i=0; i<axs->nargs; i++)
@@ -1318,7 +1317,6 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
1318 1317
1319 for (aux = context->aux_pids; aux; aux = aux->next) { 1318 for (aux = context->aux_pids; aux; aux = aux->next) {
1320 struct audit_aux_data_pids *axs = (void *)aux; 1319 struct audit_aux_data_pids *axs = (void *)aux;
1321 int i;
1322 1320
1323 for (i = 0; i < axs->pid_count; i++) 1321 for (i = 0; i < axs->pid_count; i++)
1324 if (audit_log_pid_context(context, axs->target_pid[i], 1322 if (audit_log_pid_context(context, axs->target_pid[i],