From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.bootlin.com ([62.4.15.54]:56277 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989AbeCGHPB (ORCPT ); Wed, 7 Mar 2018 02:15:01 -0500 Date: Wed, 7 Mar 2018 08:14:58 +0100 From: Boris Brezillon To: Ben Hutchings Cc: Arnd Bergmann , Richard Weinberger , Boris Brezillon , stable@vger.kernel.org, Greg Kroah-Hartman , LKML Subject: Re: [PATCH 4.4 054/108] mtd: cfi: convert inline functions to macros Message-ID: <20180307081458.4f311a45@bbrezillon> In-Reply-To: <1520216572.2786.64.camel@codethink.co.uk> References: <20180215151222.267507937@linuxfoundation.org> <20180215151229.973271532@linuxfoundation.org> <1520216572.2786.64.camel@codethink.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: stable-owner@vger.kernel.org List-ID: On Mon, 05 Mar 2018 02:22:52 +0000 Ben Hutchings wrote: > On Thu, 2018-02-15 at 16:16 +0100, Greg Kroah-Hartman wrote: > > 4.4-stable review patch.  If anyone has any objections, please let me know. > > > > ------------------ > > > > From: Arnd Bergmann > > > > commit 9e343e87d2c4c707ef8fae2844864d4dde3a2d13 upstream. > [...] > > -static inline int map_word_andequal(struct map_info *map, map_word val1, map_word val2, map_word val3) > > -{ > > - int i; > > - > > - for (i = 0; i < map_words(map); i++) { > > - if ((val1.x[i] & val2.x[i]) != val3.x[i]) > > - return 0; > > - } > > - > > - return 1; > > -} > [...] > > +#define map_word_andequal(map, val1, val2, val3) \ > > +({ \ > > + int i, ret = 1; \ > > + for (i = 0; i < map_words(map); i++) { \ > > + if (((val1).x[i] & (val2).x[i]) != (val2).x[i]) { \ > [...] > > The right-hand side of this comparison is now using val2 instead of > val3. (This bug seems to be unfixed upstream.) Indeed. This being said, it's not buggy since all users of map_word_andequal() pass the same value to val2 and val3. Maybe we should just patch the macro and all call-sites to remove val3. > > Ben. > -- Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com