From owner-svn-src-head@freebsd.org Thu Dec 14 03:03:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C6A7E90DC3; Thu, 14 Dec 2017 03:03:10 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6E546F4DA; Thu, 14 Dec 2017 03:03:09 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBE338gN024710; Thu, 14 Dec 2017 03:03:08 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBE3383B024708; Thu, 14 Dec 2017 03:03:08 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201712140303.vBE3383B024708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Thu, 14 Dec 2017 03:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326837 - in head/sys/dev/bhnd: . tools X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys/dev/bhnd: . tools X-SVN-Commit-Revision: 326837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Dec 2017 03:03:10 -0000 Author: landonf Date: Thu Dec 14 03:03:08 2017 New Revision: 326837 URL: https://svnweb.freebsd.org/changeset/base/326837 Log: bhnd(4): Add missing enclosing parentheses to the bhnd bus space macros to avoid precedence bugs. Approved by: adrian (mentor, implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/tools/bus_macro.sh Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Thu Dec 14 01:58:05 2017 (r326836) +++ head/sys/dev/bhnd/bhnd.h Thu Dec 14 03:03:08 2017 (r326837) @@ -1502,262 +1502,262 @@ bhnd_get_region_addr(device_t dev, bhnd_port_type port * Generated with bhnd/tools/bus_macro.sh */ #define bhnd_bus_barrier(r, o, l, f) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_barrier((r)->res, (o), (l), (f)) : \ BHND_BUS_BARRIER( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (l), (f)) + rman_get_device((r)->res), (r), (o), (l), (f))) #define bhnd_bus_read_1(r, o) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_1((r)->res, (o)) : \ BHND_BUS_READ_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o)) + rman_get_device((r)->res), (r), (o))) #define bhnd_bus_read_multi_1(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_multi_1((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_MULTI_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_read_region_1(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_region_1((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_REGION_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_1(r, o, v) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_1((r)->res, (o), (v)) : \ BHND_BUS_WRITE_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v)) + rman_get_device((r)->res), (r), (o), (v))) #define bhnd_bus_write_multi_1(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_multi_1((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_MULTI_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_region_1(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_region_1((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_REGION_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_read_stream_1(r, o) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_stream_1((r)->res, (o)) : \ BHND_BUS_READ_STREAM_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o)) + rman_get_device((r)->res), (r), (o))) #define bhnd_bus_read_multi_stream_1(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_multi_stream_1((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_MULTI_STREAM_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_read_region_stream_1(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_region_stream_1((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_REGION_STREAM_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_stream_1(r, o, v) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_stream_1((r)->res, (o), (v)) : \ BHND_BUS_WRITE_STREAM_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v)) + rman_get_device((r)->res), (r), (o), (v))) #define bhnd_bus_write_multi_stream_1(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_multi_stream_1((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_MULTI_STREAM_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_region_stream_1(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_region_stream_1((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_REGION_STREAM_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_set_multi_1(r, o, v, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_set_multi_1((r)->res, (o), (v), (c)) : \ BHND_BUS_SET_MULTI_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v), (c)) + rman_get_device((r)->res), (r), (o), (v), (c))) #define bhnd_bus_set_region_1(r, o, v, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_set_region_1((r)->res, (o), (v), (c)) : \ BHND_BUS_SET_REGION_1( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v), (c)) + rman_get_device((r)->res), (r), (o), (v), (c))) #define bhnd_bus_read_2(r, o) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_2((r)->res, (o)) : \ BHND_BUS_READ_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o)) + rman_get_device((r)->res), (r), (o))) #define bhnd_bus_read_multi_2(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_multi_2((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_MULTI_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_read_region_2(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_region_2((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_REGION_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_2(r, o, v) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_2((r)->res, (o), (v)) : \ BHND_BUS_WRITE_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v)) + rman_get_device((r)->res), (r), (o), (v))) #define bhnd_bus_write_multi_2(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_multi_2((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_MULTI_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_region_2(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_region_2((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_REGION_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_read_stream_2(r, o) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_stream_2((r)->res, (o)) : \ BHND_BUS_READ_STREAM_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o)) + rman_get_device((r)->res), (r), (o))) #define bhnd_bus_read_multi_stream_2(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_multi_stream_2((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_MULTI_STREAM_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_read_region_stream_2(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_region_stream_2((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_REGION_STREAM_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_stream_2(r, o, v) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_stream_2((r)->res, (o), (v)) : \ BHND_BUS_WRITE_STREAM_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v)) + rman_get_device((r)->res), (r), (o), (v))) #define bhnd_bus_write_multi_stream_2(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_multi_stream_2((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_MULTI_STREAM_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_region_stream_2(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_region_stream_2((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_REGION_STREAM_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_set_multi_2(r, o, v, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_set_multi_2((r)->res, (o), (v), (c)) : \ BHND_BUS_SET_MULTI_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v), (c)) + rman_get_device((r)->res), (r), (o), (v), (c))) #define bhnd_bus_set_region_2(r, o, v, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_set_region_2((r)->res, (o), (v), (c)) : \ BHND_BUS_SET_REGION_2( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v), (c)) + rman_get_device((r)->res), (r), (o), (v), (c))) #define bhnd_bus_read_4(r, o) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_4((r)->res, (o)) : \ BHND_BUS_READ_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o)) + rman_get_device((r)->res), (r), (o))) #define bhnd_bus_read_multi_4(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_multi_4((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_MULTI_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_read_region_4(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_region_4((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_REGION_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_4(r, o, v) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_4((r)->res, (o), (v)) : \ BHND_BUS_WRITE_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v)) + rman_get_device((r)->res), (r), (o), (v))) #define bhnd_bus_write_multi_4(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_multi_4((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_MULTI_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_region_4(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_region_4((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_REGION_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_read_stream_4(r, o) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_stream_4((r)->res, (o)) : \ BHND_BUS_READ_STREAM_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o)) + rman_get_device((r)->res), (r), (o))) #define bhnd_bus_read_multi_stream_4(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_multi_stream_4((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_MULTI_STREAM_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_read_region_stream_4(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_read_region_stream_4((r)->res, (o), (d), (c)) : \ BHND_BUS_READ_REGION_STREAM_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_stream_4(r, o, v) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_stream_4((r)->res, (o), (v)) : \ BHND_BUS_WRITE_STREAM_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v)) + rman_get_device((r)->res), (r), (o), (v))) #define bhnd_bus_write_multi_stream_4(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_multi_stream_4((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_MULTI_STREAM_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_write_region_stream_4(r, o, d, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_write_region_stream_4((r)->res, (o), (d), (c)) : \ BHND_BUS_WRITE_REGION_STREAM_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (d), (c)) + rman_get_device((r)->res), (r), (o), (d), (c))) #define bhnd_bus_set_multi_4(r, o, v, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_set_multi_4((r)->res, (o), (v), (c)) : \ BHND_BUS_SET_MULTI_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v), (c)) + rman_get_device((r)->res), (r), (o), (v), (c))) #define bhnd_bus_set_region_4(r, o, v, c) \ - ((r)->direct) ? \ + (((r)->direct) ? \ bus_set_region_4((r)->res, (o), (v), (c)) : \ BHND_BUS_SET_REGION_4( \ device_get_parent(rman_get_device((r)->res)), \ - rman_get_device((r)->res), (r), (o), (v), (c)) + rman_get_device((r)->res), (r), (o), (v), (c))) #endif /* _BHND_BHND_H_ */ Modified: head/sys/dev/bhnd/tools/bus_macro.sh ============================================================================== --- head/sys/dev/bhnd/tools/bus_macro.sh Thu Dec 14 01:58:05 2017 (r326836) +++ head/sys/dev/bhnd/tools/bus_macro.sh Thu Dec 14 03:03:08 2017 (r326837) @@ -43,7 +43,7 @@ macro () { echo -n ", ${i}" done echo ") \\" - echo " ((r)->direct) ? \\" + echo " (((r)->direct) ? \\" echo -n " bus_${n}((r)->res" for i do @@ -57,7 +57,7 @@ macro () { do echo -n ", (${i})" done - echo ")" + echo "))" }