From patchwork Tue Feb 10 08:05:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 44522 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2132E21512 for ; Tue, 10 Feb 2015 08:06:11 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id c13sf10731653eek.1 for ; Tue, 10 Feb 2015 00:06:10 -0800 (PST) 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:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=xExtD/F/okG5faJ2u1bxnZ5Ee6+WWlJJo4jRs/OByKY=; b=deLVaju1mDYbO5qUaux2WXwBxWGaToEZVlXJBZGZmgPXKHlXknvzcgvXUcORQUZUTq i6V9Mk8YBpxeDiBPUsv/ntlhuhBNE8IX2Ue/ZnvxD8fdyMh1TAAk1D5uq4B4BTJmUIFy yZ+yEaX2y155GAwVqa1zq6ObztA6hcQw66gTZHE+g+z0x8WvjB4/8ufQ4uT/pZv8d7AS 3OKNRyAnEXbdCqSckTuIiMoPRxLnds9LH+jwdKvpKx+o/5bjzY9iVWL4z856QqIGeNvQ KPcXM9fLd8c7j3EZkNRYFeVUtlyj/8zrbn6AQx6JwfGcu4V4wZi5ZWiZcTtf0oRpAiwG kQhw== X-Gm-Message-State: ALoCoQmmS5ocqkiRTli5ntiIMOoQZY7g+B1sGbO563+sLMrBzDsF+RkACU2fnfdzjnnZ5x1YdsA/ X-Received: by 10.181.8.70 with SMTP id di6mr1174736wid.5.1423555570317; Tue, 10 Feb 2015 00:06:10 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.74 with SMTP id r10ls548198lag.17.gmail; Tue, 10 Feb 2015 00:06:10 -0800 (PST) X-Received: by 10.112.150.161 with SMTP id uj1mr6335745lbb.14.1423555570092; Tue, 10 Feb 2015 00:06:10 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id w8si11305169laj.145.2015.02.10.00.06.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Feb 2015 00:06:10 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by labhz20 with SMTP id hz20so18516267lab.0 for ; Tue, 10 Feb 2015 00:06:10 -0800 (PST) X-Received: by 10.152.185.72 with SMTP id fa8mr21397328lac.73.1423555570008; Tue, 10 Feb 2015 00:06:10 -0800 (PST) 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.112.35.133 with SMTP id h5csp454441lbj; Tue, 10 Feb 2015 00:06:09 -0800 (PST) X-Received: by 10.140.105.7 with SMTP id b7mr34791260qgf.1.1423555568498; Tue, 10 Feb 2015 00:06:08 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id t5si17494937qar.69.2015.02.10.00.06.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Feb 2015 00:06:08 -0800 (PST) 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-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YL5pa-0003rk-TF; Tue, 10 Feb 2015 08:06:02 +0000 Received: from mail-pd0-f174.google.com ([209.85.192.174]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YL5pU-0003nw-NG for lng-odp@lists.linaro.org; Tue, 10 Feb 2015 08:05:56 +0000 Received: by pdbft15 with SMTP id ft15so37471799pdb.11 for ; Tue, 10 Feb 2015 00:05:51 -0800 (PST) X-Received: by 10.70.22.169 with SMTP id e9mr36057906pdf.162.1423555551140; Tue, 10 Feb 2015 00:05:51 -0800 (PST) Received: from localhost.localdomain ([210.177.145.249]) by mx.google.com with ESMTPSA id rf12sm9541103pdb.29.2015.02.10.00.05.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Feb 2015 00:05:49 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Tue, 10 Feb 2015 16:05:40 +0800 Message-Id: <1423555540-7820-1-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic: strong_types: simplify casting 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.215.51 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 Signed-off-by: Taras Kondratiuk --- platform/linux-generic/include/odp/plat/strong_types.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/platform/linux-generic/include/odp/plat/strong_types.h b/platform/linux-generic/include/odp/plat/strong_types.h index a49c9d6..eacabba 100644 --- a/platform/linux-generic/include/odp/plat/strong_types.h +++ b/platform/linux-generic/include/odp/plat/strong_types.h @@ -20,21 +20,13 @@ /** Use strong typing for ODP types */ #define odp_handle_t struct {} * -/** Internal typedefs for ODP strong type manipulation */ -typedef odp_handle_t _odp_handle_t; - -typedef union { - _odp_handle_t hdl; - uint32_t val; -} _odp_handle_u; - /** Internal macro to get value of an ODP handle */ -#define _odp_typeval(handle) (((_odp_handle_u)(_odp_handle_t)handle).val) +#define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle)) /** Internal macro to get printable value of an ODP handle */ #define _odp_pri(handle) ((uint64_t)_odp_typeval(handle)) /** Internal macro to convert a scalar to a typed handle */ -#define _odp_cast_scalar(type, val) ((type)(size_t)(val)) +#define _odp_cast_scalar(type, val) ((type)(uintptr_t)(val)) #endif