From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752906AbbFAIfm (ORCPT ); Mon, 1 Jun 2015 04:35:42 -0400 Received: from mail-bn1bon0143.outbound.protection.outlook.com ([157.56.111.143]:30638 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752278AbbFAIfd convert rfc822-to-8bit (ORCPT ); Mon, 1 Jun 2015 04:35:33 -0400 X-Greylist: delayed 913 seconds by postgrey-1.27 at vger.kernel.org; Mon, 01 Jun 2015 04:35:32 EDT Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; arm.linux.org.uk; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NP9B5Q-07-14Q-02 X-M-MSG: Message-ID: <556C15BA.7000909@amd.com> Date: Mon, 1 Jun 2015 10:20:10 +0200 From: =?UTF-8?B?Q2hyaXN0aWFuIEvDtm5pZw==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Russell King - ARM Linux , Mikko Rapeli CC: Krzysztof Kozlowski , , , "Seung-Woo Kim" , , , Kyungmin Park , Kukjin Kim , Subject: Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h References: <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi> <1433000370-19509-6-git-send-email-mikko.rapeli@iki.fi> <20150530164655.GM2067@n2100.arm.linux.org.uk> In-Reply-To: <20150530164655.GM2067@n2100.arm.linux.org.uk> Content-Type: text/plain; charset="utf-8"; format=flowed X-Originating-IP: [10.224.52.127] Content-Transfer-Encoding: 8BIT X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD016;1:ZgWSdWkvfXnEm0LnM5h7EvihAyMdWIXBp7LDC2DBSLOYTJMWdLlBIr53KxmE3l+d5QhwAjnINA4eURlvkXyUKHHf0ru4bWYZz7vULCLO4U27liVaJ3U030uSwRGECPfkLVdd7vExY3+P6qerflucHiYMEb9GI/XWMHtsGtGfcmE+udG5YLV29N9DRfUaHwydW/4n5uQWoDoFdeC290gV5AFadYo8MstNPFS6zZJhQLXWJGgtQ+UaWM3S6Sy2eIDblxJnyrtR+rvW2zqJmfhu8Q== X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(199003)(24454002)(51444003)(51704005)(189002)(87936001)(85182001)(64706001)(65956001)(68736005)(77096005)(77156002)(62966003)(64126003)(65806001)(46102003)(85202003)(47776003)(106466001)(83506001)(19580395003)(19580405001)(80316001)(92566002)(50986999)(50466002)(86362001)(101416001)(33656002)(76176999)(87266999)(54356999)(65816999)(5001860100001)(59896002)(105586002)(5001920100001)(5001830100001)(97736004)(4001350100001)(4001540100001)(189998001)(5001770100001)(2950100001)(36756003)(23676002)(3940600001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR02MB1114;H:atltwp01.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1114; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:BY1PR02MB1114;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1114; X-Forefront-PRVS: 05947791E4 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2015 08:20:15.7751 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR02MB1114 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30.05.2015 18:46, Russell King - ARM Linux wrote: > On Sat, May 30, 2015 at 05:37:57PM +0200, Mikko Rapeli wrote: >> Fixes userspace compilation error: >> >> drm/exynos_drm.h:30:2: error: unknown type name ‘uint64_t’ >> >> Signed-off-by: Mikko Rapeli > This is another thing which we need to address. We should not be using > unsigned int/unsigned long/uintXX_t/etc in here, but the __uXX and __sXX > types. > > The lesson learned from other DRM developers is that using these types > simplifies the API especially when it comes to the differences between > 32-bit and 64-bit machines, and compat applications. > > Note that drm/drm.h is all that should need to be included - drm/drm.h > takes care of including linux/types.h when building on Linux platforms. > (note: if your compiler doesn't set __linux__ then you're probably not > using the proper compiler...) > Using types that differs on 32-bit and 64-bit machines for a kernel interface is indeed a rather bad idea. This not only includes longs, but pointers as well. But the int8_t, int16_t int32_t, int64_t and their unsigned counterparts are defined in stdint.h which is part of the ISO/IEC 9899:1999 standard, similar is true for size_t. The __uXX, __sXX and _kernel_size_t types are linux specific as far as I know. For best interoperability and standard conformance I think that definitions from the C standard we use should out-rule linux specific definitions. Additional to that "linux/types.h" is not part of the uapi as far as I know, so including it in a header which is part of the uapi should be forbidden. So this is a NAK from my side for the whole series, userspace programs should include for the definition of the ISO/IEC 9899:1999 standard types if necessary. Regards, Christian.