Re: [PATCH v2 14/20] linux/compiler_types.h, linux/same_type.h: Split __same_type() to a separate header

From: Arnd Bergmann
Date: Sun Nov 21 2021 - 08:27:10 EST


On Sat, Nov 20, 2021 at 2:00 PM Alejandro Colomar
<alx.manpages@xxxxxxxxx> wrote:
> --- /dev/null
> +++ b/include/linux/same_type.h
> @@ -0,0 +1,10 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef __LINUX_SAME_TYPE_H
> +#define __LINUX_SAME_TYPE_H
> +
> +
> +/* Are two types/vars the same type (ignoring qualifiers)? */
> +#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
> +

Having a separate header for this is really silly. Please find a
header with similar
definitions that you can add this to.

Arnd