[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52D52362.4080700@mev.co.uk>
Date: Tue, 14 Jan 2014 11:45:38 +0000
From: Ian Abbott <abbotti@....co.uk>
To: Dan Carpenter <dan.carpenter@...cle.com>,
Joe Perches <joe@...ches.com>
CC: Chase Southwood <chase.southwood@...oo.com>,
"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
Ian Abbott <ian.abbott@....co.uk>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Staging: comedi: move trailing statement to next line
in ni_mio_common.c
On 2014-01-14 07:23, Dan Carpenter wrote:
> On Mon, Jan 13, 2014 at 07:16:14PM -0800, Joe Perches wrote:
>> On Mon, 2014-01-13 at 21:13 -0600, Chase Southwood wrote:
>>> This patch for ni_mio_common.c silences a checkpatch error due to a
>>> trailing statement.
>> []
>>> diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
>> []
>>> @@ -692,7 +692,8 @@ static void ni_clear_ai_fifo(struct comedi_device *dev)
>>> /* Flush the 6143 data FIFO */
>>> ni_writel(0x10, AIFIFO_Control_6143); /* Flush fifo */
>>> ni_writel(0x00, AIFIFO_Control_6143); /* Flush fifo */
>>> - while (ni_readl(AIFIFO_Status_6143) & 0x10) ; /* Wait for complete */
>>> + while (ni_readl(AIFIFO_Status_6143) & 0x10)
>>> + ; /* Wait for complete */
>>
>> It's generally better to use timeouts too.
>
> Just to clarify what Joe is saying do:
>
> /* Wait for complete */
> while (timemout < TIMEOUT) {
> if (ni_readl(AIFIFO_Status_6143) & 0x10)
> break;
> udelay(1);
> }
>
> I added in a delay... The problem is that you'd probably have to look
> at the hardware spec to know what timeout to use or if the delay is
> needed.
Some longish timeout of, say, 10000 iterations (~ 0.01 seconds) would
probably do as it's not that time critical.
We wouldn't expect code clean-up patches to have to deal with that sort
of thing though.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@....co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists