From: Patrick McHardy <kaber@trash.net>
To: jamal <hadi@cyberus.ca>
Cc: Maillist netdev <netdev@oss.sgi.com>
Subject: [PATCH PKT_SCHED 5/22]: act_api.c: remove unnecessary initializations
Date: Mon, 10 Jan 2005 20:37:51 +0100 [thread overview]
Message-ID: <41E2D98F.7050405@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: 05.diff --]
[-- Type: text/x-patch, Size: 2822 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2005/01/09 22:52:33+01:00 kaber@coreworks.de
# [PKT_SCHED]: act_api.c: remove unnecessary initializations
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/sched/act_api.c
# 2005/01/09 22:52:25+01:00 kaber@coreworks.de +10 -13
# [PKT_SCHED]: act_api.c: remove unnecessary initializations
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c
--- a/net/sched/act_api.c 2005-01-10 06:22:01 +01:00
+++ b/net/sched/act_api.c 2005-01-10 06:22:01 +01:00
@@ -274,7 +274,7 @@
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 @@
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 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 *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 @@
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 @@
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 @@
} 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 @@
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 @@
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);
reply other threads:[~2005-01-10 19:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=41E2D98F.7050405@trash.net \
--to=kaber@trash.net \
--cc=hadi@cyberus.ca \
--cc=netdev@oss.sgi.com \
/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;
as well as URLs for NNTP newsgroup(s).