]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: ozwpan: Remove allocation from delaration line
authorQuentin Lambert <lambert.quentin@gmail.com>
Tue, 10 Feb 2015 09:24:12 +0000 (10:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 00:14:08 +0000 (16:14 -0800)
This patch removes allocation from declaration line because
people are known to gloss over declarations.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ozwpan/ozhcd.c
drivers/staging/ozwpan/ozpd.c

index 8543bb29a138c232748c0bd13f2811a5ba494e99..96e95bf8fd323d36f3bb41bda17f0246f17d7886 100644 (file)
@@ -280,8 +280,9 @@ static void oz_free_urb_link(struct oz_urb_link *urbl)
  */
 static struct oz_endpoint *oz_ep_alloc(int buffer_size, gfp_t mem_flags)
 {
-       struct oz_endpoint *ep =
-               kzalloc(sizeof(struct oz_endpoint)+buffer_size, 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);
index 852c288aaf13132398263c3c3d24b49627a29892..1c95d5799217ea2a8aa28ba7a446aa3371c2f25b 100644 (file)
@@ -102,8 +102,9 @@ void oz_pd_put(struct oz_pd *pd)
  */
 struct oz_pd *oz_pd_alloc(const u8 *mac_addr)
 {
-       struct oz_pd *pd = kzalloc(sizeof(struct oz_pd), GFP_ATOMIC);
+       struct oz_pd *pd;
 
+       pd = kzalloc(sizeof(struct oz_pd), GFP_ATOMIC);
        if (pd) {
                int i;
 
@@ -652,8 +653,9 @@ static struct oz_isoc_stream *pd_stream_find(struct oz_pd *pd, u8 ep_num)
  */
 int oz_isoc_stream_create(struct oz_pd *pd, u8 ep_num)
 {
-       struct oz_isoc_stream *st =
-               kzalloc(sizeof(struct oz_isoc_stream), GFP_ATOMIC);
+       struct oz_isoc_stream *st;
+
+       st = kzalloc(sizeof(struct oz_isoc_stream), GFP_ATOMIC);
        if (!st)
                return -ENOMEM;
        st->ep_num = ep_num;