From owner-freebsd-usb@FreeBSD.ORG Fri Aug 18 06:41:37 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 53CC216A4DF for ; Fri, 18 Aug 2006 06:41:37 +0000 (UTC) (envelope-from tofik@oxygen.az) Received: from mail.oxygen.az (mail.oxygen.az [212.47.128.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8F5C43D49 for ; Fri, 18 Aug 2006 06:41:36 +0000 (GMT) (envelope-from tofik@oxygen.az) Received: from mail.oxygen.az (localhost [127.0.0.1]) by mail.oxygen.az (Postfix) with ESMTP id 0CCAD13651; Fri, 18 Aug 2006 11:41:35 +0500 (AZST) X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on earth.oxygen.az X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 Received: from webmail.oxygen.az (mail.oxygen.az [212.47.128.37]) by mail.oxygen.az (Postfix) with ESMTP id BE0E713611; Fri, 18 Aug 2006 11:41:34 +0500 (AZST) Received: from 85.132.32.38 (proxying for 85.132.14.38) (SquirrelMail authenticated user secnews); by webmail.oxygen.az with HTTP; Fri, 18 Aug 2006 11:41:34 +0500 (AZST) Message-ID: <38370.85.132.32.38.1155883316.squirrel@85.132.32.38> In-Reply-To: <200608171534.53213.hselasky@c2i.net> 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> <200608171534.53213.hselasky@c2i.net> Date: Fri, 18 Aug 2006 11:41:34 +0500 (AZST) From: "Tofig Suleymanov" To: "Hans Petter Selasky" User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: -= ClamAV =- Cc: tofik@oxygen.az, freebsd-usb@freebsd.org Subject: Re: USB_ATTACH_SETUP macros question X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: tofik@oxygen.az List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2006 06:41:37 -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 > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > > Thank you for usefull example. Now it is clear to me. Thank you, Tofig Suleymanov