* Re: [Bluez-devel] [-mm Patch] net/bluetooth/hidp/core.c: Make hidp_setup_input() return int
[not found] ` <46F6E502.9000101@tiscali.nl>
@ 2007-09-24 7:09 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2007-09-24 7:09 UTC (permalink / raw)
To: roel; +Cc: WANG Cong, Andrew Morton, maxk, linux-kernel, bluez-devel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Bluez-devel] [-mm Patch] net/bluetooth/hidp/core.c: Make hidp_setup_input() return int
[not found] ` <20070924113035.GE2442@hacking>
@ 2007-09-24 22:18 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2007-09-24 22:18 UTC (permalink / raw)
To: WANG Cong; +Cc: maxk, Andrew Morton, roel, linux-kernel, bluez-devel
Hi Wang,
> This patch:
> - makes hidp_setup_input() return int to indicate errors;
> - checks its return value to handle errors.
>
> And this time it is against -rc7-mm1 tree.
>
> Thanks to roel and Marcel Holtmann for comments.
>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-09-24 22:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20070918011841.2381bd93.akpm@linux-foundation.org>
[not found] ` <20070923030105.GH2475@hacking>
[not found] ` <46F6E502.9000101@tiscali.nl>
2007-09-24 7:09 ` [Bluez-devel] [-mm Patch] net/bluetooth/hidp/core.c: Make hidp_setup_input() return int Marcel Holtmann
[not found] <20070924021716.9bfe7dfb.akpm@linux-foundation.org>
[not found] ` <20070924113035.GE2442@hacking>
2007-09-24 22:18 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox