From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4EB201C0FC3 for ; Wed, 18 Nov 2015 12:44:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4AF2232DD9 for ; Wed, 18 Nov 2015 12:44:34 +0000 (UTC) Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ibsvGfvVivzd for ; Wed, 18 Nov 2015 12:44:33 +0000 (UTC) Received: from email.microchip.com (exsmtp01.microchip.com [198.175.253.37]) by silver.osuosl.org (Postfix) with ESMTPS id A9A2032E86 for ; Wed, 18 Nov 2015 12:44:32 +0000 (UTC) From: Christian Gromm Subject: [PATCH 04/28] staging: most: unify types Date: Wed, 18 Nov 2015 13:43:28 +0100 Message-ID: <1447850632-16782-5-git-send-email-christian.gromm@microchip.com> In-Reply-To: <1447850632-16782-1-git-send-email-christian.gromm@microchip.com> References: <1447850632-16782-1-git-send-email-christian.gromm@microchip.com> MIME-Version: 1.0 List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org Cc: Christian Gromm , driverdev-devel@linuxdriverproject.org This patch unifies variable types to get less castings. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c index b293078..4bf0322 100644 --- a/drivers/staging/most/aim-cdev/cdev.c +++ b/drivers/staging/most/aim-cdev/cdev.c @@ -39,7 +39,7 @@ struct aim_channel { struct most_channel_config *cfg; unsigned int channel_id; dev_t devno; - unsigned int mbo_offs; + size_t mbo_offs; struct mbo *stacked_mbo; DECLARE_KFIFO_PTR(fifo, typeof(struct mbo *)); atomic_t access_ref; @@ -221,8 +221,7 @@ error: static ssize_t aim_read(struct file *filp, char __user *buf, size_t count, loff_t *offset) { - ssize_t copied; - size_t to_copy, not_copied; + size_t to_copy, not_copied, copied; struct mbo *mbo; struct aim_channel *channel = filp->private_data; @@ -247,8 +246,7 @@ start_copy: return -EIO; } - to_copy = min((int)count, - (int)(mbo->processed_length - channel->mbo_offs)); + to_copy = min(count, (size_t)mbo->processed_length - channel->mbo_offs); not_copied = copy_to_user(buf, mbo->virt_address + channel->mbo_offs, -- 1.7.9.5 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel