Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751682AbVJTBMr (ORCPT ); Wed, 19 Oct 2005 21:12:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751677AbVJTBMr (ORCPT ); Wed, 19 Oct 2005 21:12:47 -0400 Received: from [203.2.177.25] ([203.2.177.25]:25421 "EHLO pfeiffer.tusc.com.au") by vger.kernel.org with ESMTP id S1751675AbVJTBMq (ORCPT ); Wed, 19 Oct 2005 21:12:46 -0400 Subject: Re: [PATCH] X25: Add ITU-T facilites From: Andrew Hendry To: "linux-os (Dick Johnson)" Cc: Arnaldo Carvalho de Melo , "YOSHIFUJI Hideaki / ?$B5HF#1QL@" , eis@baty.hanse.de, linux-x25@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org In-Reply-To: References: <1129513666.3747.50.camel@localhost.localdomain> <20051017022826.GA23167@mandriva.com> <1129615767.3695.15.camel@localhost.localdomain> <20051018.152318.68554424.yoshfuji@linux-ipv6.org> <20051018153702.GC23167@mandriva.com> Content-Type: text/plain Message-Id: <1129770654.3574.1154.camel@localhost.localdomain> Mime-Version: 1.0 Date: Thu, 20 Oct 2005 11:10:54 +1000 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2403 Lines: 69 On Wed, 2005-10-19 at 01:48, linux-os (Dick Johnson) wrote: > On Tue, 18 Oct 2005, Arnaldo Carvalho de Melo wrote: > > > Em Tue, Oct 18, 2005 at 03:23:18PM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ escreveu: > >> In article <1129615767.3695.15.camel@localhost.localdomain> (at Tue, 18 Oct 2005 16:09:27 +1000), Andrew Hendry says: > >> > >>> +/* > >>> +* ITU DTE facilities > >>> +* Only the called and calling address > >>> +* extension are currently implemented. > >>> +* The rest are in place to avoid the struct > >>> +* changing size if someone needs them later > >>> ++ */ > >>> +struct x25_dte_facilities { > >>> + unsigned int calling_len, called_len; > >>> + char calling_ae[20]; > >>> + char called_ae[20]; > >>> + unsigned char min_throughput; > >>> + unsigned short delay_cumul; > >>> + unsigned short delay_target; > >>> + unsigned short delay_max; > >>> + unsigned char expedited; > >>> +}; > >> > >> Why don't you use fixed size members? > >> And we can eliminate 8bit hole. > >> > >> struct x25_dte_facilities { > >> u32 calling_len > >> u32 called_len; > > > > I guess the two above can be 'u8' as they refer to calling_ae and called_ae > > that at most will be '20'? > > > >> u8 calling_ae[20]; > >> u8 called_ae[20]; > > > > - Arnaldo > > At the very least put the 32-bit in the beginning and 8-bit stuff at > the end so natural alignment occurs where possible. > > Cheers, > Dick Johnson > Penguin : Linux version 2.6.13.4 on an i686 machine (5589.46 BogoMips). > Warning : 98.36% of all statistics are fiction. > . Thanks everyone for the feedback, will fix up the alignment. A quick question on the use of u8 and u32 types in x25.h. /usr/src/linux-2.6.13.4/include/linux/x25.h and /usr/include/linux/x25.h have been identical between the kernel and glibc-kernheaders type packages, using u8 and u32 would require extra changes to the userspace version. __u32 or unsigned int look to be the norm for other similar headers, whats the recommended type of types to be used? Thanks, Andrew. - 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/