Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 22 Jan 2003 07:37:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 22 Jan 2003 07:37:36 -0500 Received: from services.cam.org ([198.73.180.252]:906 "EHLO mail.cam.org") by vger.kernel.org with ESMTP id ; Wed, 22 Jan 2003 07:37:36 -0500 From: Ed Tomlinson Subject: Re: {sys_,/dev/}epoll waiting timeout To: Jamie Lokier , linux-kernel@vger.kernel.org Reply-To: tomlins@cam.org Date: Wed, 22 Jan 2003 07:46:24 -0500 References: <20030122065502.GA23790@math.leidenuniv.nl> <20030122080322.GB3466@bjl1.asuk.net> Lines: 17 Organization: me User-Agent: KNode/0.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-Id: <20030122124625.8CBFD2661@oscar.casa.dyndns.org> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Jamie Lokier wrote: > jtimeout = 0; > if (timeout) { > /* Careful about overflow in the intermediate values */ > if ((unsigned long) timeout < MAX_SCHEDULE_TIMEOUT / HZ) > jtimeout = (unsigned long)(timeout*HZ+999)/1000+1; > else /* Negative or overflow */ > jtimeout = MAX_SCHEDULE_TIMEOUT; > } Why assume HZ=1000? Would not: timeout = (unsigned long)(timeout*HZ+(HZ-1))/HZ+1; make more sense? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/