Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757089AbXJaJGi (ORCPT ); Wed, 31 Oct 2007 05:06:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753655AbXJaJG3 (ORCPT ); Wed, 31 Oct 2007 05:06:29 -0400 Received: from wx-out-0506.google.com ([66.249.82.224]:58393 "EHLO wx-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753598AbXJaJG2 (ORCPT ); Wed, 31 Oct 2007 05:06:28 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Dct7MYFuMy7/BFum78vFG9TekKTy1DuxTaFCS9ui3H1uFtfn7/mEaVG3B739SL4RMbuGfAHaB0+KzYq35jcPK6Xslq9LEleroXXIZ3mheEOjS8CldMbVjqXtZOkhHQbuUo7iJfzFOtglAu047lhFA9SKMhpfpkcnx0Jb1hHTvRg= Message-ID: Date: Wed, 31 Oct 2007 17:06:27 +0800 From: "Dave Young" To: "David Miller" Subject: Re: [PATCH]bluetooth: hci_sysfs connection bus_id add support for diffrent hci device Cc: marcel@holtmann.org, linux-kernel@vger.kernel.org, bluez-devel@lists.sourceforge.net In-Reply-To: <20071031.000141.241824894.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071031023017.GA3896@darkstar.te-china.tietoenator.com> <20071031.000141.241824894.davem@davemloft.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1496 Lines: 36 On 10/31/07, David Miller wrote: > From: Dave Young > Date: Wed, 31 Oct 2007 10:30:17 +0800 > > > diff -upr linux/net/bluetooth/hci_sysfs.c linux.new/net/bluetooth/hci_sysfs.c > > --- linux/net/bluetooth/hci_sysfs.c 2007-10-31 10:21:00.000000000 +0800 > > +++ linux.new/net/bluetooth/hci_sysfs.c 2007-10-31 10:21:55.000000000 +0800 > > @@ -302,7 +302,8 @@ void hci_conn_add_sysfs(struct hci_conn > > conn->dev.release = bt_release; > > > > snprintf(conn->dev.bus_id, BUS_ID_SIZE, > > - "%s%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X", > > + "%s%s%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X", > > + hdev->name, > > conn->type == ACL_LINK ? "acl" : "sco", > > ba->b[5], ba->b[4], ba->b[3], > > ba->b[2], ba->b[1], ba->b[0]); > > This might not work. > > Your device's name is already 15 characters long, > BUS_ID_SIZE is 20, and it seems hdev->name could > easily overflow the 4 or 5 characters of space > remaining. > Yes, this is possible due to hdev->name length is 8. The space for it ist 5 characters. IMHO,in normal usage 'hciX' is unlikely over this limit. Any better ideas? - 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/