From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933828AbcLGXdO (ORCPT ); Wed, 7 Dec 2016 18:33:14 -0500 Received: from ozlabs.org ([103.22.144.67]:60687 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933397AbcLGXdM (ORCPT ); Wed, 7 Dec 2016 18:33:12 -0500 Subject: Re: [PATCH 08/16] drivers/fsi: Add crc4 helpers To: Greg KH , Chris Bostic References: <1481076574-54711-1-git-send-email-christopher.lee.bostic@gmail.com> <1481076574-54711-2-git-send-email-christopher.lee.bostic@gmail.com> <20161207090219.GA14742@kroah.com> Cc: robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, sre@kernel.org, mturquette@baylibre.com, geert+renesas@glider.be, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, joel@jms.id.au, linux-kernel@vger.kernel.org, andrew@aj.id.au, alistair@popple.id.au, benh@kernel.crashing.org, Chris Bostic From: Jeremy Kerr Message-ID: <81146f25-05fa-70f9-e8ff-49c17aede8f2@ozlabs.org> Date: Thu, 8 Dec 2016 10:33:08 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161207090219.GA14742@kroah.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, > Why not just create lib/crc4.c with these functions, like the other crc > functions in the kernel? Two (bad) reasons: - The crc4 implementation here is pretty specific to the FSI usage (only supporting 4-bit-sized chunks), to keep the math & lookup table simple - I'm lazy So yes, we should spend the effort now to make this generic enough for a lib/crc4.c. Would we want to support different values for the polynomial? Chris: do you want me to to that, or will you? Cheers, Jeremy