[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130826103726.60f92fbc@gandalf.local.home>
Date: Mon, 26 Aug 2013 10:37:26 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@...achi.com>
Cc: Hidehiro Kawai <hidehiro.kawai.ez@...achi.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
linux-kernel@...r.kernel.org, yrl.pp-manager.tt@...achi.com
Subject: Re: [RFC PATCH 07/11] [CLEANUP] trace-cmd: Split out binding a port
and fork reader from open_udp()
On Mon, 26 Aug 2013 10:48:15 +0900
Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@...achi.com> wrote:
> >> +static int open_udp(const char *node, const char *port, int *pid,
> >> + int cpu, int pagesize, int start_port)
> >> +{
> >> + int sfd;
> >> + int num_port;
> >> +
> >> + num_port = udp_bind_a_port(start_port, &sfd);
> >> + if (num_port < 0)
> >> + return num_port;
> >
> > I don't see how num_port could be less than zero.
>
> I think so, but trace-cmd checks whether udp_port is less than zero or
> not in create_all_readers().
>
> May I submit the removal patch?
It's not a critical path, the check is fine. As there was a check, I
was thinking that you were expecting it to pass an error which it never
did.
Perhaps just add a comment stating that udp_bind_a_port() currently
does not return an error, but if that changes in the future, we have a
check for it now.
That way a reviewer of the code does not get confused by it.
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists