staging: ozwpan: Move code from success handling to error handling
Subsystems (2)
PATCH 1/1 staging: ozwpan: Move code from success handling to error handling
The original version was success handling rather than error handling, therefore this patch reduces nesting.
--- drivers/staging/ozwpan/ozhcd.c | 18 +++++++------- drivers/staging/ozwpan/ozpd.c | 53 +++++++++++++++++++++--------------------- 2 files changed, 37 insertions(+), 34 deletions(-)
drivers/staging/ozwpan/ozhcd.c +10 -8
@@ -283,15 +283,17 @@ static struct oz_endpoint *oz_ep_alloc(int buffer_size, gfp_t mem_flags)struct oz_endpoint *ep; ep =kzalloc (sizeof (struct oz_endpoint )+buffer_size, mem_flags); -if (ep) { -INIT_LIST_HEAD (&ep->urb_list); -INIT_LIST_HEAD (&ep->link); - ep->credit =-1 ; -if (buffer_size) { - ep->buffer_size = buffer_size; - ep->buffer = (u8 *)(ep+1 ); - } +if (!ep) +return NULL ; + +INIT_LIST_HEAD (&ep->urb_list); +INIT_LIST_HEAD (&ep->link); + ep->credit =-1 ; +if (buffer_size) { + ep->buffer_size = buffer_size; + ep->buffer = (u8 *)(ep+1 ); } +return ep; }
drivers/staging/ozwpan/ozpd.c +27 -26
61 lines not on this page · raw message
Signature · 1 line
1.9.1
Quoted 4 lines · Quentin Lambert
The original version was success handling rather than error handling, therefore this patch reduces nesting.
Signed-off-by Quentin Lambert <[email protected]>
Fantastic. :) Thanks!
regards,
dan carpenter
Quoted 10 lines · Dan Carpenter
Quoted 4 lines · Quentin Lambert
The original version was success handling rather than error handling, therefore this patch reduces nesting.
Signed-off-by Quentin Lambert <[email protected]>Fantastic. :) Thanks!
regards,
dan carpenter
I am working on a second version to highlight the dependency with the previous patch.
I don't know where the best place to signal it is though. Should I specify it in the comment section linking the patch via lkml mailing list?
Quoted 6 lines · Quentin Lambert
Quoted 4 lines · Dan Carpenter
Quoted 3 lines · Quentin Lambert
The original version was success handling rather than error handling, therefore this patch reduces nesting.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Signed-off-by Quentin Lambert <[email protected]>Fantastic. :) Thanks!
regards,
dan carpenterI am working on a second version to highlight the dependency with the previous patch.
Please don't resend.
Quoted 5 lines
I don't know where the best place to signal it is though. Should I specify it in the comment section linking the patch via lkml mailing list?
Greg applies patches in the order they arrive so it should work automatically. Next time maybe add a comment under the --- cut off.
regards,
dan carpenter