From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?Q2hyaXN0aWFuIEvDtm5pZw==?= Subject: Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h Date: Mon, 1 Jun 2015 10:20:10 +0200 Message-ID: <556C15BA.7000909@amd.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <20150530164655.GM2067@n2100.arm.linux.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Russell King - ARM Linux , Mikko Rapeli Cc: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-api@vger.kernel.org, Seung-Woo Kim , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kyungmin Park , Kukjin Kim , linux-arm-kernel@lists.infradead.org List-Id: linux-api@vger.kernel.org T24gMzAuMDUuMjAxNSAxODo0NiwgUnVzc2VsbCBLaW5nIC0gQVJNIExpbnV4IHdyb3RlOgo+IE9u IFNhdCwgTWF5IDMwLCAyMDE1IGF0IDA1OjM3OjU3UE0gKzAyMDAsIE1pa2tvIFJhcGVsaSB3cm90 ZToKPj4gRml4ZXMgdXNlcnNwYWNlIGNvbXBpbGF0aW9uIGVycm9yOgo+Pgo+PiBkcm0vZXh5bm9z X2RybS5oOjMwOjI6IGVycm9yOiB1bmtub3duIHR5cGUgbmFtZSDigJh1aW50NjRfdOKAmQo+Pgo+ PiBTaWduZWQtb2ZmLWJ5OiBNaWtrbyBSYXBlbGkgPG1pa2tvLnJhcGVsaUBpa2kuZmk+Cj4gVGhp cyBpcyBhbm90aGVyIHRoaW5nIHdoaWNoIHdlIG5lZWQ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c3RzLmluZnJhZGVhZC5vcmcKaHR0cDov L2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9saW51eC1hcm0ta2VybmVsCg== From mboxrd@z Thu Jan 1 00:00:00 1970 From: christian.koenig@amd.com (=?UTF-8?B?Q2hyaXN0aWFuIEvDtm5pZw==?=) Date: Mon, 1 Jun 2015 10:20:10 +0200 Subject: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h In-Reply-To: <20150530164655.GM2067@n2100.arm.linux.org.uk> 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> Message-ID: <556C15BA.7000909@amd.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.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. 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.