From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751475AbWFUVvX (ORCPT ); Wed, 21 Jun 2006 17:51:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751478AbWFUVvW (ORCPT ); Wed, 21 Jun 2006 17:51:22 -0400 Received: from smtp.osdl.org ([65.172.181.4]:27841 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1751475AbWFUVvW (ORCPT ); Wed, 21 Jun 2006 17:51:22 -0400 Date: Wed, 21 Jun 2006 14:51:04 -0700 From: Andrew Morton To: Roman Zippel Cc: johnstul@us.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fix and optimize clock source update Message-Id: <20060621145104.b13af6aa.akpm@osdl.org> In-Reply-To: References: <1150923519.2690.14.camel@leatherman> X-Mailer: Sylpheed version 2.2.4 (GTK+ 2.8.17; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Jun 2006 23:38:32 +0200 (CEST) Roman Zippel wrote: > > > +#define clocksource_adjustcheck(sign, error, interval, offset) ({ \ > > > + int adj = sign; \ > > > + error >>= 2; \ > > > + if (unlikely(sign > 0 ? error > interval : error < interval)) { \ > > > + adj = clocksource_bigadjust(sign, error, \ > > > + interval, offset); \ > > > + interval <<= adj; \ > > > + offset <<= adj; \ > > > + adj = sign << adj; \ > > > + } \ > > > + adj; \ > > > +}) > > > > That's still a #define with side effects. Yuck. > > The alternative is duplicating the code and an inline function which takes > the address of these variables would likely generate worse code. Can you verify that please? It is pretty sick.