From patchwork Tue Aug 14 12:56:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 177249 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4EE8E2C0092 for ; Tue, 14 Aug 2012 22:57:05 +1000 (EST) Received: from localhost ([::1]:57061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1GgB-0006Qw-9w for incoming@patchwork.ozlabs.org; Tue, 14 Aug 2012 08:57:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1Gfq-0006E3-Ru for qemu-devel@nongnu.org; Tue, 14 Aug 2012 08:56:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1Gfp-0005oO-Or for qemu-devel@nongnu.org; Tue, 14 Aug 2012 08:56:42 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:35015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1Gfp-0005oA-Fe for qemu-devel@nongnu.org; Tue, 14 Aug 2012 08:56:41 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Aug 2012 13:56:39 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 14 Aug 2012 13:56:39 +0100 Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7ECuWJ312648458 for ; Tue, 14 Aug 2012 12:56:32 GMT Received: from d06av08.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7ECuc1l024925 for ; Tue, 14 Aug 2012 06:56:38 -0600 Received: from localhost (stefanha-thinkpad.manchester-maybrook.uk.ibm.com [9.174.219.145]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q7ECubXo024918; Tue, 14 Aug 2012 06:56:37 -0600 From: Stefan Hajnoczi To: Anthony Liguori Date: Tue, 14 Aug 2012 13:56:24 +0100 Message-Id: <1344948988-8627-3-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1344948988-8627-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1344948988-8627-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12081412-0542-0000-0000-000002BB6893 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.113 Cc: Harsh Prateek Bora , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 2/6] trace: remove unnecessary write_to_buffer() typecasting X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Harsh Prateek Bora The buffer argument is void* so it is not necessary to cast. Signed-off-by: Harsh Prateek Bora Signed-off-by: Stefan Hajnoczi --- trace/simple.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trace/simple.c b/trace/simple.c index 5d92939..a0e0f05 100644 --- a/trace/simple.c +++ b/trace/simple.c @@ -235,9 +235,9 @@ int trace_record_start(TraceBufferRecord *rec, TraceEventID event, size_t datasi rec->next_tbuf_idx = new_idx % TRACE_BUF_LEN; rec_off = idx; - rec_off = write_to_buffer(rec_off, (uint8_t*)&event, sizeof(event)); - rec_off = write_to_buffer(rec_off, (uint8_t*)×tamp_ns, sizeof(timestamp_ns)); - rec_off = write_to_buffer(rec_off, (uint8_t*)&rec_len, sizeof(rec_len)); + rec_off = write_to_buffer(rec_off, &event, sizeof(event)); + rec_off = write_to_buffer(rec_off, ×tamp_ns, sizeof(timestamp_ns)); + rec_off = write_to_buffer(rec_off, &rec_len, sizeof(rec_len)); rec->tbuf_idx = idx; rec->rec_off = (idx + sizeof(TraceRecord)) % TRACE_BUF_LEN;