From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752508AbdJDPWi (ORCPT ); Wed, 4 Oct 2017 11:22:38 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:37313 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752368AbdJDPWh (ORCPT ); Wed, 4 Oct 2017 11:22:37 -0400 Message-ID: <1507130554.26687.8.camel@codethink.co.uk> Subject: Re: [RFC PATCH 0/3] Introduce kernel small arrays (KSA) From: Ben Hutchings To: Ilya Matveychikov Cc: linux-kernel@vger.kernel.org Date: Wed, 04 Oct 2017 16:22:34 +0100 In-Reply-To: References: Organization: Codethink Ltd. Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-09-19 at 12:30 +0400, Ilya Matveychikov wrote: > Hi guys, > > Please review the approach of using small fixed-sized arrays to improve > parsing of values like get_options() does. > > This comes to me after fixing an overflow in get_options(). See the thread > for details: https://lkml.org/lkml/2017/5/22/581 > > If the approach is OK I’ll suggest to replace all of get_options() calls > to ksa_parse_ints() and remove get_options() at all. You didn't cc the patches to me, and I can't find patch 3/3 at all. I don't think the KSA() macro should be casting its argument. Where the cast is necessary, it ought to be explicit in the caller. Similarly I think the BUILD_BUG_ON() in ksa_build_check() doesn't belong there, but in whichever caller of ksa_parse_ints() requires struct ksmall_array to have the same layout as a simple array of unsigned int. Ben. -- Ben Hutchings Software Developer, Codethink Ltd.