Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1711431lqg; Mon, 4 Mar 2024 01:01:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVKyP+Lq7RpGSCTpRFSXnOLLgM0JUuABHolmpapFOgbwjtlS7IzXJL1CJvOk/vbb/Y2a996GAv2iTgTvsywTNYlQrpjkD8l46jOd+QUTg== X-Google-Smtp-Source: AGHT+IExsTZZEyJp2dmGzLOs7gFls5/Jfnt56qo5bRqK+Y/D9HCWNm8Zu1FtNib4i4G+MfTVdaAk X-Received: by 2002:a17:906:3c10:b0:a43:c0f7:d2cd with SMTP id h16-20020a1709063c1000b00a43c0f7d2cdmr5571082ejg.3.1709542889275; Mon, 04 Mar 2024 01:01:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709542889; cv=pass; d=google.com; s=arc-20160816; b=d2BSnkMZE5Rehi7N8UrqIN7RBbINEhRiEsO+gVGWYyfPt14hK8Odo0fLGZgdGLrtMe qNW1LS1PnCW3OELtowAW0M2rLhjSPbrmt9IB9DS+PgXn1ZyJa0uxFdhwOyFfU97ZWXy4 UqadBpmd0LDE1fDER1DCsgFv5xMxBJEWOMcS6fJRlaMBMe+0TV+F9Gjx4l2MXqaR5odC gSo5sa5cbV6e6wa2s1A91M2QFOBXShIPYSLaCNCbutGTAMG80nitVK6NqCeojnnlLlhd iPaa86eV4DKs/BBWffCfd/BU73GUGE4raeJvKRqPlUEF9VaMJKEdApVK8oLmUSH8YYzC 8wzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=57E4vZqJOCpNmpFrizYu/zu6Cc5QAvi9e5NZvjVLZbY=; fh=xrRzzZKDe3pD03Ov6NLG3+bUKM/9Lzz0w05ooeW3rqo=; b=atu4eQ0Fg4SQ/F2SerkDF5o7z8DEvOOe5/1P9l0R0986Reamh7qQUw/fR+xDvOcwUL d+mI2SXH4y65sGRICLGUzYhmDispeNpiTb62nARjPxAuVH56ctgfhKZ5pDeoudIf7gFY EoCFGreu5CjS8ovvKwlbQLF1rQSPDuxyE/td2r4s3b9ZAUxNCUgVVSLnPvHoJITFEYdL nBGpYhYdonzeGIfC8GTcw+JDeWqV2yYAc912slt2ZS7g9onChsuQQhtjUqtsGqEeUb35 /YMGPRRDQ9Ly5r0TspM93t3sdKOSWCBLPohJQzN37oxzzdCm/nLvGQzWkyb401wngUuS HBGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="CFN/4qSk"; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-90263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90263-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k11-20020a1709063e0b00b00a453b01d439si775764eji.353.2024.03.04.01.01.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 01:01:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="CFN/4qSk"; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-90263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90263-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 072CD1F22FB5 for ; Mon, 4 Mar 2024 09:01:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7928F1B5A0; Mon, 4 Mar 2024 09:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="CFN/4qSk" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17F27199B9; Mon, 4 Mar 2024 09:00:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709542847; cv=none; b=R8F96DA3DurYOJe6OzRGGECxBnA75qtvNAAzK8mJmFW8lZZynNyvEZOgd/Irrjwg68uqVE2/zs+k5BLocndeFnO8WUM1Wc4np+H8G4f+G1D9oncrqBOcRDs7tS8JKH+CBTrcGXPmuAcYlTri7L/CH13ajiKlfSasB3+pk3mEWfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709542847; c=relaxed/simple; bh=bAB5F4vNP6IVN7+dQqmn759QyLQ7N1UG2FLkohO65P8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=mPnU2L+Z/vEmgMsomkUw1RClRtCBYMiJNbkMe89udz2w5Cus5N0bhxA5/zft5FdDkTEJHEqSHqzuMU1eqjCbKPTHd+SpHQUd58EveWJ1jHji2gAxPOa5FxY4dH926bL5h3KABByP6ezZwuaLKNi2V3UUmNUvBg7P/GD+tCmwtyk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=CFN/4qSk; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1709542844; bh=bAB5F4vNP6IVN7+dQqmn759QyLQ7N1UG2FLkohO65P8=; h=From:To:Cc:Subject:Date:From; b=CFN/4qSkWBc9srp/cqJivW54+P7ZwVqVbVST0wpPuMjw9RIgz/SLskeWyjaIvuQil 18X5kSm0FG1hFvv/vCUz2mMeIX6SjaJwNZ05GEPpy5wtRk52rfWWclC0EBq0IK1Jyd KBgyp419NNL7VdiV8tzw1zA90IdPNgwN16k05ChE4tKD3vPEGz4dpKvmZ7wFpSbuqR J0i57OXQ2J/mRtLteKNq4fAJ7iavX1dT/KxzWQNDpSX5pXH7PYffTMepvrrFjUDEWi PXe2A1AgTR/CQP+SpzE5Z+Wn892rOedK2eH+SSGJoCW/nWausLiwhQS14AV59zHPT6 UMwjMPdN2Feaw== Received: from localhost.localdomain (broslavsky.collaboradmins.com [68.183.210.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id AC13F3781FE9; Mon, 4 Mar 2024 09:00:41 +0000 (UTC) From: Muhammad Usama Anjum To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Takahiro Kuwano Cc: Muhammad Usama Anjum , kernel@collabora.com, kernel-janitors@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] mtd: spi-nor: core: correct type of i Date: Mon, 4 Mar 2024 14:01:03 +0500 Message-Id: <20240304090103.818092-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The i should be signed to find out the end of the loop. Otherwise, i >= 0 is always true and loop becomes infinite. Make its type to be int. Fixes: 6a9eda34418f ("mtd: spi-nor: core: set mtd->eraseregions for non-uniform erase map") Signed-off-by: Muhammad Usama Anjum --- Changes since v1: - Make i int instead of u8 --- drivers/mtd/spi-nor/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 65b32ea59afc6..3e1f1913536bf 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3373,7 +3373,7 @@ static u32 spi_nor_get_region_erasesize(const struct spi_nor_erase_region *region, const struct spi_nor_erase_type *erase_type) { - u8 i; + int i; if (region->overlaid) return region->size; -- 2.39.2