From owner-p4-projects@FreeBSD.ORG Mon Mar 5 21:57:37 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 14A8C16A407; Mon, 5 Mar 2007 21:57:37 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD67416A404 for ; Mon, 5 Mar 2007 21:57:36 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id BE30313C491 for ; Mon, 5 Mar 2007 21:57:36 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l25Lvat7059249 for ; Mon, 5 Mar 2007 21:57:36 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l25LvarJ059246 for perforce@freebsd.org; Mon, 5 Mar 2007 21:57:36 GMT (envelope-from piso@freebsd.org) Date: Mon, 5 Mar 2007 21:57:36 GMT Message-Id: <200703052157.l25LvarJ059246@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 115368 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2007 21:57:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=115368 Change 115368 by piso@piso_newluxor on 2007/03/05 21:56:49 o Check for at least one handler among filt and ihand, else return EINVAL. o Simplify a bit the filter handler wrapper, cause with the aforementioned check in place, we are sure there will always be an ithread to run. Affected files ... .. //depot/projects/soc2006/intr_filter/dev/pccbb/pccbb.c#13 edit Differences ... ==== //depot/projects/soc2006/intr_filter/dev/pccbb/pccbb.c#13 (text+ko) ==== @@ -367,6 +367,8 @@ struct cbb_softc *sc = device_get_softc(dev); int err; + if (filt == NULL && intr == NULL) + return (EINVAL); /* * Well, this is no longer strictly true. You can have multiple * FAST ISRs, but can't mix fast and slow, so we have to assume @@ -636,12 +638,8 @@ * in the ISR dispatch */ if (ih->filt != NULL) - return ((*ih->filt)(ih->arg)); - - if (ih->intr != NULL) - return (FILTER_HANDLED | FILTER_SCHEDULE_THREAD); - else - return (FILTER_STRAY); + return ((*ih->filt)(ih->arg)); + return (FILTER_HANDLED | FILTER_SCHEDULE_THREAD); } static void