From patchwork Fri Oct 23 23:56:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 9352 Received: (qmail 57208 invoked by alias); 23 Oct 2015 23:56:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 57196 invoked by uid 89); 23 Oct 2015 23:56:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtp.electronicbox.net Received: from smtp.electronicbox.net (HELO smtp.electronicbox.net) (96.127.255.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Oct 2015 23:56:52 +0000 Received: from simark.lan. (cable-192.222.137.139.electronicbox.net [192.222.137.139]) by smtp.electronicbox.net (Postfix) with ESMTP id 51E7F440E78; Fri, 23 Oct 2015 19:56:49 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH obv/c++] Add mmap casts in linux-btrace.c Date: Fri, 23 Oct 2015 19:56:42 -0400 Message-Id: <1445644602-6788-1-git-send-email-simon.marchi@polymtl.ca> FYI, I just pushed this as obvious. gdb/ChangeLog: * linux-btrace.c (linux_enable_pt): Add cast to mmap return. --- gdb/ChangeLog | 4 ++++ gdb/nat/linux-btrace.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4f506e5..a06f568 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2015-10-23 Simon Marchi + + * linux-btrace.c (linux_enable_pt): Add cast to mmap return. + 2015-10-23 Simon Marchi * observer.h (observer_${event}_notification_stub): Add cast. diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c index 3173146..1c3cb40 100644 --- a/gdb/nat/linux-btrace.c +++ b/gdb/nat/linux-btrace.c @@ -820,8 +820,9 @@ linux_enable_pt (ptid_t ptid, const struct btrace_config_pt *conf) goto err; /* Allocate the configuration page. */ - header = mmap (NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, - pt->file, 0); + header = ((struct perf_event_mmap_page *) + mmap (NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, + pt->file, 0)); if (header == MAP_FAILED) goto err_file; @@ -862,8 +863,9 @@ linux_enable_pt (ptid_t ptid, const struct btrace_config_pt *conf) header->aux_size = data_size; length = size; - pt->pt.mem = mmap (NULL, length, PROT_READ, MAP_SHARED, pt->file, - header->aux_offset); + pt->pt.mem = ((const uint8_t *) + mmap (NULL, length, PROT_READ, MAP_SHARED, pt->file, + header->aux_offset)); if (pt->pt.mem != MAP_FAILED) break; }