Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp471540ybe; Tue, 10 Sep 2019 23:04:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwH+3rgujbTr6aKyak+no1YTdcfbP+JSuYvrW1IQehCrN3rxfG5BaZIoX8C4IJJ1qS1BRml X-Received: by 2002:a17:906:c799:: with SMTP id cw25mr11874427ejb.107.1568181868794; Tue, 10 Sep 2019 23:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568181868; cv=none; d=google.com; s=arc-20160816; b=iWlRlnNkC2sTbsRt4CLZ3jk2XsOStwF9FvEA1X3n/B0lIvTAcZY/OJ2GFs85USGgKl CzRjqv2OCiNZAiTw1mtSdCRgB7x9znpiikTZ7bzeuXx5Tx+a2f+vEi/q6JzrjcAe8mDs fIN7hjPKSB6NovjVdZKbF8SVvFlxjyc7s7uxl8CtRgSS8jv2/d0T75E0eFxTfOx2k0ml pjEk3RyLooD0h4wClXebdRh8hFDCKbO6ppQWvSKoFXopfdV8oc3BpbGXjKhf45YTOW7L buIdFipli5VsYbIDFL2Lvx/OCsN/1IhEokL/vZxdUyTu+QXW9PdcE70v2q62Yl/E3s8U v2nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=Z8bM74aV0Gm1NNmyfLGAjx3pN/OjFJf2r4RfCm9oqoo=; b=H/ikrq+HeYXTAKCKJnaM7Z3Uv4H4hb17cpxlPiGvJdbXeKi9Y/D0o5eJwlZZUxRRZb jC47HBtMnWFtKZ6VQuC/bcONdHdgGDMlx5l0tJcz5XkRP5ghB6SCpaoX9ZGLoZ0eH82a l1GYjg0lzhXzzFn4VzT09s/n/gov1BpR6ub5FKL6x2zuViknz2y7KPPNXG1ZRhzfY537 unU4gURYGef086nyaqRC/2Wjm8bYZBnhjz8pALYZqQvXGA6wW1JtT6X6AtFv1SaYWgfC 9H6lOZ9VTOix6QbHFxYPTt+/PrD9WgK4kHirnnPnABwKFS6bUimfEegE7eeG4CR6JFJH wDlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BOHRN2LD; 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 z15si10782121ejb.308.2019.09.10.23.04.05; Tue, 10 Sep 2019 23:04:28 -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=BOHRN2LD; 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 S1726894AbfIKF7o (ORCPT + 99 others); Wed, 11 Sep 2019 01:59:44 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:45194 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbfIKF7n (ORCPT ); Wed, 11 Sep 2019 01:59:43 -0400 Received: by mail-pg1-f193.google.com with SMTP id 4so10932744pgm.12 for ; Tue, 10 Sep 2019 22:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=Z8bM74aV0Gm1NNmyfLGAjx3pN/OjFJf2r4RfCm9oqoo=; b=BOHRN2LDxWkitqnOtoRNf5XxHi74PnBd2fVeqX1kJtxLe8Or3gvVe+rIkD1BXp7bpJ HkSj04Pw7PF8pwiKzD756dKaStqPdZ2TO7WJRp0fiODPdqneBj1UXBxKmY0GOkRRbLat 9Lss5hEcP4gxp4Qq/4kzCFLrnQUA/u4LmLHr3dJ5KgIsqlKXEeDscPCcNwJ9f8z8KZOy b8ZoCtCVtbAnQJh8Bzpdt1GN+E12h1AQOSfh/PU1qevNta7D/FrbxXRHEcT9AZdtfuEU SH7aUBoJ7ILbRvdYwk0S8AaayNUZXwTBFsqSLJQaQre465sMjSNsXB+OQnaxQxCJn1pC w9EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=Z8bM74aV0Gm1NNmyfLGAjx3pN/OjFJf2r4RfCm9oqoo=; b=ZfKBm38U8lOzug3yLJNx1QlsY7rCuF46l7ptLJjPBqbkRS9rP/CP4utg0Y+Vk/fVUr KPE0/HA4H8hDgXKyrJyqpAItwkyLRc80hHcJfobvPX2zOACjEKh243oF6sgHWsCvqSe7 gk7t3W3uEFjP/3aF9oBXxJMZ0n64jo8iuFlMfbIs6xneoSMp378pKsJy9yzYPQ4BrwrE wz8+1Ho1eHrFV3XMrSUBvuvVbp6SWjLB306q29PHhl04SbCssol+PO2AEVwck7ROJkMA 4+963FK2EYpRe+R+KxOffp4vhC8eoPf3vjZHkWn4T1oBPRFVcbPImMloW/HS0ggv8Ra4 xwRw== X-Gm-Message-State: APjAAAUYHzUk0g3cq3BfdLZDbmUC4xbsjf7cNSSQFaEq8CNCplnAv9DS jyqEObdflFLdIR7SzT/SM2VJKbmGQSs= X-Received: by 2002:a62:e910:: with SMTP id j16mr41357212pfh.123.1568181582511; Tue, 10 Sep 2019 22:59:42 -0700 (PDT) Received: from LGEARND20B15 ([27.122.242.75]) by smtp.gmail.com with ESMTPSA id k8sm16736280pgm.14.2019.09.10.22.59.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Sep 2019 22:59:42 -0700 (PDT) Date: Wed, 11 Sep 2019 14:59:38 +0900 From: Austin Kim To: marek.behun@nic.cz Cc: linux-kernel@vger.kernel.org, austindh.kim@gmail.com Subject: [PATCH] bus: moxtet: Update proper type 'size_t' to 'ssize_t' Message-ID: <20190911055938.GA130589@LGEARND20B15> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, const char __user *buf, struct moxtet *moxtet = file->private_data; u8 bin[TURRIS_MOX_MAX_MODULES]; u8 hex[sizeof(bin) * 2 + 1]; - size_t res; + ssize_t res; loff_t dummy = 0; int err, i; -- 2.6.2