Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8030597imu; Thu, 15 Nov 2018 05:35:22 -0800 (PST) X-Google-Smtp-Source: AJdET5fhGPEdXsUI1NlT05zIeC4MK0R3rm/AKtH1PsiAE8Dw1m9WERkVfHIZIdM2bMdqEIiR9Z5M X-Received: by 2002:a62:e219:: with SMTP id a25-v6mr6330035pfi.75.1542288922162; Thu, 15 Nov 2018 05:35:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542288922; cv=none; d=google.com; s=arc-20160816; b=fZkabItBM1TfBynhyHdx+ZR4UnoLh4QPME1Fn4+bGjKZMJPJA0+UZXXpagrczb6Bug kYs/Wz+uLCQfOFMd81JRsSIOgOunRtG+VAJ4VqNzya3b/y8CQtQ0cZSPlDA0UDiAG+QE WYQV0c90wPp2RqDNMJidCV0VfTm2AgQ+YAOz/X3A/9kMrowmFr2Y6tVOxmUfg+IT2q7b EUniapp8U6uFBcgJ/SpNK/YsLgGeVxF5PJFg/c73N2mp5mjpCOVmHZazb59MhCElp7Xv +sSQwWaqgFWfAGzUNXxun2yIG/kg5oyIeaLLGppHM/dph4lVVUkGtWiZryrwk5oNcrw1 ptBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=szcXilo1+JrZwAJKGajWPfoURM+CPY6sTy95vEpYph8=; b=N6x9hl7Y93h9K5191ExvQH+32OZ8xelCbg91TN/ryaItSDm+FdOZcYT/D9N9LCS3Tx 6wt4E3+vLis50OUvSJarOYlolASuGqqLMnrFKYuIeyjHSsIBQ+LivW4Ozm8f5L7Ws65i KyX3WsLG+t7Rjv/gzi2lE7TShPisse/xkd7+a3flbiAZ5wDRLmBIaX+W0wJrJC1hFvu9 Q9ssWAYdLrvvuxvBQY6mZh+q7DORWfM0tbZuGZmBsSUJt8O+PIgwWayKqVC7HpAAkHDc mm2EGdbqlRhuLjOpCqq2iLvuuLvzkD6MRpgzwsyEgHTMiP8Sj/5dW7H4q3T0YAePOgvo tD7w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si10579697plk.373.2018.11.15.05.35.07; Thu, 15 Nov 2018 05:35:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388294AbeKOXmL (ORCPT + 99 others); Thu, 15 Nov 2018 18:42:11 -0500 Received: from mail.bootlin.com ([62.4.15.54]:40975 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387989AbeKOXmL (ORCPT ); Thu, 15 Nov 2018 18:42:11 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id E431E20752; Thu, 15 Nov 2018 14:34:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from bbrezillon (aaubervilliers-681-1-13-146.w90-88.abo.wanadoo.fr [90.88.134.146]) by mail.bootlin.com (Postfix) with ESMTPSA id ACE7F20510; Thu, 15 Nov 2018 14:34:17 +0100 (CET) Date: Thu, 15 Nov 2018 14:34:17 +0100 From: Boris Brezillon To: Huijin Park Cc: Marek Vasut , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, bbanghj.park@gmail.com Subject: Re: [PATCH v2] mtd: change len type from signed to unsigned type Message-ID: <20181115143417.4e0e7dbe@bbrezillon> In-Reply-To: <1542258430-19885-1-git-send-email-huijin.park@samsung.com> References: <1542258430-19885-1-git-send-email-huijin.park@samsung.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Nov 2018 00:07:10 -0500 Huijin Park wrote: > From: "huijin.park" > > This patch casts the "len" parameter to an unsigned int. Hm, that's not really what this patch actually. Actually it avoids the cast from an int to an unsigned int. > The callers of erase_write() pass the "len" parameter as unsigned int. That's the important part here. Callers of erase_write() always pass an unsigned int, so what you're trying to do here is avoid a cast to an int. > > Signed-off-by: huijin.park > --- You should have a changelog here. > 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) > { > struct erase_info erase; > size_t retlen;