From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUAiK-00074d-CK for qemu-devel@nongnu.org; Sat, 26 Nov 2011 00:22:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RUAiI-00067M-UZ for qemu-devel@nongnu.org; Sat, 26 Nov 2011 00:22:12 -0500 Received: from lemon.ertos.nicta.com.au ([203.143.174.143]:38254 helo=lemon.ken.nicta.com.au) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUAiI-00066c-Ku for qemu-devel@nongnu.org; Sat, 26 Nov 2011 00:22:10 -0500 Date: Sat, 26 Nov 2011 16:21:44 +1100 Message-ID: From: Peter Chubb In-Reply-To: <4ECE9606.2090509@suse.de> References: <4ECE9606.2090509@suse.de> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V2 0/4] imx.31 and KZM board support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: Peter Maydell , Andreas =?UTF-8?B?RsOkcmJlcg==?= , Peter Chubb , qemu-devel@nongnu.org >>>>> "Andreas" =3D=3D Andreas F=C3=A4rber writes: Andreas> Am 23.11.2011 01:51, schrieb Peter Chubb: >>>>>>> "Peter" =3D=3D Peter Chubb writes: >>=20 >>=20 Peter> All comments received so far have been addressed --- I've added Peter> a macro, `scream' that gives at most 10 lines of output for OS Peter> error reporting. >>=20 >> Except I noticed a thinko in the macro. The decrement should be >> inside the guard, thus: >>=20 >> #define scream(fmt, args...) \ do { \ static int printable =3D 10;\ >> if (printable) { \ printable--;\ fprintf(stderr, fmt, ##args); \ } >> \ } while (0) Andreas> Another issue: Andreas> scream("black"); scream("black"); scream("black"); Andreas> scream("black"); scream("black"); scream("black"); Andreas> scream("black"); scream("black"); scream("black"); Andreas> scream("black"); scream("red"); Andreas> To show us "red", in addition to the integer count a Andreas> duplicate of the string contents would need to be stored and Andreas> compared to the newly formatted string. No, because it's a macro. Each time it appears the static count is instantiated--- so there's a count for each call site. Andreas> If we want to do this, it should go into a central file so Andreas> that it can be reused and centrally maintained. Agree -- but do we want to do this? For this patch series, Peter M says to just use hw_error() (even though he really doesn't like it). Peter C