From owner-p4-projects@FreeBSD.ORG Fri Nov 20 11:20:54 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8A206106578A; Fri, 20 Nov 2009 11:20:54 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E2211065782; Fri, 20 Nov 2009 11:20:54 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3128FC15; Fri, 20 Nov 2009 11:20:53 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=IUOrzmqebuoA:10 a=Qa35spukGxu/rmuNTmr4yg==:17 a=6I5d2MoRAAAA:8 a=cac5N7nujaoDLmz8bd8A:9 a=WlLqQwA74hZbsJodjFUA:7 a=iO88Gl-TbSytDj0nl7U9SpJKDNwA:4 Received: from [85.19.72.137] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.16) with ESMTPA id 279133050; Fri, 20 Nov 2009 12:20:51 +0100 Received-SPF: softfail receiver=mailfe01.swip.net; client-ip=85.19.72.137; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: Oliver Fromme Date: Fri, 20 Nov 2009 12:22:23 +0100 User-Agent: KMail/1.11.4 (FreeBSD/9.0-CURRENT; KDE/4.2.4; i386; ; ) References: <200911200853.nAK8rEhF012639@haluter.fromme.com> In-Reply-To: <200911200853.nAK8rEhF012639@haluter.fromme.com> X-Face: (%:6u[ldzJ`0qjD7sCkfdMmD*RxpOwEEQ+KWt[{J#x6ow~JO:,zwp.(t; @Aq :4:&nFCgDb8[3oIeTb^'",;u{5{}C9>"PuY\)!=#\u9SSM-nz8+SR~B\!qBv MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200911201222.25052.hselasky@freebsd.org> Cc: Perforce Change Reviews , Nathan Whitehorn Subject: Re: PERFORCE change 170842 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: Fri, 20 Nov 2009 11:20:54 -0000 On Friday 20 November 2009 09:53:14 Oliver Fromme wrote: > Nathan Whitehorn wrote: > > Hans Petter Selasky wrote: > > > http://p4web.freebsd.org/chv.cgi?CH=170842 > > > > > > Change 170842 by hselasky@hselasky_laptop001 on 2009/11/19 22:34:49 > > > > > > > > > USB input: > > > - ATP patch from Rohit Grover: > > > - fixes some minor issues and > > > makes the control transfer > > > fully asynchronous > > > > [...] > > > > > @@ -1530,7 +1574,7 @@ > > > return (ENXIO); > > > > > > if (usbd_lookup_id_by_uaa(atp_devs, sizeof(atp_devs), uaa) == 0) > > > - return BUS_PROBE_SPECIFIC; > > > + return 0; > > > else > > > return ENXIO; > > > } > > > > Why are you replacing symbolic constants with less informative numeric > > ones? > > As far as I can see, the change makes sense. The function > atp_probe() returns 0 on success, or an errno value if an > error occurs, but BUS_PROBE_SPECIFIC is not an errno symbol, > and there is no symbolic constant for the errno value 0, > according to intro(2), so it's appropriate to use the > numeric constant 0. Many kernel functions do that. > > However, it could be argued that a better way might be to > define your own error symbol space, like USB_SUCCESS, > USB_ERROR or possibly others, and translate to proper > errno values only where necessary. Several kernel sub- > systems do this. > > By the way, style(9) states that return values should always > be put in parentheses, even though the C standard doesn't > require it. So it should be return (0). Fixed. --HPS