From nobody Sun Jun 28 09:39:23 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42CD9C433EF for ; Wed, 9 Feb 2022 12:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbiBIMDe (ORCPT ); Wed, 9 Feb 2022 07:03:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231707AbiBIMDL (ORCPT ); Wed, 9 Feb 2022 07:03:11 -0500 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEA9FC002B6F for ; Wed, 9 Feb 2022 03:35:22 -0800 (PST) X-IronPort-AV: E=Sophos;i="5.88,355,1635199200"; d="scan'208";a="5432318" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 12:35:21 +0100 Date: Wed, 9 Feb 2022 12:35:20 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Amit Kumar Mahapatra , Michal Simek , Tudor Ambarus , Michael Walle , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] mtd: spi-nor: fix minmax.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: kernel test robot Simplify the cide using min(). Generated by: scripts/coccinelle/misc/minmax.cocci Fixes: 2747bc2106aa ("mtd: spi-nor: Add dual parallel and stacked mode supp= ort") CC: Amit Kumar Mahapatra Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15 head: 1183ce490adb103e5e569b8ebd74c50c885ddc05 commit: 2747bc2106aa429773d9a932c799aa6229595148 [840/872] mtd: spi-nor: Ad= d dual parallel and stacked mode support :::::: branch date: 7 days ago :::::: commit date: 7 days ago core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2034,10 +2034,7 @@ static int spi_nor_read(struct mtd_info (offset << nor->shift); } } - if (len < rem_bank_len) - read_len =3D len; - else - read_len =3D rem_bank_len; + read_len =3D min(len, rem_bank_len); /* Wait till previous write/erase is done. */ ret =3D spi_nor_wait_till_ready(nor);