From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mms3.broadcom.com ([216.31.210.19]:1631 "EHLO MMS3.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753120Ab1EXRA6 (ORCPT ); Tue, 24 May 2011 13:00:58 -0400 Message-ID: <4DDBE432.3040207@broadcom.com> (sfid-20110524_190117_347834_0E7C8A1E) Date: Tue, 24 May 2011 19:00:34 +0200 From: "Arend van Spriel" MIME-Version: 1.0 To: "Alan Cox" cc: "Andrew Morton" , "linux-kernel@vger.kernel.org" , "linux-wireless@vger.kernel.org" , "John W. Linville" , "Dan Carpenter" Subject: Re: [RFC] lib: crc8: add new library module providing crc8 algorithm References: <1306010973-5625-1-git-send-email-arend@broadcom.com> <20110522122325.108b1c86@lxorguk.ukuu.org.uk> <4DD905CC.8040407@broadcom.com> <20110522151959.7fd6e87e@lxorguk.ukuu.org.uk> <4DDB622B.1050005@broadcom.com> <20110524104404.336c765f@lxorguk.ukuu.org.uk> <4DDB81FD.2020903@broadcom.com> <20110524112732.67d92b2f@lxorguk.ukuu.org.uk> <4DDB8AB5.7080808@broadcom.com> <20110524135705.00f7fb12@lxorguk.ukuu.org.uk> In-Reply-To: <20110524135705.00f7fb12@lxorguk.ukuu.org.uk> Content-Type: text/plain; charset=iso-8859-1; format=flowed Sender: linux-wireless-owner@vger.kernel.org List-ID: On 05/24/2011 02:57 PM, Alan Cox wrote: > On Tue, 24 May 2011 12:38:45 +0200 > "Arend van Spriel" wrote: > >> On 05/24/2011 12:27 PM, Alan Cox wrote: >>>> Not sure whether you mean the source code or the object code. I build >>>> kernel with debug symbols so the sizes are bit higher. >>> nm will tell you the actual sizes. I think the n_gsm code is about 500 >>> bytes or so and chunks of it inline. >> Not counting the crc table I assume. > I forget but I think including - its a tiny tiny bit of code once inlined. I used nm on both flavours. dynamic crc table based on polynomial and bit order --------------------------------------------------- 00000000 00000026 T crc8 00000030 000000dc T crc8_create fixed crc table with table selection based on bit order ------------------------------------------------------- 00000000 00000026 T crc8 00000030 0000002b T crc8_create 00000100 00000100 r crc8_table_lsb 00000000 00000100 r crc8_table_msb The first requires the user to provide buffer to hold the table. The difference is in the crc_create() function (maybe better named crc_populate_table() in first, and crc_select_table() in second). It is 177 bytes larger. The crc calculating function is 38 bytes. Still pretty small I would think. Gr. AvS -- Almost nobody dances sober, unless they happen to be insane. -- H.P. Lovecraft --