dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Mikko Rapeli <mikko.rapeli@iki.fi>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	linux-samsung-soc@vger.kernel.org, linux-api@vger.kernel.org,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Kukjin Kim <kgene@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 05/98] exynos_drm.h: use __u64 from linux/types.h
Date: Mon, 1 Jun 2015 10:20:10 +0200	[thread overview]
Message-ID: <556C15BA.7000909@amd.com> (raw)
In-Reply-To: <20150530164655.GM2067@n2100.arm.linux.org.uk>

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 <mikko.rapeli@iki.fi>
> 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 <stdint.h> for the definition of the ISO/IEC 9899:1999 
standard types if necessary.

Regards,
Christian.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2015-06-01  8:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi>
2015-05-30 15:37 ` [PATCH 03/98] drm.h: use __kernel_size_t instead of size_t Mikko Rapeli
2015-06-03 17:19   ` Emil Velikov
     [not found]     ` <CACvgo50OLHbvk4scG+pSOW53gR8Ze=yrD4GvbmdE=YRgALjdow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-30 10:42       ` Mikko Rapeli
2015-10-15  6:49       ` Daniel Vetter
2015-05-30 15:37 ` [PATCH 07/98] radeon_drm.h: use __u32 and __u64 from linux/types.h Mikko Rapeli
2015-05-30 15:38 ` [PATCH 08/98] r128_drm.h: include drm/drm.h Mikko Rapeli
     [not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 15:37   ` [PATCH 04/98] drm_mode.h: use __u32 and __u64 from linux/types.h Mikko Rapeli
     [not found]     ` <1433000370-19509-5-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 19:58       ` Frans Klaver
2015-05-30 15:37   ` [PATCH 05/98] exynos_drm.h: use " Mikko Rapeli
     [not found]     ` <1433000370-19509-6-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 16:46       ` Russell King - ARM Linux
2015-06-01  8:20         ` Christian König [this message]
     [not found]           ` <556C15BA.7000909-5C7GfCeVMHo@public.gmane.org>
2015-06-01  8:56             ` Russell King - ARM Linux
     [not found]               ` <20150601085605.GN2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-06-01  9:08                 ` Christian König
2015-06-01  9:14                   ` Frans Klaver
     [not found]                   ` <556C2105.2090607-5C7GfCeVMHo@public.gmane.org>
2015-06-01  9:38                     ` Russell King - ARM Linux
     [not found]                       ` <20150601093808.GP2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-06-01  9:51                         ` Christian König
2015-06-01  9:15             ` Mikko Rapeli
2015-06-02 18:59         ` Mikko Rapeli
2015-05-30 15:37   ` [PATCH 06/98] nouveau_drm.h: use __u32 and " Mikko Rapeli
2015-05-30 15:38   ` [PATCH 09/98] via_drm.h: include linux/types.h instead of non-existing via_drmclient.h Mikko Rapeli
2015-06-03 17:16     ` Emil Velikov
2015-06-04 11:34       ` Emil Velikov
2015-05-30 15:38   ` [PATCH 10/98] via_drm.h: hide struct via_file_private in userspace Mikko Rapeli
     [not found]     ` <1433000370-19509-11-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-06-03 16:50       ` Emil Velikov
2015-09-02 19:17         ` Mikko Rapeli
2015-05-30 15:38   ` [PATCH 12/98] sis_drm.h: hide sis_file_private " Mikko Rapeli
2015-05-30 15:38   ` [PATCH 13/98] drm/i810_drm.h: include drm/drm.h Mikko Rapeli
2015-05-30 15:38 ` [PATCH 11/98] savage_drm.h: include <drm/drm.h> Mikko Rapeli
2015-05-30 15:38 ` [PATCH 14/98] include/uapi/drm/vmwgfx_drm.h: use __s32, __u32 and __u64 from linux/types.h Mikko Rapeli
2015-05-30 15:38 ` [PATCH 15/98] include/uapi/drm/qxl_drm.h: " Mikko Rapeli
2015-05-30 15:38 ` [PATCH 16/98] include/uapi/drm/msm_drm.h: use __s32, __s64, " Mikko Rapeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=556C15BA.7000909@amd.com \
    --to=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mikko.rapeli@iki.fi \
    --cc=sw0312.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).