Re: [PATCH 1/3] mm: generalize VM_BUG_ON() macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/01/2014 07:31 AM, Kirill A. Shutemov wrote:
> +#define _VM_DUMP(arg, cond) do {					\
> +	if (__builtin_types_compatible_p(typeof(*arg), struct page))	\
> +		dump_page((struct page *) arg,				\
> +				"VM_BUG_ON(" __stringify(cond)")");	\
> +	else if (__builtin_types_compatible_p(typeof(*arg),		\
> +				struct vm_area_struct))			\
> +		dump_vma((struct vm_area_struct *) arg);		\
> +	else if (__builtin_types_compatible_p(typeof(*arg),		\
> +				struct mm_struct))			\
> +		dump_mm((struct mm_struct *) arg);			\
> +	else								\
> +		BUILD_BUG();						\
> +} while(0)

__same_type() instead of __builtin_types_compatible_p() would look nicer,
but I don't think that all compilers support that:

	include/linux/compiler-intel.h:/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */

So it would effectively disable VM_BUG_ONs on Intel's compiler.


Thanks,
Sasha

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]