Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4277435imu; Mon, 12 Nov 2018 08:28:16 -0800 (PST) X-Google-Smtp-Source: AJdET5dA2JH8cgs6HLJalFvZfgOyhmwv8N2bj0U6k0oabIsc/PuvL55O5hrBoQ2QP9ef0BT+fu5G X-Received: by 2002:a63:1412:: with SMTP id u18mr1355662pgl.247.1542040096485; Mon, 12 Nov 2018 08:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542040096; cv=none; d=google.com; s=arc-20160816; b=NOrIMO8OSA4CiexM8uYz76IaXuW7L++1JHwMkpBz1Uhob9ppJCylXw2DRJuhcNdw6o YzwmZyjsHapHEv6WMJu5hBUcO0R0RAmnb61DAPRdNbh+4Wu03KcLOrbZBJSsE8zqnhPG vHQb7nS+NspucyNeF6eR1hp/iXOK2YZBZN3w1g5AmQDZ2uzckhOgeuqbwI2lAIqHupKM hI5yCnIqHia2KfyROOO2EDVDXb+/ZXB6la9M6viq0Ec6HAW8V61F+9hxX8NBYomLqSaP uTtQiQyKlivHBO4uck5Vr0NPlpf1Ite4T1spc3UnMP2uj7pooR6xAfoMwldJXdWWUWxS O2CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=43BxuzNc4524qU/znys73ykza2ZaFxC6mmrB9EdAkz8=; b=iWnuy0LGkZTdBCiTplSm82alUSuLswv/TmrUQZqjiA0hDlesFS+Q4qbUXjUWOnBouL Itu0TWPpOMuSt6g7bzrTzsfT68owZCaMKvCjQXHM3xk1w9cCXieUq/ItAPCEmJXcrx2X q0lEmRmiIA1SE9hQAZk2YqcwHJ5rR7XKWwUgzOGO/Nt1zx82nxIT0ymHclTMINpFw2mZ 2DvV85tBusTr9M6aQwzAgWc/rujRbv0zIW64GaoauaY630Q60xm8Xd6WrZd7Jju7Ark5 XKDlyl5fbl+Z2qBQWxVY2HO4V7J+61gXOomeOk12JYYOqLelZxzWtVcDyjo64FOWvDmU tpww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=numwVFBg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si10244619pgh.18.2018.11.12.08.27.43; Mon, 12 Nov 2018 08:28:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=numwVFBg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730042AbeKMCVR (ORCPT + 99 others); Mon, 12 Nov 2018 21:21:17 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43146 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728416AbeKMCVQ (ORCPT ); Mon, 12 Nov 2018 21:21:16 -0500 Received: by mail-lj1-f194.google.com with SMTP id g26-v6so8135829lja.10 for ; Mon, 12 Nov 2018 08:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=43BxuzNc4524qU/znys73ykza2ZaFxC6mmrB9EdAkz8=; b=numwVFBgMsucLxSwNRwPNmrg55rPBd6JbDVSItc2iiY4ApjMw+uw6ACFZrBXCPrVPK sTFK17iceBBNukPaVtqAGnVqg7HkcB0cfzfjmNWu6CxmwPQ9TASSVG6FtL1DPRiajIe/ qhQ6okQfI/RtW7jifmIx+rX1oZqj0A23M2GucZYgr+j72YJ3dNQRcBX0gKpeN/R/4Vn9 zOUV3C+drkBrUPEc1aPPNb1XL5XOug8YFQhxqPCWvOhgEnduGC1B7tflOm6Ect178fOe mx30ZLXTxJzz1uS9d5ZPbhjrjHRurP9uZkXjYFs5tWjQ/ePkrCIF0jM1/DcGp3sUUtIu MmVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=43BxuzNc4524qU/znys73ykza2ZaFxC6mmrB9EdAkz8=; b=jxu1RD91fcgESnoX/Kw1bRgvgQz9MQ7kdXBcv9o3PTJMwyrxyRoc+TFASSFs7O7quF MY0mb2IIqpGbSOnwZbisPUzA+UgeAsyxTnZWF5QoPMLXTTUfpOhy0GE4CKv1OAfE67Xb ue5+aN8ELq1pu9PlB7qN6PeoArGGoO9bnEtrc51sfS3bIdm4uDtxhAy0Ab/LOiKX9oUJ cBjvyRxSX6v8tZ48psDBJUiHmitlO9H0UJQ/psHJT8EtjTD5qjO78n8vYAjAJmFTDUNZ 9KmwCt1LMQEVF0cbmHBIyiza08HQW0rQzWly3RMXvmm9OqsKeuk0TYLaeSMI1TG0hgEW dciA== X-Gm-Message-State: AGRZ1gKy1LMxYQx4t+ifETBlbBb8OyeonJ0V+ogkCHKF1Trdull/yX5C jhjgc4Y+mYgLSMuCFg3tJfwrguZMAQ8bqsxbPRU= X-Received: by 2002:a2e:9819:: with SMTP id a25-v6mr1232928ljj.6.1542040036991; Mon, 12 Nov 2018 08:27:16 -0800 (PST) MIME-Version: 1.0 References: <1535013819-1646-1-git-send-email-huijin.park@samsung.com> <20181031150225.175ec1d4@bbrezillon> In-Reply-To: <20181031150225.175ec1d4@bbrezillon> From: Huijin Park Date: Tue, 13 Nov 2018 01:27:05 +0900 Message-ID: Subject: Re: [PATCH] mtd: change len type from signed to unsigned type To: boris.brezillon@bootlin.com Cc: huijin.park@samsung.com, marek.vasut@gmail.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, On Wed, Oct 31, 2018 at 11:02 PM Boris Brezillon wrote: > > Hi Huijin, > > On Thu, 23 Aug 2018 04:43:39 -0400 > Huijin Park wrote: > > > From: "huijin.park" > > > > assign of a signed value which has type 'int' to a variable of > > a bigger unsigned integer type 'uint64_t'. > > Why are you mentioning u64? AFAICT, the len passed to erase_write() is > always an unsigned int. It's my mistake. Messages about u64 are not related to this patch. > > > this is ok most of the time, but can lead to unexpectedly large > > resulting value if the original signed value is negative. > > in addtion, the callers of the erase_write() pass the len parameter > > ^In addition, > > > as unsigned type. > > > > Signed-off-by: huijin.park > > --- > > drivers/mtd/mtdblock.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c > > index a5b1933..b2d5ed1 100644 > > --- a/drivers/mtd/mtdblock.c > > +++ b/drivers/mtd/mtdblock.c > > @@ -56,7 +56,7 @@ struct mtdblk_dev { > > */ > > > > static int erase_write (struct mtd_info *mtd, unsigned long pos, > > - int len, const char *buf) > > + unsigned int len, const char *buf) > > The diff looks good, but the commit message is not clear at all. Can > you reword it? > > Thanks, > > Boris > > > { > > struct erase_info erase; > > size_t retlen; > I will send again patch after reword the commit message. Thanks & best regards, Huijin