Subject: port-mac68k/5965: unnecessary(?) semicolons at the end of bus_space_*_multi_* macros
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kenn@synap.ne.jp>
List: netbsd-bugs
Date: 08/14/1998 13:03:08
>Number:         5965
>Category:       port-mac68k
>Synopsis:       unnecessary semicolons at the end of bus_space_*_multi_* macros
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 13 21:05:00 1998
>Last-Modified:
>Originator:     Ken Nakata <kenn@synap.ne.jp>
>Organization:
>Release:        Thu Aug 13 20:41:04 JST 1998 (Wed Aug 13 04:41:04 PDT 1998)
>Environment:
	NetBSD/mac68k 1.3F
System: NetBSD quark.nakata.com 1.3F NetBSD 1.3F (QUARK) #3: Wed Jul 22 11:30:13 JST 1998 hacker@quark.nakata.com:/s/src/sys/arch/mac68k/compile/QUARK mac68k


>Description:
	There's an unnecessary semicolon at the end of each
bus_space_*_multi_* macros in arch/mac68k/include/bus.h, for instance:

#define	bus_space_read_multi_1(t, h, o, a, c) do {			\
	(void) t;							\
	__asm __volatile ("						\
		movl	%0,a0					;	\
		movl	%1,a1					;	\
		movl	%2,d0					;	\
	1:	movb	a0@,a1@+				;	\
		subql	#1,d0					;	\
		jne	1b"					:	\
								:	\
		    "r" ((h) + (o)), "g" (a), "g" (c)		:	\
		    "a0","a1","d0");					\
} while (0);
           ^ this

Because of this, a construct like the following becomes syntax error
(taken out of actuall code from dev/ic/wdc.c):

	if ((wdc->sc_cap & WDC_CAPABILITY_DATA32) == 0)
		bus_space_write_multi_stream_2(wdc->sc_iot, wdc->sc_ioh,
		    wd_data, xfer->databuf + xfer->c_skip,
		    xfer->c_nbytes >> 1);
	else
		bus_space_write_multi_stream_4(wdc->sc_iot, wdc->sc_ioh,
		    wd_data, xfer->databuf + xfer->c_skip,
		    xfer->c_nbytes >> 2);

Note: bus_space_write_multi_stream_[24] are aliases of non-stream multi
write macros on mac68k.

>How-To-Repeat:
	See the file.
>Fix:
	Deleting the semicolons will fix but may break something else
I'm not aware of.
>Audit-Trail:
>Unformatted: