On Fri, Nov 27, 2020 at 06:39:24PM +1100, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the akpm-current tree got a conflict in: > > include/linux/kernel.h > > between commit: > > 74d862b682f5 ("sched: Make migrate_disable/enable() independent of RT") > > from the tip tree and commit: > > 761ace49e56f ("kernel.h: Split out mathematical helpers") > > from the akpm-current tree. > > I fixed it up (see below) and can carry the fix as necessary. This > is now fixed as far as linux-next is concerned, but any non trivial > conflicts should be mentioned to your upstream maintainer when your tree > is submitted for merging. You may also want to consider cooperating > with the maintainer of the conflicting tree to minimise any particularly > complex conflicts. Thanks, from my perspective looks good, dunno if scheduler part is okay. > -- > Cheers, > Stephen Rothwell > > diff --cc include/linux/kernel.h > index dbf6018fc312,f97ab3283a8b..000000000000 > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@@ -272,48 -145,13 +159,6 @@@ extern void __cant_migrate(const char * > > #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) > > - /** > - * abs - return absolute value of an argument > - * @x: the value. If it is unsigned type, it is converted to signed type first. > - * char is treated as if it was signed (regardless of whether it really is) > - * but the macro's return type is preserved as char. > - * > - * Return: an absolute value of x. > - */ > - #define abs(x) __abs_choose_expr(x, long long, \ > - __abs_choose_expr(x, long, \ > - __abs_choose_expr(x, int, \ > - __abs_choose_expr(x, short, \ > - __abs_choose_expr(x, char, \ > - __builtin_choose_expr( \ > - __builtin_types_compatible_p(typeof(x), char), \ > - (char)({ signed char __x = (x); __x<0?-__x:__x; }), \ > - ((void)0))))))) > - > - #define __abs_choose_expr(x, type, other) __builtin_choose_expr( \ > - __builtin_types_compatible_p(typeof(x), signed type) || \ > - __builtin_types_compatible_p(typeof(x), unsigned type), \ > - ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other) > - > - /** > - * reciprocal_scale - "scale" a value into range [0, ep_ro) > - * @val: value > - * @ep_ro: right open interval endpoint > - * > - * Perform a "reciprocal multiplication" in order to "scale" a value into > - * range [0, @ep_ro), where the upper interval endpoint is right-open. > - * This is useful, e.g. for accessing a index of an array containing > - * @ep_ro elements, for example. Think of it as sort of modulus, only that > - * the result isn't that of modulo. ;) Note that if initial input is a > - * small value, then result will return 0. > - * > - * Return: a result based on @val in interval [0, @ep_ro). > - */ > - static inline u32 reciprocal_scale(u32 val, u32 ep_ro) > - { > - return (u32)(((u64) val * ep_ro) >> 32); > - } > -#ifndef CONFIG_PREEMPT_RT > -# define cant_migrate() cant_sleep() > -#else > - /* Placeholder for now */ > -# define cant_migrate() do { } while (0) > -#endif > -- > #if defined(CONFIG_MMU) && \ > (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) > #define might_fault() __might_fault(__FILE__, __LINE__) -- With Best Regards, Andy Shevchenko