Received: by 10.213.65.68 with SMTP id h4csp268164imn; Sat, 17 Mar 2018 03:15:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELuZBl/tI9xRQfiW4U6fa5csCKoOIsA9kYzbPdDHcH3weQSC1naGmkIbXCzZqNgj208qskl1 X-Received: by 10.98.92.194 with SMTP id q185mr4350231pfb.63.1521281731504; Sat, 17 Mar 2018 03:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521281731; cv=none; d=google.com; s=arc-20160816; b=XnXpFe7UJcmP9NY8XcpPbM+hdzT9MJWfh9jbhlY8LpHsNf38dhhjTjmiI/VvM+FsaA ytmBZuHEG9DdTzXrofEA8N9mIS4sb8llSeiA6yLSeJKyiZ07JynW/noFIKjelg2qhPp2 D9bDLWTbGekhsLBRE1mgbShAV9N8e4SaJgCb27+MqzPitjmPmjw/Dc4BFR4gn01FPT2w Dy4vSJqXQ1xaYF6Z4ZgjBkqKL3VkLqmBlNJaNDhln08jlOlVs00+6Hv0JrI8J/JpxzIV ElrGNpGTJUqxugjSD/eMObV2RwQtVnOvqXLtVGwj4vSZ4YjLanog2ZEM75NPgUR3z3U1 MS9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=pBvPKQ/69xg/zepnr3aycVLXseDHrytCrCM7KOh+YWE=; b=niw52u+onvamzdoc5Atnm+04ZMpYeYS2OO12al4OqDblJ0wiLO5uqCfd9SAKmDZs5z xN5+u/zSqm09GtyoTLj5IbS0lCABHd02ZEP8LtElCfoubC6T71Yxxzz5wg0C2ZoIQGxn tg1p4WNTUnul56lHKdvqhTbY0v/PwSAZW5zeF+NsP0IUiETL5hdCaL8fTEJShvWUOXlz 5o2CqS8mKWQoXt90874DLTxbJ+zbkmDW41OyCwGkeFZy031o+Uxa2klFghalYu5n5Ezy s6uAIt/h5hoAp+UOUs2amIidLDdipV4uQBQ53uBnwngoKGj0lvAjLi6iEfJAa9jjm+ZE i2/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Irotrwdj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4-v6si7930249plp.672.2018.03.17.03.15.17; Sat, 17 Mar 2018 03:15:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Irotrwdj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753251AbeCQKNW (ORCPT + 99 others); Sat, 17 Mar 2018 06:13:22 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:53481 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751618AbeCQKMI (ORCPT ); Sat, 17 Mar 2018 06:12:08 -0400 Received: from [192.168.43.222] (unknown [149.254.234.195]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 9BB8C200AD; Sat, 17 Mar 2018 11:09:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1521281390; bh=ccHEydGGJXs2GgMIVBUgpMf7EwlECo8A4QYZE3wCwyA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Irotrwdj9dBsI0A8Gpm9i/3dibvWgp9Vpt0WCmPI08h9MgOXCt3ggExPu9oBMYEKy 0JBrsvfbzLphHy71bXMACw+cJECCELf5NVbsLuTgZdk/yMpBEII72KRs6BBqzpH0U7 E4va2eY//X/qDhou4MeBBUuvK7ghiDyW71Yvrr8w= Subject: Re: [PATCH][RFC] kernel.h: provide array iterator To: Joe Perches , Rasmus Villemoes , linux-kernel@vger.kernel.org Cc: Laurent Pinchart , linux-media@vger.kernel.org, Andrew Morton , Ingo Molnar , Thomas Gleixner , Kees Cook , Herbert Xu , Masahiro Yamada , Greg Kroah-Hartman , Krzysztof Kozlowski , Randy Dunlap , Ian Abbott References: <1521108052-26861-1-git-send-email-kieran.bingham@ideasonboard.com> <1521225943.6119.10.camel@perches.com> From: Kieran Bingham Organization: Ideas on Board Message-ID: <5f027b5c-7419-d4f2-53a7-28805baa7193@ideasonboard.com> Date: Sat, 17 Mar 2018 11:12:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1521225943.6119.10.camel@perches.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joe, On 16/03/18 19:45, Joe Perches wrote: > On Fri, 2018-03-16 at 16:27 +0100, Rasmus Villemoes wrote: >> On 2018-03-15 11:00, Kieran Bingham wrote: >>> Simplify array iteration with a helper to iterate each entry in an array. >>> Utilise the existing ARRAY_SIZE macro to identify the length of the array >>> and pointer arithmetic to process each item as a for loop. > > I recall getting negative feedback on a similar proposal > a decade ago: > > https://lkml.org/lkml/2007/2/13/25 Thanks for the reference. I didn't know about this. Your suggestion at https://lkml.org/lkml/2007/2/13/25 looks remarkably similar to my implementation though :-D (Perhaps even a bit neater, I may have to incorporate some of your suggestion) > Not sure this is different. > I count three disagreements in that series. But I'm sure I have more positive responses already... (Though no 'official Acks' yet ...) How many ACKs do I need for this to be accepted ? or do the past-nack's have full veto? I still believe the use of an iterator in my case [0] makes *absolute sense* (thus it must make sense elsewhere) I'm not suggesting a full tree conversion here (though that has been suggested earlier in the thread) but the ability to add a convenience macro in a common location, so that it can be used when desired. In my instance, I have an array of structures which I want to iterate. I believe this make my code more readable. I have already had another vote to say that they thought the same. I'm certain that throughout the media tree there are a lot of use cases where arrays of structures define types which must be searched where this macro could also make sense. Do I need to start a poll to determine if this is a worthy pursuit? or am I to give up and stop in my tracks (I'm a bit too tenacious usually to give up - so someone 'high up' better make a clear statement saying ... just give up... otherwise I likely won't) Either way - I intend to add an equivalent macro to the UVC driver [1][2] (because as I said - I believe it makes sense), and I have the support of the maintainer there, so It seems a shame to have to duplicate the implementation in other use cases where this would make the code more friendly. /me awaits a NACK-FULL-STOP, or now fears if I'm about to be the cause of a flame war :-S [0] https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/?h=kernel/array-iterator [1] https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/?h=kernel/array-iterator&id=3dece696e5b19d79c94f88c9df77482542d49a75 [2] https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/?h=kernel/array-iterator&id=a31a5424a6577e14d46ce24ef0eff35de3e089bc -- Kieran