Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Oct 2014 18:05:37 +0200
From:      Stefan Farfeleder <stefanf@FreeBSD.org>
To:        Baptiste Daroussin <bapt@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, marius@freebsd.org
Subject:   Re: svn commit: r272894 - head/sys/dev/mc146818
Message-ID:  <20141010160536.GC1262@mole.fafoe.narf.at>
In-Reply-To: <201410101417.s9AEHhKL099720@svn.freebsd.org>
References:  <201410101417.s9AEHhKL099720@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 10, 2014 at 02:17:43PM +0000, Baptiste Daroussin wrote:
> Author: bapt
> Date: Fri Oct 10 14:17:42 2014
> New Revision: 272894
> URL: https://svnweb.freebsd.org/changeset/base/272894
> 
> Log:
>   Use FreeBSD-bit-checking-style
>   This appease gcc 4.9 issuing warnings about parentheses
>   
>   Differential Revision:	https://reviews.freebsd.org/D933
>   Reviewed by:	marius
> 
> Modified:
>   head/sys/dev/mc146818/mc146818.c
> 
> Modified: head/sys/dev/mc146818/mc146818.c
> ==============================================================================
> --- head/sys/dev/mc146818/mc146818.c	Fri Oct 10 12:38:53 2014	(r272893)
> +++ head/sys/dev/mc146818/mc146818.c	Fri Oct 10 14:17:42 2014	(r272894)
> @@ -77,7 +77,7 @@ mc146818_attach(device_t dev)
>  	}
>  
>  	mtx_lock_spin(&sc->sc_mtx);
> -	if (!(*sc->sc_mcread)(dev, MC_REGD) & MC_REGD_VRT) {
> +	if (((*sc->sc_mcread)(dev, MC_REGD) & MC_REGD_VRT) == 0) {
>  		mtx_unlock_spin(&sc->sc_mtx);
>  		device_printf(dev, "%s: battery low\n", __func__);
>  		return (ENXIO);

This changes the meaning. The old code was parsed as
'(!...) & MC_REGD_VRT' which evaluates to constant 0.
Probably this was wrong, but your comment doesn't seem to indicate that.

The other two changes are fine.

Stefan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141010160536.GC1262>