Date: Wed, 16 Jan 2013 11:44:37 -0800 From: Oleksandr Tymoshenko <gonzo@bluezbox.com> To: arm@freebsd.org Subject: bus_space_(write|read)_X cleanup Message-ID: <50F70325.5070507@bluezbox.com>
next in thread | raw e-mail | index | archive | help
Hello, One of the practices in ARM codebase that caught my eye recently was using bus_space_write_4 (and read) where it's not strictly required. The way it usually goes: memory resource is allocated in driver's attach method then busspace tag/handle obtained by calling rman_get_bustag and rman_get_bushandle, stored in softc and used as a parameters of bus_space calls. No other operations on handle/tag are performed. There are bus_read/bus_write wrappers that provide cleaner API and reduce code complexity. I believe it might be worth going through the code and fixing cases of excessive use of bus_space_ functions. Unless I missed something.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50F70325.5070507>