Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp107046lqs; Mon, 4 Mar 2024 17:10:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXqNlrbHqRdkFmInoeYchR+V8AuImVeTwZ1Hyp/MZX6GjVYDMZBPbUIRMjI4DdQ6nemaG50Tm2b77wD7nynkTEt4umvG7c4H/7Hu1UDYA== X-Google-Smtp-Source: AGHT+IGnI1QrZyLlEXWm7/90QDaDensHSJSHOz0VsT0r+TADKo5DANZrGKxCrudI546NfulFQiB5 X-Received: by 2002:a05:6a21:3510:b0:1a1:22ba:5b68 with SMTP id zc16-20020a056a21351000b001a122ba5b68mr380870pzb.38.1709601036331; Mon, 04 Mar 2024 17:10:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709601036; cv=pass; d=google.com; s=arc-20160816; b=cZSp5Uf6KCN/d+j2fWNaCdC8BkxQ/QuaVVYtBATinrL/qAatL45gfP9cKdv3Fj8Dw4 Lxp05ycc1mn7X+c6o5RezpY0gH822BSFqDKYGxUTQ8xlvLhv5ioKyOMmAasraU902Pqi LuLpj0nEZd8SDBik2bMSs04gx+zAK4L7ThFJYBkBIdZoYDZyVfLsZBWYYLmHxSywEu2W f+bUyqIqq/6tbSm3j7WV/usWmx7e828pBFs/0rR+JlikIW2cED30yy/P2E0jAo7/RkhD hLlgwBuO6b3xbdydSweLHo9skfpksB5TbDRTtZAV1WiYqfNf92NmUhngQfS3gcsnlUQY 4Geg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=eAgT5gjHKKVhhqkTy/NqFbUddc7Qxj55xxgIVvsYtdY=; fh=Xi3y710CxsM+o/LDpoOWyRIzFqqNmBe+VG5JFSUNCCI=; b=Z7di+lXJI6R1o/axwfsp50O9aC1Vwn84M6OcKEiRaq2n3PYzlHQBrJSzDu1KQJXoNU ZRxAWcZqFjN4yyqm/pa5xfpTsQjZr3gwnb1cHchVrs8mtTjQg1YhsnA/EDi05QCGCxwO zmrQF6FvUNkQPR4MhPlfGu2V7Evx28kaStxMVIu+IDO5juxcRfF+nW5wUCt4f8BS9Z6r mjsMS5+ibCzWRfSVvSTJKt4xd9oAXiqD/Zpqg8XVQ3oTueTQXX0LRVXXXIkO2qO5GYNq Qu4kjo8dLnqedXq/FsUZBDGcBoYT3q5WtIVhk0WsSUt6AqzVraqEwOgBLO4fWpzy/zwE EhNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LCC89Wav; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-91484-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91484-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p7-20020a17090a428700b00298b2c91096si11148831pjg.136.2024.03.04.17.10.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 17:10:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91484-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LCC89Wav; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-91484-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91484-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 269AB283DE0 for ; Tue, 5 Mar 2024 01:10:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FCF4125DC; Tue, 5 Mar 2024 01:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LCC89Wav" Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2372CFC0A; Tue, 5 Mar 2024 01:10:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709601026; cv=none; b=MvJ7JK9w2exdvERuKqgDtpbUlkWzJ4993rNGs2Vh9BMJtsqcKWrDWL8hIv6ICq5FQ+8NLb5kTJvKZ1GG0FoWk8gMvv2/8+LWxyxtIsY4XBU8eO7Hn1WxOCf2qLDlKLX4e/tlGSMW+EB+xRXJxwVu9xvwyQ3KDJYvXE1VxN/ptvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709601026; c=relaxed/simple; bh=JaO4U2AzZDz6iZEvD1/kV2ylA7u2AVftNFacZdl8sX4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eZGIn4e8lOQ5UQOtAqCiBaGTumRqEmVoyhYDMjK3cNz+/rQGMsB/KOBLhwt2QYDuiqgfjZerchqKJ7Gic7zZjjY/GdZXn1TrzulrDILNBxkG1/sFFNVWHc73QxvYdwLmKS0tq8GRhLQdpMHpa+8R3Xj3NkUFZXuyKWK6l1+bCU0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LCC89Wav; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1dd10ae77d8so12524645ad.0; Mon, 04 Mar 2024 17:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709601024; x=1710205824; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eAgT5gjHKKVhhqkTy/NqFbUddc7Qxj55xxgIVvsYtdY=; b=LCC89WavSjZM3UAI7+mOzRP2X6ESyN1dh71MAk2RrZXVaYBGxjNsBGKSeAtaNOSWgB LOWp6JZkIbmN62sKAKF8ed8JFYQmx7kHiaPSHqwHCZtJd40p1QaXURWrOi1wi9w5W1Zu GVhWb6IbW7SI9+H4YgmjFiFJxHnLCyxE7bL/MuwvlEaqsXbr3LMR12JUtfUvgKL/vWgZ aL1eGhcctZE7zdK6dcYNlbL+EHBj4EOujXrd7Aq4OpGgPeJfLcTr2DkHbjOWU0i7TJfV y90VaAbViLh7dM53fEfhKQP45UL2+e3CaufMuuDjvot4as7aDllzNK+o4pba0cSkXAfS cbbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709601024; x=1710205824; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eAgT5gjHKKVhhqkTy/NqFbUddc7Qxj55xxgIVvsYtdY=; b=Y7hP1glqP2YymUBypgRDEx5sXdUi3Rz3Uc79hHUr5ERQSC+MOGbC/rK7PuPgwer/vZ DMfbBhNOICYqPgG62q0tjbj4UBpE9BqRo3fPfGVX7mjsKdLMzOMaCDkAPo65dpDw9o43 wD4mbSIHA+I8FO88XdPU12wZ/RWeEWC7YKp7Djv0Zvq1Yo0iaGnbcokiXuc8VopbQgsA izdXpSxJUa4fiBonkfk3ymzm9kDoS7lW1NsCQZ5WfpOpeonbOaEYNjR4fLu6bblpLqKg 7f7yYCfyCMTwfM+DHEQmaRPpPWKAjohCpYndSLo8Y0Lw1ZjAwlFS1Ta7hewgouWa/UQ4 zexA== X-Forwarded-Encrypted: i=1; AJvYcCV7wlgx9UFdDUoE1ReiHeClusG22w+Nnt/atQGEL1q0rg6Hx2SWT1nt9SafAxtD/xXfL1a1rARkEGy9tnzxuG7v4if9cRKA+sBvePuOYoiE6TUTCNFUFPXNMkdKeEt55itOLFG1lQnTakdplB87 X-Gm-Message-State: AOJu0YxUrhogP9Q7jmlx8ykQQ+5cEihyubXyRYZ8KxECgP3zzyYUSk0l 8t6QhWDitI4jClYWle8tK9vEpOA1Mumf2yitvRHFSFMH3QS9gJmg X-Received: by 2002:a17:903:1249:b0:1db:4419:e925 with SMTP id u9-20020a170903124900b001db4419e925mr550700plh.1.1709601024432; Mon, 04 Mar 2024 17:10:24 -0800 (PST) Received: from [192.168.0.9] (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id j14-20020a170902da8e00b001dc8d6a9d40sm9151662plx.144.2024.03.04.17.10.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Mar 2024 17:10:23 -0800 (PST) Message-ID: <55e95ba4-419c-4e53-b947-5ee209e43fc4@gmail.com> Date: Tue, 5 Mar 2024 10:10:19 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] mtd: spi-nor: core: correct type of i Content-Language: en-US To: Muhammad Usama Anjum , Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Takahiro Kuwano Cc: kernel@collabora.com, kernel-janitors@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240304090103.818092-1-usama.anjum@collabora.com> From: Takahiro Kuwano In-Reply-To: <20240304090103.818092-1-usama.anjum@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, Thanks for pointing out and fixing this. Takahiro On 3/4/2024 6:01 PM, Muhammad Usama Anjum wrote: > 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;