From: Greg Kroah-Hartman Date: Fri, 17 Oct 2014 08:23:27 +0000 (+0200) Subject: queue.c: move a stack variable before the variable array X-Git-Tag: upstream/0.20141102.012929utc~86 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd8c416cf4e49dd06908abec7c4cdad681921f60;p=platform%2Fcore%2Fsystem%2Fkdbus-bus.git queue.c: move a stack variable before the variable array This way the compiler doesn't have to calculate the location of the pointer "on the fly". Signed-off-by: Greg Kroah-Hartman --- diff --git a/queue.c b/queue.c index 56f102a..e89d720 100644 --- a/queue.c +++ b/queue.c @@ -579,6 +579,7 @@ int kdbus_queue_entry_alloc(struct kdbus_conn *conn, struct kdbus_queue_entry **e) { struct kdbus_queue_entry *entry; + struct kdbus_item *it; u64 msg_size; size_t size; size_t dst_name_len = 0; @@ -664,8 +665,8 @@ int kdbus_queue_entry_alloc(struct kdbus_conn *conn, if (dst_name_len > 0) { char tmp[KDBUS_ITEM_HEADER_SIZE + dst_name_len]; - struct kdbus_item *it = (struct kdbus_item *)tmp; + it = (struct kdbus_item *)tmp; it->size = KDBUS_ITEM_HEADER_SIZE + dst_name_len; it->type = KDBUS_ITEM_DST_NAME; memcpy(it->str, kmsg->dst_name, dst_name_len); @@ -686,8 +687,8 @@ int kdbus_queue_entry_alloc(struct kdbus_conn *conn, /* add a FDS item; the array content will be updated at RECV time */ if (kmsg->fds_count > 0) { char tmp[KDBUS_ITEM_HEADER_SIZE]; - struct kdbus_item *it = (struct kdbus_item *)tmp; + it = (struct kdbus_item *)tmp; it->type = KDBUS_ITEM_FDS; it->size = KDBUS_ITEM_HEADER_SIZE + (kmsg->fds_count * sizeof(int));