Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753431AbdFMOPK (ORCPT ); Tue, 13 Jun 2017 10:15:10 -0400 Received: from mail-io0-f173.google.com ([209.85.223.173]:34262 "EHLO mail-io0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752515AbdFMOPI (ORCPT ); Tue, 13 Jun 2017 10:15:08 -0400 MIME-Version: 1.0 In-Reply-To: <20170613133348.48044-2-ramesh.shanmugasundaram@bp.renesas.com> References: <20170613133348.48044-1-ramesh.shanmugasundaram@bp.renesas.com> <20170613133348.48044-2-ramesh.shanmugasundaram@bp.renesas.com> From: Geert Uytterhoeven Date: Tue, 13 Jun 2017 16:15:06 +0200 X-Google-Sender-Auth: aK8hIbqAlKRbj4tld5s0mL_3hg0 Message-ID: Subject: Re: [PATCH v2 1/2] iopoll: Avoid namespace collision within macros & tidyup To: Ramesh Shanmugasundaram Cc: Mark Brown , Hans Verkuil , mattw@codeaurora.org, Mitchel Humpherys , Andrew Morton , Masahiro Yamada , Linux-Renesas , "linux-kernel@vger.kernel.org" , Linux Media Mailing List , Chris Paterson Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1783 Lines: 51 Hi Ramesh, On Tue, Jun 13, 2017 at 3:33 PM, Ramesh Shanmugasundaram wrote: > Renamed variable "timeout" to "__timeout" to avoid namespace collision. > Tidy up macro arguments with paranthesis. > > Signed-off-by: Ramesh Shanmugasundaram Thanks for your patches! > --- a/include/linux/iopoll.h > +++ b/include/linux/iopoll.h > @@ -42,18 +42,19 @@ > */ > #define readx_poll_timeout(op, addr, val, cond, sleep_us, timeout_us) \ > ({ \ > - ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \ > + ktime_t __timeout = ktime_add_us(ktime_get(), timeout_us); \ I think timeout_us should be within parentheses, too. > might_sleep_if(sleep_us); \ > for (;;) { \ > (val) = op(addr); \ > if (cond) \ > break; \ > - if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ > + if ((timeout_us) && \ > + ktime_compare(ktime_get(), __timeout) > 0) { \ > (val) = op(addr); \ > break; \ > } \ > if (sleep_us) \ > - usleep_range((sleep_us >> 2) + 1, sleep_us); \ > + usleep_range(((sleep_us) >> 2) + 1, sleep_us); \ Same for sleep_us. Also in readx_poll_timeout_atomic(), and in your second patch. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds