Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932875AbbFWMow (ORCPT ); Tue, 23 Jun 2015 08:44:52 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:32908 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932624AbbFWMnP (ORCPT ); Tue, 23 Jun 2015 08:43:15 -0400 From: Dmitry Kalinkin To: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Cc: Martyn Welch , Manohar Vanga , Greg Kroah-Hartman , Dmitry Kalinkin Subject: [PATCH 9/9] staging: vme_user: remove okcount variable Date: Tue, 23 Jun 2015 15:42:33 +0300 Message-Id: <1435063353-25914-10-git-send-email-dmitry.kalinkin@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1435063353-25914-1-git-send-email-dmitry.kalinkin@gmail.com> References: <1435063353-25914-1-git-send-email-dmitry.kalinkin@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2395 Lines: 73 Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 6f5bbc4..14f9554 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -188,7 +188,6 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, unsigned int minor = MINOR(file_inode(file)->i_rdev); ssize_t retval; size_t image_size; - size_t okcount; if (minor == CONTROL_MINOR) return 0; @@ -206,16 +205,14 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, /* Ensure not reading past end of the image */ if (*ppos + count > image_size) - okcount = image_size - *ppos; - else - okcount = count; + count = image_size - *ppos; switch (type[minor]) { case MASTER_MINOR: - retval = resource_to_user(minor, buf, okcount, ppos); + retval = resource_to_user(minor, buf, count, ppos); break; case SLAVE_MINOR: - retval = buffer_to_user(minor, buf, okcount, ppos); + retval = buffer_to_user(minor, buf, count, ppos); break; default: retval = -EINVAL; @@ -234,7 +231,6 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf, unsigned int minor = MINOR(file_inode(file)->i_rdev); ssize_t retval; size_t image_size; - size_t okcount; if (minor == CONTROL_MINOR) return 0; @@ -251,16 +247,14 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf, /* Ensure not reading past end of the image */ if (*ppos + count > image_size) - okcount = image_size - *ppos; - else - okcount = count; + count = image_size - *ppos; switch (type[minor]) { case MASTER_MINOR: - retval = resource_from_user(minor, buf, okcount, ppos); + retval = resource_from_user(minor, buf, count, ppos); break; case SLAVE_MINOR: - retval = buffer_from_user(minor, buf, okcount, ppos); + retval = buffer_from_user(minor, buf, count, ppos); break; default: retval = -EINVAL; -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/