Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp1196685rbe; Fri, 1 Mar 2024 07:04:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWR5fHUl6QuZslUGxmYSbJmuMfuFB0nteqwC8zDTvbtKaxyA1t9pkPk1GMCc9pWzTG51Uf4c8+/N9DZvL+YPcbTJVCDdZuJVghJ4kNASg== X-Google-Smtp-Source: AGHT+IF4nJjfoKt9y54bhQDqEz4T54UFyy+JbiomcjngNvhusquHWj+WF+3UY4p0VlWZJ2k/uJ4f X-Received: by 2002:a17:906:f148:b0:a43:ef41:e9e2 with SMTP id gw8-20020a170906f14800b00a43ef41e9e2mr1451966ejb.52.1709305483401; Fri, 01 Mar 2024 07:04:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709305483; cv=pass; d=google.com; s=arc-20160816; b=neEkiU4LcSo8gojaIHhqRerdWOO5EJibFfSBiVBcI2A0Rx2wpmSkRB/og+2gjnUQiM BVwGiCGk9iuOB60/+L2CaSkLtL9S5Oe/+PvrqFE2umXp+xntP1kKvlvDyJn4lF2Uksg6 l1L6nMeqH3jStRMLCSonZ4hg5EmHptsZuURAC7DwraW7VwxaZO92CgSh/CHrHJD4Cq0R i3FI+bEoAIaO4NLUYlrIXpDcU8jE1QAc5KCB1NCykmJ3PHIUu+Za4Wp8oREQHBOqCZNp j206M4HUmf00TZ9uBMVtHoH8WZivMS5LcpbhFcWsouz1GG4uVWy6ZbE7kXQUb2g1Sire HmUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to :references:subject:to:from:cc:message-id:date:dkim-signature; bh=xETJQ8mQuuGuWYkV4iagGXuyDCVSNZngHsllPMTzBTA=; fh=gnANDl+F2aqN1scNtVq7vACFxuMaiDL3Ex5wOVDCM7U=; b=TZpkkLdFRT8o6ENfgPyzw/9Wj4HQ+3yDb8wHHwhcm1JKK3/DVE37SwlQv/X2AhCPIi 3T91X6OdlQpZux8kk6bRPhuocWGB/35g9+/X0TslD9vEw3SaScSymHGSrpD0dRMSWMI/ nRgPU5/9RVNlDPvbvXnE+RBZMuZtXE++PsON/yVfiG5cA7tp62tw5G8iX1CcXyz7p4un VwXjOUzFjrvfGMMsoQdTKZfylFa9QOtqydTWqx+0g1bi3hnoFnlVHhr9zPM99/nTwRql /AKGIkIaZ+XI4YVbZjdqmr7kz8IrdC8wTAkURMTNVd9coeewGITvsBlBClXGh9128yk3 g4Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RAsmulBD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-88599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w14-20020a170906130e00b00a448f2a95e0si552682ejb.226.2024.03.01.07.04.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 07:04:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88599-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=@kernel.org header.s=k20201202 header.b=RAsmulBD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-88599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 B69531F223A6 for ; Fri, 1 Mar 2024 15:04:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 351B66E607; Fri, 1 Mar 2024 15:04:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RAsmulBD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5ABE315CC; Fri, 1 Mar 2024 15:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709305450; cv=none; b=kEutlPYTNl09pzdjPNIFOQ56tog5wb2Hi9l1aFFX1yes1pmW+zF8pmCh27HR0zfNAcb3pondT2XOHL8cAsJrjRinmfl0bSHDMmkmx068Z4P7jX1BykKy78yqfDdinT67Ye/CiF/SD1zjj41cqkOHcHgJTysAPf1REnakQwIyEPQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709305450; c=relaxed/simple; bh=8b4klxTgnQVm/tbELPg2yxa2m+O4M5Ntj7KUNSDPzxg=; h=Content-Type:Date:Message-Id:Cc:From:To:Subject:References: In-Reply-To; b=sU6Qz5M6ZIhLaza6+KJ18akjX/fRfxfRQw8qIEVN7Xk/9+Yo13rlw3xvTdmGiRnJe7Xdi0/BOakOPdEoDjpfblO7zygaziEK6AkFgdZUd/DdGeMRBtczo/KXMR3AKygM0ItbkE5IDBfRBCYTx7mZBKagAhFSHrnD4YBlcvCFYqc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RAsmulBD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 600BDC433C7; Fri, 1 Mar 2024 15:04:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709305449; bh=8b4klxTgnQVm/tbELPg2yxa2m+O4M5Ntj7KUNSDPzxg=; h=Date:Cc:From:To:Subject:References:In-Reply-To:From; b=RAsmulBD3Akg3zzYlXjxlRTxDWhi/Fo0WxID12TKQmSSDDZOusA3Z4zsU9uKPqCA2 v/wdNRKOuev6YAhsF4mePiXcMqyCmuoDuV+vPQtwPBtFeAQH3Rxc0Ae2GQY3MnJzrZ jtTlBhXMNkBfUXs/acOJcd9RNZAPDBAU+VaUgZPf0BX+7LCfmmOMSh55tBg1C/wiFb UreKVTdQBQ41iVSPGbGw6Smae41j5NtyqA66Wv/Eug5cAysB/hQlp5KCqiRZbJ/KQZ pF0kdv2SItktqY+T5RBCWsCrykY4XWp7B/s6SFMRJeRYIePc3YkwGQC27iCa357ra8 E1qXS+7qwHSUw== Content-Type: multipart/signed; boundary=dcbc775c0ca5af93bb9f19526977feebad1ad56af9d8f64d40c34533ac2c; micalg=pgp-sha256; protocol="application/pgp-signature" Date: Fri, 01 Mar 2024 16:04:01 +0100 Message-Id: Cc: , , , From: "Michael Walle" To: "Muhammad Usama Anjum" , "Tudor Ambarus" , "Pratyush Yadav" , "Miquel Raynal" , "Richard Weinberger" , "Vignesh Raghavendra" , "Takahiro Kuwano" Subject: Re: [PATCH] mtd: spi-nor: core: correct type of i to be signed X-Mailer: aerc 0.16.0 References: <20240301144517.2811370-1-usama.anjum@collabora.com> In-Reply-To: <20240301144517.2811370-1-usama.anjum@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: --dcbc775c0ca5af93bb9f19526977feebad1ad56af9d8f64d40c34533ac2c Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Hi, On Fri Mar 1, 2024 at 3:45 PM CET, Muhammad Usama Anjum wrote: > The i should be signed to find out the end of the loop. Otherwise, > i >=3D 0 is always true and loop becomes infinite. > > Fixes: 6a9eda34418f ("mtd: spi-nor: core: set mtd->eraseregions for non-u= niform 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; Can we just have an "int" here. So we don't shoot ourselves in the foot again. I'm really no friend of these kind of micro optimizations, it should have been int in the first place IMHO. -michael > =20 > if (region->overlaid) > return region->size; --dcbc775c0ca5af93bb9f19526977feebad1ad56af9d8f64d40c34533ac2c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIgEABYIADAWIQQCnWSOYTtih6UXaxvNyh2jtWxG+wUCZeHuYRIcbXdhbGxlQGtl cm5lbC5vcmcACgkQzcodo7VsRvtp+wD+KQl+p3C2+4qOt0VnkpYbjzqiMJxIj7gj O7VZPJX0mA0BAJvAJ948Oer0qeYQC9QCjaW69eLEjcNaL1fCCTXoBPQH =vz1B -----END PGP SIGNATURE----- --dcbc775c0ca5af93bb9f19526977feebad1ad56af9d8f64d40c34533ac2c--