Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp163512pxa; Tue, 4 Aug 2020 20:07:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJype/Q1ZrmUqSH8tCfuN6ASOPbJY0s5vMna8SjOOM9L21aBIhov8DaU6eduLuQwcTmLWT9Q X-Received: by 2002:a05:6402:1218:: with SMTP id c24mr866695edw.44.1596596839039; Tue, 04 Aug 2020 20:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596596839; cv=none; d=google.com; s=arc-20160816; b=vuwNzvhTAX58A1CVecV3nqNCAsQhJHTXxNgAL8AVXIjDaHk9hXK+pe6Ejxf69OOKyE 02rteinFNW8LdxfFyxbaMbm7If9AP2JV6SXD2YmDCXTpv1fxRHyziu/Zaj01IyRueCp8 LifzczjYJHktze63P/aQ8ch+fztB1Rfx/dkAa/W0nZpiL+TS3DSOiNaW3XJdRVLlfqsI EYHmReeoonORPeYfT5apeikMcqIqXq1rd3zUPUZ5TzSTzM40JgOId88sFNFP31dc3gSB 32eyMdjBdNN4wOlRDPbjGw+QrWm1RRMU0Y4ePZ8ZMAjLNtQ2la6zfCC+1qIbrEb5fLkN AZDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=QDticxdTQ9ZAvE93eIeivxOMm0CMx+gyMo4J8Uikmss=; b=NKnhpuQ+oCEHyJb3xixsvG/UieGk3zvMMBZAsZJoA04FhgXSdCKotLmSQ8OPuTiyb5 kUH4Tf1OlH9upKTkTE1dI4qnLSciG6VQqf2sOsG1+9VbmJMhuZ12X4HkULXc7oaIoh8q Q4iEi29/UGEdcdlJl+6J4/3bA7flf1Rv4/Ut0ZpEAEZ4uQHSPbSqfeRIQdgnI+aC6NrC zFnthH55k5ruz6DFAfA0XM4KsEf7rHLB1JO01AJEJnbyI1vSg9f8mU9ujMt3pgeF6bsD xnGpp5i2xU5hWhtp3875IjwWvbdZsJQnY8fL4keMSscrZ5uBItn1KmnLXqwI84jS5w6m ZpUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="CjSuj/T9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si471808edi.200.2020.08.04.20.06.56; Tue, 04 Aug 2020 20:07:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="CjSuj/T9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726150AbgHEDGs (ORCPT + 99 others); Tue, 4 Aug 2020 23:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725950AbgHEDGs (ORCPT ); Tue, 4 Aug 2020 23:06:48 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2586CC06174A; Tue, 4 Aug 2020 20:06:48 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id w19so11477525plq.3; Tue, 04 Aug 2020 20:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QDticxdTQ9ZAvE93eIeivxOMm0CMx+gyMo4J8Uikmss=; b=CjSuj/T9LnSckPWebwCnf9GF+adDQErajAn/Yw4Qdsqzr2cLaBAdBnRC2yg1eIs6Jb N0uzMimMaWwEA+3xMdB6LACohl+M+IlDaTEaohQRdbxNpOtP4c0QySQle2GnZfl04g26 baKg6nuIWqgf3X3+cfMqDOvGpg/5t2lycubePKHLTiMYPu841Ma9lj0XkZJMAxmRlQLf m8W03WPdjMyfpbYIGvUKtMjvXUIt08NTV3izDIa23M89eTuquGhsoHa5unP0CjrEPjly r1Gkm+APKi6rZExSNlnH/ABMwHtz7woIColQFphOTSyZWOufumFuq+KiYqULzCRSLRGX +R1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QDticxdTQ9ZAvE93eIeivxOMm0CMx+gyMo4J8Uikmss=; b=EFCBDllPlTTj1Xe4RXIioD7QmLQQe7VDk56OORdtD4I46O2LCmi7ov3svlhrNrAtrr QFgyA+vghJMcZqCdPxFXphYjgEq0qdencBdkoCcn69CqnVDvNCGl2VeqfgprLO4tVH42 Q83KINAyETU/OCFix6ceIvbz0cKc0htS8b0uNtDT13+fUke0Rq92P5Aqxsoq9CXWivZn dZGlLl2EPC7GGBhpg6O4Rl+HHSYAgh3i5h9hiRmcMd0n20axHRzBjXD4jZ8FsHddYEBk 09YmXVeG+5X4oF2XEN2cNx/190Zsb5EfnQlvAgADRBHZg//rXR3TUKbqpkQSbowuAQLu nSyQ== X-Gm-Message-State: AOAM533DNuamdh7Cu2qygy0ypjfpg1ukJK6RmklaNZOAxXtaZANLlbP7 AD+i2U8UcQypeA/djyHZvgQ= X-Received: by 2002:a17:902:10e:: with SMTP id 14mr1103007plb.297.1596596807515; Tue, 04 Aug 2020 20:06:47 -0700 (PDT) Received: from sol (106-69-185-93.dyn.iinet.net.au. [106.69.185.93]) by smtp.gmail.com with ESMTPSA id d81sm793398pfd.174.2020.08.04.20.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2020 20:06:46 -0700 (PDT) Date: Wed, 5 Aug 2020 11:06:42 +0800 From: Kent Gibson To: Bartosz Golaszewski Cc: Andy Shevchenko , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Linus Walleij Subject: Re: [PATCH v2 05/18] gpiolib: cdev: support GPIO_GET_LINE_IOCTL and GPIOLINE_GET_VALUES_IOCTL Message-ID: <20200805030642.GA119030@sol> References: <20200725041955.9985-1-warthog618@gmail.com> <20200725041955.9985-6-warthog618@gmail.com> <20200726011244.GA6587@sol> <20200802033158.GA13174@sol> <20200803230118.GA3650@sol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 04, 2020 at 07:47:43PM +0200, Bartosz Golaszewski wrote: > On Tue, Aug 4, 2020 at 1:01 AM Kent Gibson wrote: > > > > [snip] > > > > > > Also: I just started going through the patches - nice idea with the > > > GPIO attributes, I really like it. Although I need to give it a longer > > > thought tomorrow - I'm wondering if we can maybe unify them and the > > > flags. > > > > > > > I had an earlier draft that did just that - and that is partially why > > the loop is last in wins - I was using slot 0 as the default flags. > > But the default flags cover a lot of use cases, including all of v1, and > > it was simple and cheap to provide a default - and it simplified the > > initial port of libgpiod to v2... > > > > If porting libgpiod to v2 is the only concern then I wouldn't stress > about it. At the same time I'm wondering - is there any use-case where > we wouldn't need the flags attribute for at least some lines? Because > if it's always required than maybe having a default isn't that bad. > The only case where flags are not required is an AS-IS request. I have no idea what that use case is useful for, but it is in v1 and therefore supported by v2 for backward compatibility. So there is almost always a flags attribute, and I didn't want to waste an attribute slot on it. Supporting the default in the kernel is trivial - it is literally just the default return in gpioline_config_flags: + } + return lc->flags; +} which would otherwise be 0. Cheers, Kent.