From patchwork Thu Sep 24 10:00:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 263525 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C56A3C4363D for ; Thu, 24 Sep 2020 10:01:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6BBD4221EB for ; Thu, 24 Sep 2020 10:01:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726681AbgIXKBP (ORCPT ); Thu, 24 Sep 2020 06:01:15 -0400 Received: from mo-csw1115.securemx.jp ([210.130.202.157]:51966 "EHLO mo-csw.securemx.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbgIXKBP (ORCPT ); Thu, 24 Sep 2020 06:01:15 -0400 Received: by mo-csw.securemx.jp (mx-mo-csw1115) id 08OA11GR025727; Thu, 24 Sep 2020 19:01:01 +0900 X-Iguazu-Qid: 2wHHWkRyd75cutEjQ0 X-Iguazu-QSIG: v=2; s=0; t=1600941660; q=2wHHWkRyd75cutEjQ0; m=BF8o1VAC+j9JfB+gfUQkwCt6SD05lcph2ZL5dRZIZnY= Received: from imx12.toshiba.co.jp (imx12.toshiba.co.jp [61.202.160.132]) by relay.securemx.jp (mx-mr1111) id 08OA0v2x037051; Thu, 24 Sep 2020 19:00:58 +0900 Received: from enc02.toshiba.co.jp ([61.202.160.51]) by imx12.toshiba.co.jp with ESMTP id 08OA0vPG017684; Thu, 24 Sep 2020 19:00:57 +0900 (JST) Received: from hop101.toshiba.co.jp ([133.199.85.107]) by enc02.toshiba.co.jp with ESMTP id 08OA0vKr007861; Thu, 24 Sep 2020 19:00:57 +0900 From: Nobuhiro Iwamatsu To: stable@vger.kernel.org Cc: Ben Hutchings , Boris Brezillon , Nobuhiro Iwamatsu Subject: [PATCH for 4.4 and 4.9] mtd: Fix comparison in map_word_andequal() Date: Thu, 24 Sep 2020 19:00:54 +0900 X-TSB-HOP: ON Message-Id: <20200924100054.367518-1-nobuhiro1.iwamatsu@toshiba.co.jp> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ben Hutchings commit ea739a287f4f16d6250bea779a1026ead79695f2 upstream. Commit 9e343e87d2c4 ("mtd: cfi: convert inline functions to macros") changed map_word_andequal() into a macro, but also changed the right hand side of the comparison from val3 to val2. Change it back to use val3 on the right hand side. Thankfully this did not cause a regression because all callers currently pass the same argument for val2 and val3. Fixes: 9e343e87d2c4 ("mtd: cfi: convert inline functions to macros") Signed-off-by: Ben Hutchings Signed-off-by: Boris Brezillon Signed-off-by: Nobuhiro Iwamatsu (CIP) --- include/linux/mtd/map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.28.0 diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index b5b43f94f31162..01b990e4b228a9 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h @@ -312,7 +312,7 @@ void map_destroy(struct mtd_info *mtd); ({ \ int i, ret = 1; \ for (i = 0; i < map_words(map); i++) { \ - if (((val1).x[i] & (val2).x[i]) != (val2).x[i]) { \ + if (((val1).x[i] & (val2).x[i]) != (val3).x[i]) { \ ret = 0; \ break; \ } \