From patchwork Sat Mar 26 08:30:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 12792281 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA042C433F5 for ; Sat, 26 Mar 2022 08:31:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9I0ytxWbMJ5THWVjC2Hb58WW8Odhz/65Zvtuk/6sWZo=; b=jDBW4n6j/6k/zg lp4Y/MIa466I9rupqyuOCZWAQn5N4IenrfSKGSiT4rI+zvEi59nPpMw8dADoY5VnxTMMxw12t0Jax fC1pZsRCTntL7T3WFgW56Jkqmb6+1Qu4x01mb+IJnpy3ITPAUsLshJGbcLAvj6ufeESV/j4HVuPT/ gQnKrR85Ixm/gK3pyPnVqTcYFCw6MpJPcx0M/pDYYvK/kjjVMZS6Tq6RzVrxVlzS/4jtC/zxaqOIb J8N0MOcT9xy4c/NabPhgJ9w/cfeVxuwmwuM8AqE4BP/Rr29rKCHo57E9ajU6iP10cGdTGzpr7jn4u eeavzVQ4YCE4JVEJCNsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nY1od-0041V4-6g; Sat, 26 Mar 2022 08:30:31 +0000 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nY1oZ-0041UI-PX; Sat, 26 Mar 2022 08:30:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:subject:message-id:mime-version; bh=k0UUO0tpe6iB/NeO54/D16HXKMvRI4x1p6I1aw+up2s=; b=LXdLsZeVln/VP9fjGd7IoFO+xOXXE1pUDvIQsVKCRL5BtAelVCm7IbFk v4qe6/H+3EZpPUvvdTUn0e57JG7rR3U5KGJ+fpq7QD215xk8uY7VI5z+j 50ClzQR78eIJ40otxyHCDtb6YvqBzrh8wlTRdMEAhL2ZOHyKPBTUI35CZ 4=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.90,211,1643670000"; d="scan'208";a="28279519" Received: from 203.107.68.85.rev.sfr.net (HELO hadrien) ([85.68.107.203]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2022 09:30:25 +0100 Date: Sat, 26 Mar 2022 09:30:25 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org, Amit Kumar Mahapatra , Michal Simek , Tudor Ambarus , Michael Walle , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220326_013028_132005_59BA038C X-CRM114-Status: UNSURE ( 7.68 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: kernel test robot Use min to simplify the code. Generated by: scripts/coccinelle/misc/minmax.cocci Fixes: 2747bc2106aa ("mtd: spi-nor: Add dual parallel and stacked mode support") 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_LTS head: 1870e0fa79a9d58c6748c34550f3ccea0b515933 commit: 2747bc2106aa429773d9a932c799aa6229595148 [840/1029] mtd: spi-nor: Add dual parallel and stacked mode support :::::: branch date: 34 hours ago :::::: commit date: 8 weeks ago drivers/mtd/spi-nor/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 = len; - else - read_len = rem_bank_len; + read_len = min(len, rem_bank_len); /* Wait till previous write/erase is done. */ ret = spi_nor_wait_till_ready(nor);