Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp338364lqg; Fri, 1 Mar 2024 06:46:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWWcpZCRnWB36cDLFh1Ipu7h1JpDCeZ6nen0BXp/gEaUNCS4uzYwC5/xAH7+/Se/U8cjcoiIYZ8aCdyW3JNHGxlAvQmab5rDY6JpurV7w== X-Google-Smtp-Source: AGHT+IHoH2llGdyAs5bmD+GmnWwfRgQpIiBWliMoWVuUenGgim29zmWEYyGmzD7d0aX6A73owOnB X-Received: by 2002:a17:906:54c7:b0:a44:44ff:5dd5 with SMTP id c7-20020a17090654c700b00a4444ff5dd5mr1659705ejp.21.1709304382386; Fri, 01 Mar 2024 06:46:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709304382; cv=pass; d=google.com; s=arc-20160816; b=QmHaR6WH9pcI/LjuAR2C4mdahEJUi1hI58wOQaLQ0WifpIr9KCLsxUvf8tc7RuTEY0 LMi33yVdUSz16/NoDI559c9+JLaqilQFUAdW9/+imFq6uf2NDYBX/GQyZ4aRZq6rC9uj k6JcK9n7H/dtjrcnHuLDZzLvJcqPUtgCC6HIH2SVPbrA97kQIkDbY8GQVMiZHVzcp/qM weepAMvrTSHsE+IcVTgX2yCfSQfaw5Rts4jPcEOa1rtx4UFOjl6vbzgn5hTfNJ00DLvb sxdHOevJwBCTFKsf91HZ/6lbjY2peXrmbFBz+qJTTXX87UaAP2dVk9HbZgeVCgrZ1W81 menQ== 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=5XrDubaNLoXexWseEyyU5IrWlisLUPHShfAxwRkaWE4=; fh=xrRzzZKDe3pD03Ov6NLG3+bUKM/9Lzz0w05ooeW3rqo=; b=xpLUaUpFgSAWAtUKQP3bVuCrAumR03dEPNe2s9zP7QUj1E2p0LM4pml9IFhkuC0Q+k dldTnWWSgY7fg7LnNI7bzeonedB8UoLk/6W2/HziKlI7oG8o9uhub/aY7izYODOUX12s p53bnnnmphKiNFX0U+GyKwfoSuE3EiE4aMGnSavpH8qf97qiqIWcbf7rzfK6NMDWJthh FG/keAlE5NOqA1B+hanagA5i5jj0WFERFV9D3/Eoiyx/+kQPNmzzyc1TXbc0ZmlplEjy Fas6vICHSBBPsOfpHmqaKWDcHyN2atwfjPrcrNRdw82BY8iGVVq5vtqBDMc7OSFbwCzF H6qQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=pZkNualV; 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-88581-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88581-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 a4-20020a1709065f8400b00a43f2acc3a7si1450140eju.620.2024.03.01.06.46.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 06:46:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88581-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=pZkNualV; 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-88581-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88581-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 DA7061F2411C for ; Fri, 1 Mar 2024 14:46:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA7B06F077; Fri, 1 Mar 2024 14:45:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="pZkNualV" 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 943EF6E2BD; Fri, 1 Mar 2024 14:44:58 +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=1709304300; cv=none; b=MmSkZsWn3lv5NjIM053aXJTdbHTxd0QVqCDrKeSdgD4WAoqYmxai7LgjjgrZ1PIMpidBTm03YE0lRktwfxmMez0VI9PjVR4zMoXS1reZqzJu17HClkXEPX9YLmSTUnF/MeJfGD7lvPAIWHbGYLS+62skm9jPnEsUNgWA4XF7AZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709304300; c=relaxed/simple; bh=+HDNwzccRkcc9hkZwYDAOt4M5Q55mu65xiChlYxn1dQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WJNqQEXHa2QsUIJd/Dw49NYFmBhrkT9mueREE4Nc3+0i3soV4IQmKqh/Wu/fQIWtQ/J2zt8klO0hFU9Lo+2k6XqQCeTdwypv7xN7PzgVHbYiyZ4jnTuh+8OMpL1R6wER6JXJWtfWsSd81FJL3aUH1Ll4mEEymMCO4W/xSh4XVPA= 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=pZkNualV; 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=1709304297; bh=+HDNwzccRkcc9hkZwYDAOt4M5Q55mu65xiChlYxn1dQ=; h=From:To:Cc:Subject:Date:From; b=pZkNualVekd3oqnVTbyHho7X9a0TfTXMrnaziDRaJuNjpVhtH/ldHxYvBFfjVKGs8 nRTXZokimaEUyf8L/HDeFwqHyiNNDD9SIny/tWWzrFRWqi0eCd/z4kTHb5LZLovYv/ la1r0v6NgLzIg89PPK8lXJi1Qx/K6rfOnIeB5Dp/REZmZ/rbTHybVUX7/cGS6Mn+DR t8AZo93TmYzPzeYWEfeqslFe+xWaf0d2DVURdIUGlY1eMAGAsCWbbYstJ6/RNW42uQ 5XiSJwzhVx4YxHieVKiny3fIds9b51FFRHQnNrAwIdpBlATEOXNCNUYJJTJnU7n6Gr 0PSx8sSrce0XA== 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 EA57137803EE; Fri, 1 Mar 2024 14:44:53 +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] mtd: spi-nor: core: correct type of i to be signed Date: Fri, 1 Mar 2024 19:45:16 +0500 Message-Id: <20240301144517.2811370-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. Fixes: 6a9eda34418f ("mtd: spi-nor: core: set mtd->eraseregions for non-uniform erase map") Signed-off-by: Muhammad Usama Anjum --- 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..46bc45b80883f 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; + s8 i; if (region->overlaid) return region->size; -- 2.39.2