From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Linus Torvalds <torvalds@transmeta.com>,
Marcelo Tosatti <marcelo@conectiva.com.br>,
Dave Jones <davej@suse.de>
Cc: Linux Kernel Development <linux-kernel@vger.kernel.org>,
Linux Frame Buffer Device Development
<linux-fbdev-devel@lists.sourceforge.net>,
Timothy Ball <timball@tux.org>
Subject: [PATCH] fbdev do {} while (0);
Date: Fri, 15 Feb 2002 10:48:32 +0100 (MET) [thread overview]
Message-ID: <Pine.GSO.4.21.0202151027420.24874-100000@vervain.sonytel.be> (raw)
Hi Linus, Marcelo, and Dave,
`do { ... } while(0)' does not need the trailing semicolon and may lead to
strange side effects. The following patch (by Timothy Ball <timball@tux.org>)
fixes it in the following files:
- drivers/video/chipsfb.c
- drivers/video/fbcon-cfb24.c
- drivers/video/virgefb.c
The patch applies to 2.4.18-rc1 and 2.5.4-dj1 as well.
diff -urN linux-2.5.5-pre1/drivers/video/chipsfb.c do-while-2.5.5-pre1/drivers/video/chipsfb.c
--- linux-2.5.5-pre1/drivers/video/chipsfb.c Tue Jan 29 10:14:21 2002
+++ do-while-2.5.5-pre1/drivers/video/chipsfb.c Fri Feb 15 10:26:35 2002
@@ -79,7 +79,7 @@
} while (0)
#define read_ind(num, var, ap, dp) do { \
outb((num), (ap)); var = inb((dp)); \
-} while (0);
+} while (0)
/* extension registers */
#define write_xr(num, val) write_ind(num, val, 0x3d6, 0x3d7)
diff -urN linux-2.5.5-pre1/drivers/video/fbcon-cfb24.c do-while-2.5.5-pre1/drivers/video/fbcon-cfb24.c
--- linux-2.5.5-pre1/drivers/video/fbcon-cfb24.c Tue Oct 2 11:47:45 2001
+++ do-while-2.5.5-pre1/drivers/video/fbcon-cfb24.c Fri Feb 15 10:25:23 2002
@@ -76,14 +76,14 @@
out1 = (in1<<8) | (in2>>16); \
out2 = (in2<<16) | (in3>>8); \
out3 = (in3<<24) | in4; \
- } while (0);
+ } while (0)
#elif defined(__LITTLE_ENDIAN)
#define convert4to3(in1, in2, in3, in4, out1, out2, out3) \
do { \
out1 = in1 | (in2<<24); \
out2 = (in2>> 8) | (in3<<16); \
out3 = (in3>>16) | (in4<< 8); \
- } while (0);
+ } while (0)
#else
#error FIXME: No endianness??
#endif
diff -urN linux-2.5.5-pre1/drivers/video/virgefb.c do-while-2.5.5-pre1/drivers/video/virgefb.c
--- linux-2.5.5-pre1/drivers/video/virgefb.c Tue Jan 29 10:14:27 2002
+++ do-while-2.5.5-pre1/drivers/video/virgefb.c Fri Feb 15 10:30:04 2002
@@ -670,12 +670,9 @@
*/
#define Cyber3D_WaitQueue(v) \
-{ \
do { \
while ((rl_3d(0x8504) & 0x1f00) < (((v)+2) << 8)); \
- } \
- while (0); \
-}
+ } while (0)
static inline void Cyber3D_WaitBusy(void)
{
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
reply other threads:[~2002-02-15 9:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.4.21.0202151027420.24874-100000@vervain.sonytel.be \
--to=geert@linux-m68k.org \
--cc=davej@suse.de \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=timball@tux.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).