From patchwork Tue Jul 1 18:00:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 32924 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BF5D020672 for ; Tue, 1 Jul 2014 18:00:28 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id il7sf21892645vcb.4 for ; Tue, 01 Jul 2014 11:00:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=MyWfH+l7M9EHedp9ddoinREY9QSEhPUndEZUXFnChy0=; b=DVSldWiKElyAwYQQn1jVRWbFAf7qTREW0Qs5GXFmgFs2rVZsRveeKNbOlfDLLoCvrl wPRcJm1ut/75jtjlKU2FO83QEZOoh5D6VqNWR7rEYaMDLlBmw9q4X86MdJ9tweLqu70Z djgYKKD2+9g8VxlahIAkmOL/yPWKTiyPeA3se0YnP5aECZFCo1Imy8UEGY7pH0wRJVLv GjPGCsNl44iZnyZquY6+kE9jkncz+eRIgAbKM2wcSmvvMXigy22l1EIY/OZYc69+83FS m+vmaJgMvRx3leb4R7fY1pMRNyVNKhREG8cnOuDAFuaBnOMXOJDen2+OywsUvmYfNbSo hGcw== X-Gm-Message-State: ALoCoQmDZUsT4mXJ6fNznLZc5cb7H6/73koIm2QZh0nLiDZ1HiP+Lptiid3ktWGbyrFapHjUz17V X-Received: by 10.236.111.1 with SMTP id v1mr3834191yhg.44.1404237628590; Tue, 01 Jul 2014 11:00:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.90.48 with SMTP id w45ls2036593qgd.73.gmail; Tue, 01 Jul 2014 11:00:28 -0700 (PDT) X-Received: by 10.52.189.161 with SMTP id gj1mr37868317vdc.2.1404237628386; Tue, 01 Jul 2014 11:00:28 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id pv20si11704231vdb.48.2014.07.01.11.00.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Jul 2014 11:00:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hy10so9417448vcb.3 for ; Tue, 01 Jul 2014 11:00:28 -0700 (PDT) X-Received: by 10.220.53.72 with SMTP id l8mr45555280vcg.16.1404237628293; Tue, 01 Jul 2014 11:00:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp234277vcb; Tue, 1 Jul 2014 11:00:27 -0700 (PDT) X-Received: by 10.140.21.35 with SMTP id 32mr41114420qgk.39.1404237627833; Tue, 01 Jul 2014 11:00:27 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 94si30487693qgl.70.2014.07.01.11.00.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 01 Jul 2014 11:00:27 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1X22Jz-0001rk-2O; Tue, 01 Jul 2014 17:58:23 +0000 Received: from mail-la0-f43.google.com ([209.85.215.43]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1X22Jo-0001rC-JS for lng-odp@lists.linaro.org; Tue, 01 Jul 2014 17:58:12 +0000 Received: by mail-la0-f43.google.com with SMTP id e16so6172271lan.2 for ; Tue, 01 Jul 2014 11:00:10 -0700 (PDT) X-Received: by 10.112.166.74 with SMTP id ze10mr189515lbb.94.1404237610621; Tue, 01 Jul 2014 11:00:10 -0700 (PDT) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id js1sm508859lab.7.2014.07.01.11.00.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Jul 2014 11:00:10 -0700 (PDT) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Tue, 1 Jul 2014 21:00:02 +0300 Message-Id: <1404237602-20051-2-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1404237602-20051-1-git-send-email-taras.kondratiuk@linaro.org> References: <1404237602-20051-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCH 2/2] linux-generic: timer: Suppress cast-align warning X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Casting odp_buffer_hdr_t to odp_timeout_hdr_t generates -Wcast-align warning, because these structures may have different alignment requirements. Suppress the warning by casting to intermediate integer type. Reported-by: Anders Roxell Signed-off-by: Taras Kondratiuk --- .../linux-generic/include/odp_timer_internal.h | 3 ++- platform/linux-generic/source/odp_timer.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/include/odp_timer_internal.h b/platform/linux-generic/include/odp_timer_internal.h index 76f1545..c6e3de6 100644 --- a/platform/linux-generic/include/odp_timer_internal.h +++ b/platform/linux-generic/include/odp_timer_internal.h @@ -66,7 +66,8 @@ ODP_ASSERT(sizeof(odp_timeout_hdr_t) % sizeof(uint64_t) == 0, */ static inline odp_timeout_hdr_t *odp_timeout_hdr(odp_timeout_t tmo) { - return (odp_timeout_hdr_t *)odp_buf_to_hdr((odp_buffer_t)tmo); + odp_buffer_hdr_t *buf_hdr = odp_buf_to_hdr((odp_buffer_t)tmo); + return (odp_timeout_hdr_t *)(uintptr_t)buf_hdr; } diff --git a/platform/linux-generic/source/odp_timer.c b/platform/linux-generic/source/odp_timer.c index 5a88c54..69ddbdc 100644 --- a/platform/linux-generic/source/odp_timer.c +++ b/platform/linux-generic/source/odp_timer.c @@ -331,7 +331,6 @@ odp_timeout_t odp_timeout_from_buffer(odp_buffer_t buf) uint64_t odp_timeout_tick(odp_timeout_t tmo) { - odp_timeout_hdr_t *tmo_hdr; - tmo_hdr = (odp_timeout_hdr_t *)odp_buf_to_hdr((odp_buffer_t)tmo); + odp_timeout_hdr_t *tmo_hdr = odp_timeout_hdr(tmo); return tmo_hdr->meta.tick; }