Subject: port-arm32/6925: Avoid ecgs compiler warnings
To: None <gnats-bugs@gnats.netbsd.org>
From: Patrick Welche,SCC,ext.35710, <prlw1@newn.cam.ac.uk>
List: netbsd-bugs
Date: 02/02/1999 00:18:29
>Number:         6925
>Category:       port-arm32
>Synopsis:       Avoid ecgs compiler warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-arm32-maintainer (NetBSD/arm32 Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb  1 16:20:01 1999
>Last-Modified:
>Originator:     Patrick Welche
>Organization:
	
>Release:        NetBSD-current 31 Jan 1999
>Environment:
	
System: NetBSD 1.3I arm32


>Description:
Warnings of the form:

cc1: warnings being treated as errors
../../../../arch/arm32/dev/qms.c: In function `qmspoll':
../../../../arch/arm32/dev/qms.c:428: warning: suggest explicit braces to avoid 

when compiling kernels with gcc version egcs-2.91.60 19981201
(egcs-1.1.1 release)

>How-To-Repeat:
>Fix:
*** sys/arch/arm32/dev/qms.c.orig	Tue Feb  2 00:08:02 1999
--- sys/arch/arm32/dev/qms.c	Tue Feb  2 00:08:04 1999
***************
*** 425,435 ****
  	int revents = 0;
  	int s = spltty();
  
! 	if (events & (POLLIN | POLLRDNORM))
  		if (sc->sc_buffer.c_cc > 0)
  			revents |= events & (POLLIN | POLLRDNORM);
  		else
  			selrecord(p, &sc->sc_rsel);
  
  	(void)splx(s);
  	return (revents);
--- 425,436 ----
  	int revents = 0;
  	int s = spltty();
  
! 	if (events & (POLLIN | POLLRDNORM)) {
  		if (sc->sc_buffer.c_cc > 0)
  			revents |= events & (POLLIN | POLLRDNORM);
  		else
  			selrecord(p, &sc->sc_rsel);
+ 	}
  
  	(void)splx(s);
  	return (revents);
*** sys/arch/arm32/dev/pms.c.orig	Tue Feb  2 00:09:03 1999
--- sys/arch/arm32/dev/pms.c	Tue Feb  2 00:09:16 1999
***************
*** 635,645 ****
  	int revents = 0;
  	int s = spltty();
  
! 	if (events & (POLLIN | POLLRDNORM))
  		if (sc->sc_q.c_cc > 0)
  			revents |= events & (POLLIN | POLLRDNORM);
  		else
  			selrecord(p, &sc->sc_rsel);
  
  	(void)splx(s);
  	return (revents);
--- 635,646 ----
  	int revents = 0;
  	int s = spltty();
  
! 	if (events & (POLLIN | POLLRDNORM)) {
  		if (sc->sc_q.c_cc > 0)
  			revents |= events & (POLLIN | POLLRDNORM);
  		else
  			selrecord(p, &sc->sc_rsel);
+ 	}
  
  	(void)splx(s);
  	return (revents);
*** sys/arch/arm32/dev/kbd.c.orig	Tue Feb  2 00:10:06 1999
--- sys/arch/arm32/dev/kbd.c	Tue Feb  2 00:10:21 1999
***************
*** 332,342 ****
  	if (KBDFLAG(dev) == KBDFLAG_CONUNIT)
  		return(ENXIO);
  
! 	if (events & (POLLIN | POLLRDNORM))
  		if (sc->sc_q.c_cc > 0)
  			revents |= events & (POLLIN | POLLRDNORM);
  		else
  			selrecord(p, &sc->sc_rsel);
  
  	splx(s);
  	return (revents);
--- 332,343 ----
  	if (KBDFLAG(dev) == KBDFLAG_CONUNIT)
  		return(ENXIO);
  
! 	if (events & (POLLIN | POLLRDNORM)) {
  		if (sc->sc_q.c_cc > 0)
  			revents |= events & (POLLIN | POLLRDNORM);
  		else
  			selrecord(p, &sc->sc_rsel);
+ 	}
  
  	splx(s);
  	return (revents);
>Audit-Trail:
>Unformatted: