Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp925713ybe; Wed, 11 Sep 2019 06:53:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQTh/GfSmQqu3aEL8184U8Xj/yKUkuZPMlMqdes1/7j5fg8wN2NXHCDaM56lTn4VpmuSUW X-Received: by 2002:a05:6402:8ce:: with SMTP id d14mr8400039edz.244.1568210034445; Wed, 11 Sep 2019 06:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568210034; cv=none; d=google.com; s=arc-20160816; b=tb8GnGpuZmGbdUStutyFOiW9stdlrczUXuv+svaFJ6YMAJ/eLJOaDYe16eWBYgDacM N5NYqEZA3Y5xw0Ll7EqQTmcClpzZq1FEEqHoElC1ZSerOQiV0C+AUjgj/kGe1Uim0RN1 CEyFhvvSfDMl+SNQz4jFZiQSxUK3Uj/L36bGXEDBaGiEaNSqdqTd1XoJBUsYZNGeTMYj /Pcun7GXJNac7u21hy5WFtGalb1J9n2hBNz2YbEYScNF5IJzHpy/B9w1Vjl7NrfcVMll naNJqYfX4D8hPr5HdJhpmZ5IKvBJPN3x2l1oWX8ohTtnPWebkd10R/WL3sSmxXYkaVgx skcQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=h2wOUHiWpxKqr+UqStMT79MNVhr6IEzOBzbNm/wb6WA=; b=JBWbWrx5aGin/SHkt1K3y6bUGM22NWodajUWo7UK1FD6ofIFcBnHC43Z2SHuYw2WgM GuWg9aIbGgLA/cIpcWToNe9Nt/RvkxnTbnoiulk7y0btIzlKuNsYkrqRFg4U8kTeniuv +e28+rCYCTd+HBY56ziq57YkfI8MHlQYozW+RXNpCYIjIydNs6TxxuRUEw+d4RtwJ6ri FrEEpV4UF3PG6zHhrx1RAX4HtXA47HNHxzqoIsyV5beh93hDGKew4ry/zUruSpNNGEnt /oeNLdA/0OvAR2EGe3ICj4gdXYktLBGsQ+q7Cgw+SN8diRjzexy9p/I19Dj+m4EBlBk2 96ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zpz+92MZ; 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 um16si2847325ejb.256.2019.09.11.06.53.30; Wed, 11 Sep 2019 06:53:54 -0700 (PDT) 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=Zpz+92MZ; 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 S1728175AbfIKNs2 (ORCPT + 99 others); Wed, 11 Sep 2019 09:48:28 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:46296 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727093AbfIKNs2 (ORCPT ); Wed, 11 Sep 2019 09:48:28 -0400 Received: by mail-qt1-f194.google.com with SMTP id v11so25215454qto.13 for ; Wed, 11 Sep 2019 06:48:27 -0700 (PDT) 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:content-transfer-encoding; bh=h2wOUHiWpxKqr+UqStMT79MNVhr6IEzOBzbNm/wb6WA=; b=Zpz+92MZ9dy1RH5rw0+hQxc2fh1jHsn1aLA5aaWeCGkEg/eZlVGdRJ9QJQLa0ZIhJx tKKt0fuzM2tEweS2GJ7B3pWRdMbsmwBbGnQogTsw3m97yWmWC9QU1nPYlWQErhGbIqEl b5+mc0kLelB/lZvAXA0J1d0LNgOMBvPiJS8RTZlVNiGBx0gQOKUQYltuBT006x98GAid GMb1w9Pe5WSDDodvSweVCKnqbFSXsRdQvSK1YI4TMY7KrEnRF9Pfgv2a2KsK7j5+oTDn 2lBB9f+TaRyNkjgwvHROk6Pgem2/KK9lLZ7dRT36GI8F3pf7yXgHZyQIHkgEGfXYEV8F 2L8w== 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:content-transfer-encoding; bh=h2wOUHiWpxKqr+UqStMT79MNVhr6IEzOBzbNm/wb6WA=; b=f34me2R6uFSrCesz1oaKVZWZI6YkMM4w+B5W1zbbv9V6COe+z7CRZ5MDuDGXzF+QBR yapdBwkS0ewF0ffVrBkrGw58M//VF2hQ03GvX3pEiINTlV5Te8Etg08ljltmjncLqpjI M4rJLO8fldkVt2B6V+xKDqJKI2tGJcYC1TUm3m9PvxMv2RuJ1efo+LpU3zrW2uOzGylL 41k025tqWg7pyLz7tmlugdXkArA8oEXqVvvEjhqbsFkYCxwXJu2DSs6JwESSRrArripy u6Wn8Qbi8eLroqEStMVzkcL0CvPToXgdBMm/WmfwIz61IhsUOLAZKrphDWY37Opm5TZ0 K51g== X-Gm-Message-State: APjAAAUvpu6bIGizfNq/SAAUrYbyjo6u9UfJnNNCQv8Adw+M2lPaIcD3 Cu2QLN4aKIqSGOPeKaRZcKk1Or/97480mKmy9A33FL7HHRE= X-Received: by 2002:a0c:ac4b:: with SMTP id m11mr22558727qvb.103.1568209707110; Wed, 11 Sep 2019 06:48:27 -0700 (PDT) MIME-Version: 1.0 References: <20190911055938.GA130589@LGEARND20B15> <20190911151202.0002d12b@nic.cz> In-Reply-To: <20190911151202.0002d12b@nic.cz> From: Austin Kim Date: Wed, 11 Sep 2019 22:48:22 +0900 Message-ID: Subject: Re: [PATCH] bus: moxtet: Update proper type 'size_t' to 'ssize_t' To: Marek Behun Cc: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Good! Thanks for notification. 2019=EB=85=84 9=EC=9B=94 11=EC=9D=BC (=EC=88=98) =EC=98=A4=ED=9B=84 10:12, = Marek Behun =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > Hi Austin, > this was already fixed and is staged for soc/for-next, see > https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/commit/?h=3Df= or-next&id=3D6811d26df50d96635dd339cf8cdf43a6abc0c4b6 > > Thanks, > Marek > > On Wed, 11 Sep 2019 14:59:38 +0900 > Austin Kim wrote: > > > The simple_write_to_buffer() returns ssize_t type value, > > which is either positive or negative. > > > > However 'res' is declared as size_t(unsigned int) > > which contains non-negative type. > > > > So 'res < 0' statement is always false, > > this cannot execute execptional-case handling. > > > > To prevent this case, > > update proper type 'size_t' to 'ssize_t' for execptional handling. > > > > Signed-off-by: Austin Kim > > --- > > drivers/bus/moxtet.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/bus/moxtet.c b/drivers/bus/moxtet.c > > index 1ee4570..288a9e4 100644 > > --- a/drivers/bus/moxtet.c > > +++ b/drivers/bus/moxtet.c > > @@ -514,7 +514,7 @@ static ssize_t output_write(struct file *file, cons= t char __user *buf, > > struct moxtet *moxtet =3D file->private_data; > > u8 bin[TURRIS_MOX_MAX_MODULES]; > > u8 hex[sizeof(bin) * 2 + 1]; > > - size_t res; > > + ssize_t res; > > loff_t dummy =3D 0; > > int err, i; > > >