Re: [PATCH] kdbus: fix type conversion in item macroses

2015-06-04 Thread Sergei Zviagintsev
Hi, On Thu, Jun 04, 2015 at 01:26:03PM +0200, David Herrmann wrote: > Hi > > On Thu, Jun 4, 2015 at 12:39 PM, Sergei Zviagintsev wrote: > > KDBUS_ITEM_NEXT and KDBUS_ITEMS_END macroses do not enclose _i argument > > into parentheses when applying the cast operator. If complex expression > > pass

Re: [PATCH] kdbus: fix type conversion in item macroses

2015-06-04 Thread Sergei Zviagintsev
Hi, On Thu, Jun 04, 2015 at 01:49:15PM +0200, Frans Klaver wrote: > On Thu, Jun 4, 2015 at 12:39 PM, Sergei Zviagintsev wrote: > > macroses > > Sounds like a kind of rash or so ;-). 'macros' would probably sound better. Oh, now I see the difference :) Thank you for correction, I'll resend with

Re: [PATCH] kdbus: fix type conversion in item macroses

2015-06-04 Thread Frans Klaver
On Thu, Jun 4, 2015 at 12:39 PM, Sergei Zviagintsev wrote: > macroses Sounds like a kind of rash or so ;-). 'macros' would probably sound better. Cheers, Frans -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More ma

Re: [PATCH] kdbus: fix type conversion in item macroses

2015-06-04 Thread David Herrmann
Hi On Thu, Jun 4, 2015 at 12:39 PM, Sergei Zviagintsev wrote: > KDBUS_ITEM_NEXT and KDBUS_ITEMS_END macroses do not enclose _i argument > into parentheses when applying the cast operator. If complex expression > passed, e.g. > > KDBUS_ITEM_NEXT(condition ? a : b) > > then type conversion to (

[PATCH] kdbus: fix type conversion in item macroses

2015-06-04 Thread Sergei Zviagintsev
KDBUS_ITEM_NEXT and KDBUS_ITEMS_END macroses do not enclose _i argument into parentheses when applying the cast operator. If complex expression passed, e.g. KDBUS_ITEM_NEXT(condition ? a : b) then type conversion to (u8 *) will go wrong due to precedence rules. Use parentheses properly. Upda