From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC v3 3/6] xen/arm: Add save/restore support for ARM arch timer Date: Sun, 11 May 2014 10:01:07 +0100 Message-ID: <536F3C53.4020108@linaro.org> References: <1399583908-21755-1-git-send-email-w1.huang@samsung.com> <1399583908-21755-4-git-send-email-w1.huang@samsung.com> <536C0D1C.6060406@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <536C0D1C.6060406@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Wei Huang , xen-devel@lists.xen.org Cc: keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, jaeyong.yoo@samsung.com, jbeulich@suse.com, yjhyun.yoo@samsung.com List-Id: xen-devel@lists.xenproject.org On 09/05/14 00:02, Andrew Cooper wrote: >> + } >> + >> + if ( (rc = hvm_save_entry(TIMER, v->vcpu_id, h, &ctxt)) != 0 ) >> + return rc; >> + >> + t = &v->arch.phys_timer; > > This updating of t looks suspect and fragile. > > This is a good approximation of the "for case" programming paradigm > (http://thedailywtf.com/Comments/The_FOR-CASE_paradigm.aspx). > > There are only two timers and they refer to different named items inside > struct domain. It would be clearer to remove the loop. I agree with Andrew. I've already made a similar comment on v2... Regards, -- Julien Grall