From: Marcel Holtmann <marcel@holtmann.org>
To: roel <12o3l@tiscali.nl>
Cc: WANG Cong <xiyou.wangcong@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
maxk@qualcomm.com, linux-kernel@vger.kernel.org,
bluez-devel@lists.sf.net
Subject: Re: [Bluez-devel] [-mm Patch] net/bluetooth/hidp/core.c: Make hidp_setup_input() return int
Date: Mon, 24 Sep 2007 09:09:11 +0200 [thread overview]
Message-ID: <1190617751.5133.88.camel@aeonflux.holtmann.net> (raw)
In-Reply-To: <46F6E502.9000101@tiscali.nl>
Hi,
> > This patch does the following things:
> >
> > - Make hidp_setup_input() return int to indicate errors.
> > - Check its return value to handle errors.
> >
> > Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> >
> > ---
> > net/bluetooth/hidp/core.c | 7 ++++---
> > 1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > Index: linux-2.6.23-rc6-mm1/net/bluetooth/hidp/core.c
> > ===================================================================
> > --- linux-2.6.23-rc6-mm1.orig/net/bluetooth/hidp/core.c
> > +++ linux-2.6.23-rc6-mm1/net/bluetooth/hidp/core.c
> > @@ -625,7 +625,7 @@ static struct device *hidp_get_device(st
> > return conn ? &conn->dev : NULL;
> > }
> >
> > -static inline void hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req)
> > +static inline int hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req)
> > {
> > struct input_dev *input = session->input;
> > int i;
> > @@ -669,7 +669,7 @@ static inline void hidp_setup_input(stru
> >
> > input->event = hidp_input_event;
> >
> > - input_register_device(input);
> > + return input_register_device(input);
> > }
> >
> > static int hidp_open(struct hid_device *hid)
> > @@ -823,7 +823,8 @@ int hidp_add_connection(struct hidp_conn
> > session->idle_to = req->idle_to;
> >
> > if (session->input)
> > - hidp_setup_input(session, req);
> > + if ((err = (hidp_setup_input(session, req))))
> > + goto failed;
>
> This is confusing, why not just do
>
> if (session->input) {
> err = hidp_setup_input(session, req);
> if (err)
> goto failed;
> }
lets use "if (err < 0)" and I am okay with that patch.
Regards
Marcel
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next parent reply other threads:[~2007-09-24 7:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070918011841.2381bd93.akpm@linux-foundation.org>
[not found] ` <20070923030105.GH2475@hacking>
[not found] ` <46F6E502.9000101@tiscali.nl>
2007-09-24 7:09 ` Marcel Holtmann [this message]
[not found] <20070924021716.9bfe7dfb.akpm@linux-foundation.org>
[not found] ` <20070924113035.GE2442@hacking>
2007-09-24 22:18 ` [Bluez-devel] [-mm Patch] net/bluetooth/hidp/core.c: Make hidp_setup_input() return int Marcel Holtmann
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=1190617751.5133.88.camel@aeonflux.holtmann.net \
--to=marcel@holtmann.org \
--cc=12o3l@tiscali.nl \
--cc=akpm@linux-foundation.org \
--cc=bluez-devel@lists.sf.net \
--cc=bluez-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=maxk@qualcomm.com \
--cc=xiyou.wangcong@gmail.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