From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932158AbbHDVYH (ORCPT ); Tue, 4 Aug 2015 17:24:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56317 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752692AbbHDVYF (ORCPT ); Tue, 4 Aug 2015 17:24:05 -0400 Date: Tue, 4 Aug 2015 14:24:03 -0700 From: Andrew Morton To: Robert Jarzmik Cc: Jens Axboe , Russell King - ARM Linux , Guennadi Liakhovetski , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [RFC PATCH v2] lib: scatterlist: add sg splitting function Message-Id: <20150804142403.ce26115ca8da96135e8973f5@linux-foundation.org> In-Reply-To: <878u9rm1cr.fsf@belgarion.home> References: <1438435033-7636-1-git-send-email-robert.jarzmik@free.fr> <20150803161939.2edd494eb64bc81ea8e91c16@linux-foundation.org> <878u9rm1cr.fsf@belgarion.home> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 04 Aug 2015 19:04:36 +0200 Robert Jarzmik wrote: > Andrew Morton writes: > > >> include/linux/scatterlist.h | 5 ++ > >> lib/scatterlist.c | 189 ++++++++++++++++++++++++++++++++++++++++++++ > >> 2 files changed, 194 insertions(+) > > > > It's quite a bit of code for a fairly specialised thing. How ugly > > would it be to put this in a new .c file and have subsystems select it > > in Kconfig? > I have no idea about the "ugliness", but why not ... > > If nobody objects, and in order to submit a proper patch, there are decisions to > make : > - what will be the scope of this new .c file ? > - only sg_plit() ? > - all sg specialized functions, ie. sg_lib.c ? Just sg_split I'd say. It's a logical unit. Other things can be moved elsewhere later as cleanups/optimisations, but that's all off-topic. > - will include/linux/scatterlist.h have an "ifdefed" portion for what X.c > offers ? I prefer to avoid the ifdefs. This means that the error is reported at link-time rather than compile-time but that's a pretty small cost and it's a once-off inconvenience, whereas messy/complex header files are permanent. > - what naming for X.c and the config entry ? um, CONFIG_SG_SPLIT and sg_split.c? > What about adding this to lib/Makefile, and one ifdef to scatterlist.h ? : > obj-$(CONFIG_SG_LIB) += sg_lib.o It would be obj-$(CONFIG_SG_SPLIT) += sg_split.o