linux-mips
[Top] [All Lists]

Re: [PATCH 5/7] drivers: watchdog: sb_wdog: Fix 32bit linking problems

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH 5/7] drivers: watchdog: sb_wdog: Fix 32bit linking problems
From: Markos Chandras <markos.chandras@gmail.com>
Date: Tue, 18 Jun 2013 14:17:54 +0100
Cc: Markos Chandras <markos.chandras@imgtec.com>, linux-mips@linux-mips.org, sibyte-users@bitmover.com, Wim Van Sebroeck <wim@iguana.be>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=pkdFcgZfYXUpk+zAPdfpGSutqs9PPHlsHH0tCEHOwnI=; b=w49vVX+UP4yBO9L1k6sk9MmuSwjgOQodAX9ovDgyFXGzJ7aD/o37ZgO7ZgS/9GTDGI eBPq6H48BbgejMSgZ/63sKkRT0qBCo9trJkegVLwTqzTRPg3o/EGxpiquep2AWT5CXxp e/2nGVREfMUHBDw1um/6+vsRYj0WySN8jMmbpnubsov42CGlHd/ffQVnA2oD8we/aozx oGEtvDwA2N76xBCdMopMva2JZ+8dpM0Js3LQ19xsOfYbnJ4nwraJqvRykM9PM7SFHVyj V1X/CToBqmfMNANC2b2cXgnT9mUb0u3v5qCtSEdHXYcfrMHlgZr8MdZ5MKuOFA+t+9Eo 001A==
In-reply-to: <20130617170304.GF10408@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1371477641-7989-1-git-send-email-markos.chandras@imgtec.com> <1371477641-7989-6-git-send-email-markos.chandras@imgtec.com> <20130617170304.GF10408@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On 17 June 2013 18:03, Ralf Baechle <ralf@linux-mips.org> wrote:
>> @@ -208,7 +209,9 @@ static long sbwdog_ioctl(struct file *file, unsigned int 
>> cmd,
>>                * get the remaining count from the ... count register
>>                * which is 1*8 before the config register
>>                */
>> -             ret = put_user(__raw_readq(user_dog - 8) / 1000000, p);
>> +             tmp_user_dog = __raw_readq(user_dog - 8);
>> +             tmp_user_dog = do_div(tmp_user_dog, 1000000);
>> +             ret = put_user(tmp_user_dog, p);
>
> In effect the code with your change now does:
>
>                 ret = put_user(__raw_readq(user_dog - 8) % 1000000, p);
>
> No good.
>
>                 tmp_user_dog = __raw_readq(user_dog - 8);
>                 do_div(tmp_user_dog, 1000000);
>                 ret = put_user(tmp_user_dog, p);
>
> Should to the right thing.
>

Hi Ralf,

Yes you are right. I will submit a new patch.

--
Regards,
Markos Chandras

<Prev in Thread] Current Thread [Next in Thread>