From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHZgp-0002mL-1L for qemu-devel@nongnu.org; Mon, 07 Dec 2009 04:15:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHZgk-0002jy-A2 for qemu-devel@nongnu.org; Mon, 07 Dec 2009 04:15:30 -0500 Received: from [199.232.76.173] (port=39427 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHZgj-0002jj-Uq for qemu-devel@nongnu.org; Mon, 07 Dec 2009 04:15:26 -0500 Message-ID: <4B1CC7A5.60803@redhat.com> Date: Mon, 07 Dec 2009 10:15:17 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH V8 09/18] pc: remove a global variable, RTCState *rtc_state. References: <1259905865-25295-1-git-send-email-yamahata@valinux.co.jp> <1259905865-25295-10-git-send-email-yamahata@valinux.co.jp> In-Reply-To: <1259905865-25295-10-git-send-email-yamahata@valinux.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: Paolo Bonzini , qemu-devel@nongnu.org On 12/04/09 06:50, Isaku Yamahata wrote: > remove a global variable, RTCState *rtc_state. > Only the cmos_set_s3_resume_init() needs it global. > So introduce a registering function and make it local. > As for other function which references the variable, pass it > as a function argument. > > Signed-off-by: Isaku Yamahata > Cc: Paolo Bonzini > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -64,8 +64,6 @@ [ ... ] > -static RTCState *rtc_state; [ ... ] > +static RTCState *rtc_state; [ ... ] Hmm? Patch description says something else ... With my qdev hat on: If you cleanup that anyway I'd suggest to make the rtc_* functions accept and return DeviceState instead of RTCState, so the pc.c code just has a "this is the rtc device" kind of reference. cheers, Gerd