aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2005-01-09 21:41:28 -0800
committerDavid S. Miller <davem@nuts.davemloft.net>2005-01-09 21:41:28 -0800
commit06fe37b462c2812ba234912d7523b8804642fc4a (patch)
tree2a6f1b239f74308c5ea967c7fbfb652ac58cb1a5 /net
parent785ce914d8cc256118fdd4d1f7798eb686645ed4 (diff)
downloadhistory-06fe37b462c2812ba234912d7523b8804642fc4a.tar.gz
[PKT_SCHED]: act_api.c: remove unnecessary initializations
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/sched/act_api.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 97420faf51154a..7c2fd5ce2bc9a4 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -274,7 +274,7 @@ struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est,
struct tc_action_ops *a_o;
char act_name[4 + IFNAMSIZ + 1];
struct rtattr *tb[TCA_ACT_MAX+1];
- struct rtattr *kind = NULL;
+ struct rtattr *kind;
*err = -EINVAL;
@@ -494,7 +494,7 @@ static int tcf_action_get_1(struct rtattr *rta, struct tc_action *a,
struct tc_action_ops *a_o;
char act_name[4 + IFNAMSIZ + 1];
struct rtattr *tb[TCA_ACT_MAX+1];
- struct rtattr *kind = NULL;
+ struct rtattr *kind;
int index;
int err = -EINVAL;
@@ -563,7 +563,7 @@ static void cleanup_a(struct tc_action *act)
static struct tc_action_ops *get_ao(struct rtattr *kind, struct tc_action *a)
{
char act_name[4 + IFNAMSIZ + 1];
- struct tc_action_ops *a_o = NULL;
+ struct tc_action_ops *a_o;
if (kind != NULL) {
sprintf(act_name, "%s", (char*)RTA_DATA(kind));
@@ -596,7 +596,7 @@ static struct tc_action_ops *get_ao(struct rtattr *kind, struct tc_action *a)
static struct tc_action *create_a(int i)
{
- struct tc_action *act = NULL;
+ struct tc_action *act;
act = kmalloc(sizeof(*act), GFP_KERNEL);
if (act == NULL) {
@@ -617,7 +617,7 @@ static int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid)
struct netlink_callback dcb;
struct rtattr *x;
struct rtattr *tb[TCA_ACT_MAX+1];
- struct rtattr *kind = NULL;
+ struct rtattr *kind;
struct tc_action *a = create_a(0);
int err = -EINVAL;
@@ -677,9 +677,8 @@ err_out:
static int
tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event)
{
- int s = 0;
int i, ret = 0;
- struct tc_action *act = NULL;
+ struct tc_action *act;
struct rtattr *tb[TCA_ACT_MAX_PRIO+1];
struct tc_action *a = NULL, *a_s = NULL;
@@ -707,10 +706,8 @@ tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event)
} else
a = act;
- if (!s) {
- s = 1;
+ if (a_s == NULL)
a_s = a;
- }
ret = tcf_action_get_1(tb[i], act, n, pid);
if (ret < 0) {
@@ -800,8 +797,8 @@ static int
tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr)
{
int ret = 0;
- struct tc_action *act = NULL;
- struct tc_action *a = NULL;
+ struct tc_action *act;
+ struct tc_action *a;
u32 seq = n->nlmsg_seq;
act = tcf_action_init(rta, NULL, NULL, ovr, 0, &ret);
@@ -865,7 +862,7 @@ find_dump_kind(struct nlmsghdr *n)
struct rtattr *tb1, *tb2[TCA_ACT_MAX+1];
struct rtattr *tb[TCA_ACT_MAX_PRIO + 1];
struct rtattr *rta[TCAA_MAX + 1];
- struct rtattr *kind = NULL;
+ struct rtattr *kind;
int min_len = NLMSG_LENGTH(sizeof(struct tcamsg));
int attrlen = n->nlmsg_len - NLMSG_ALIGN(min_len);
struct rtattr *attr = (void *) n + NLMSG_ALIGN(min_len);