Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp585696ybm; Wed, 27 May 2020 03:03:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTR82C/vyyElhDZZwlVuLb2GNIoSFXXp3x2n9m5NHbGlFE2yOzjcAMsmPabCd6bDUFtX10 X-Received: by 2002:a17:907:b11:: with SMTP id h17mr5206392ejl.430.1590573826166; Wed, 27 May 2020 03:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590573826; cv=none; d=google.com; s=arc-20160816; b=XTrUdWyW9wcdjCEMFqZCSOJlnYeZf3/nrE7XY7DM922Mv7us3jx2a+p12bJvrW3t8w dcJrtmE8k1DVtPNgape6c/sB12ML8MDOy5BlpsKzVwN3X46BwfvOzRjTKl+H0kCD2sJQ I7JOaD4AwULXuM14cixGf27Vs8f4KphL0FnDkcnHfDAC4+gYUfBoGqVdRgY94cuon8dg WvwRnfSTd5BjNbPvoRdS6aZDJRlQtJhVIT7P6D15E5XDa8KlKEPXcVVKWxVQbn/zCZGZ bxA+3+XEL88PQrXWVWjtfyssW4ynFtVH0JXbQPX8WCo/EhycOgzoXEvuJ8S599H2Szb7 IV0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GZrxLWEv2RQwIV4nFIWedkkizU0DIsRXfRmjD6gFnTY=; b=EmJM4M8EokNIobCVEymXppic2kC20Ny+pR69/QcnOnp2FQQWnDmj94uA5rOYx9zLvq nEayMobOcocs9pbaLRMonFiBY4Cu3wgAceApTXJgRT5AK/WkXv/j3soYPQZEdq3wEsHz a80fZYArj32Bqlcyd7Ec08xNPeFU1f7pG6nl2oVcN8rRpH5SybOuDS3HjzOyxjhmtZBM M8DkW+l3xbPM6HYuZyi2x10/NVS5AtCTxT0KmwmnPSyeTnTQrJd8jH3d8PbVk9yt4mic k7SffRPXXpmznt4LLh+BzOQ86qnP96O0bDACBX/bsGXJdxLOL3GT9M2Uw3fBaDnIvjtj GcNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dJUTgpiM; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si1524949ejd.723.2020.05.27.03.03.22; Wed, 27 May 2020 03:03:46 -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=@linaro.org header.s=google header.b=dJUTgpiM; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727063AbgE0F65 (ORCPT + 99 others); Wed, 27 May 2020 01:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbgE0F65 (ORCPT ); Wed, 27 May 2020 01:58:57 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD157C03E96E for ; Tue, 26 May 2020 22:58:56 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id v16so27440092ljc.8 for ; Tue, 26 May 2020 22:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GZrxLWEv2RQwIV4nFIWedkkizU0DIsRXfRmjD6gFnTY=; b=dJUTgpiMkJ1s0zS0iy9nBJ3IHP5NHvdqW4eA3+0tV/Yadk+ve6GdDgBLTP79aXub38 ekh0+PedTpGyJNu7HvTuXYznrJlYsAAK1Q4YyDCvkE7JuopBTUyqyQKc3+J9gv5YQKaE mPckQgv/SXPxD60SABLLSqZPksIKZy1wYsmvDFgvaor9LdiCR2ferynQ5R9rQF6XOVC9 cQGBG4Sr9NotnvZY5brGYP4Cg+Yx+/Va9OYrRzmsmNtdWBRSP9UusWScDhgE/pEUJ8VF 8LK8Kh87YrgFCh1yp7n1iEyOBHg2Uaj/zqt0vUJ3eJecVUPOPauj17f/Zdopj8qfG9oV iqJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GZrxLWEv2RQwIV4nFIWedkkizU0DIsRXfRmjD6gFnTY=; b=PoJ6U8IAPGq+w/cZznwcWEtiYVzEbKczTZVdAC+I5tqbTrJkPHRvYobnLGb7OgBOSd /gt0MLi3PTu29+67YaKIjSFrj+nriVgv5TEUF+lVpV7RLuTvzTAMj02gcydEfW7EJ1eh NGo8mA03QSFeQYGL4Z35lBuEqXJVEV/WXiiMM/CxNtl8cSQmm12fW7rgAMp/QbXuyXOo DFSVfxSTUoNccHsUfZu7VVB4mmjBrWXcjYODtrxpQmzAhwbZiA7rbAP+ByYOgEA0Uusf DT0md0nUUFRCneJUsWT85/lHgh2H27HiCkZ6oDnY+aUu0TutCyidWLwcxtNlM2Fjk0T1 kQSQ== X-Gm-Message-State: AOAM53096Hw8w54CNhttd8VAZ/yRMljJoGRGddXfCDDW22cHaR9YHkBg BkkhIMwSylhbp96ZE89AY2ULMA1qsIYOve8J9ExDIw== X-Received: by 2002:a2e:b5b0:: with SMTP id f16mr2362794ljn.100.1590559134977; Tue, 26 May 2020 22:58:54 -0700 (PDT) MIME-Version: 1.0 References: <20200516064507.19058-1-warthog618@gmail.com> <20200525141902.GA27938@sol> In-Reply-To: <20200525141902.GA27938@sol> From: Linus Walleij Date: Wed, 27 May 2020 07:58:43 +0200 Message-ID: Subject: Re: [RFC PATCH] gpio: uapi: v2 proposal To: Kent Gibson Cc: "linux-kernel@vger.kernel.org" , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 25, 2020 at 4:19 PM Kent Gibson wrote: > > > +struct gpioline_config { > > > + __u8 default_values[GPIOLINES_MAX]; > > > > So 32 bytes > > > > Actually that one is 64 bytes, which is the same as v1, i.e. GPIOLINES_MAX > is the same as GPIOHANDLES_MAX - just renamed. > > On the subject of values, is there any reason to use a byte for each line > rather value than a bit? Not really, other than making things simple for userspace. > when adding future fields, the idea was to have a bit > in the flags that indicates that the corresponding field is now valid. > If the flag is not set then whatever value is there is irrelevant. You would need to document that idea, say in the kerneldoc, else when someone else comes along to do this they will get it wrong. > But definitely better to play it safe - will check the padding is > zeroed as well, as well as any field for which the flag bit is clear. Yeah better like that. You can write a comment in the code too, such like "when adding new parameters, update this validation code to accept it". > Back on retired ioctls, I notice that 5, 6, and 7 are missing from gpio. > Have those been retired, or just skipped over by accident? Just thought it was nice to use jump to 8 for line info. They should be used when adding generic chip information ioctls(). Yours, Linus Walleij