From owner-freebsd-usb@FreeBSD.ORG Thu Aug 17 13:34:45 2006 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E8AD16A4E0 for ; Thu, 17 Aug 2006 13:34:45 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1EDA43D53 for ; Thu, 17 Aug 2006 13:34:44 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: gvlK0tOCzrqh9CPROFOFPw== X-Cloudmark-Score: 0.000000 [] Received: from [193.216.86.144] (HELO [10.0.0.249]) by mailfe01.swip.net (CommuniGate Pro SMTP 5.0.8) with ESMTP id 236422158; Thu, 17 Aug 2006 15:34:42 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org, tofik@oxygen.az Date: Thu, 17 Aug 2006 15:34:51 +0200 User-Agent: KMail/1.7 References: <35069.85.132.32.38.1155816624.squirrel@85.132.32.38> <20060817121307.GA804@gremlin.foo.is> <35146.85.132.32.38.1155817977.squirrel@85.132.32.38> In-Reply-To: <35146.85.132.32.38.1155817977.squirrel@85.132.32.38> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608171534.53213.hselasky@c2i.net> Cc: Subject: Re: USB_ATTACH_SETUP macros question X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 13:34:45 -0000 > > Made a little test which shows that this code is going to be executed only > once.How did i miss that :) Now the other question comes next: > Why don not we use just: > #define USB_ATTACH_SETUP \ > sc->sc_dev = self; \ > device_set_desc_copy(self, devinfo); \ > device_printf(self, "%s\n", devinfo); Because that is dangerous. Consider the following: if (1) USB_ATTACH_SETUP; What is the meaning of the statement above? What is going to get executed? --HPS