Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3119894ybl; Fri, 20 Dec 2019 04:16:48 -0800 (PST) X-Google-Smtp-Source: APXvYqznUEtlE4gDyJSRhJTZb58lWS4KjasA6P4kTVleufRiwKUu9t5NFKJ4Oxu9rWICdZF3zL0j X-Received: by 2002:a05:6830:1e11:: with SMTP id s17mr13989059otr.343.1576844208189; Fri, 20 Dec 2019 04:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576844208; cv=none; d=google.com; s=arc-20160816; b=Syp0HEDiBTCVbgvrRqky8ivbb2Jg3vXGkRy3+Nwip+/Uc8inKTr603F3RoN6DO5zbT IvsC0Kxv2+QBV23RS+B6ycZdz76eLI0hYtB2eDqXpLn0jEYdsYdUIuNVr0kS4VHsg0RL S0mVnoio/MWHUshKC4Tvx5ewCuLjRoNRJsRjoJDFQ/7NN9MpjKrCHN3QwoMeH7gm9YDe nJ9bPItqUPCFm7bQQ24c5WbJCkEQsMqrHLEe2vhe0LkPUBpU6DYTj2SKWEZp7PGfwPNh H4+zV2l12QOxIWe9t++0QMtKXm1LL9tYytXBT2skucQKphMSkNwetn0dk/77+KDTM2c5 tTSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=xvpVYIwaz672d0kcjxH1QK17qJzBHXsul2UekgCsoWo=; b=xeEumaCY1vTjeLijQPptFhp8ysimLVSk95+umJ8Jc8t2S+T4q6327SA1QiGVY6wbJk 1LP19V4Vb0V1MLx4R6wxZqpdXMR4MN92cfxv2fgjZU31UKez9XfJFmOpUrBwRcSxl+17 WNCcQldVUTlbZFQSh0y9X6gvuQB3DlbEUL12NyqNxTGg1hPAXcd1zEASIg/1vNfBqait ZJ9Y5mEQ1zwGtiL1gWcvF3g8MvCm3vCQXKCUxJqaxYDWB/OFNka4s44XIlNiepA4myzW rWpzEGj41Byhv2Pi5V2q9llbHHn+6nCzqsjFTEe/JUbHZMaq4b1gT40xi89B8cNyQ2tR Lw5g== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g16si4985345otj.129.2019.12.20.04.16.35; Fri, 20 Dec 2019 04:16:48 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727291AbfLTMPp (ORCPT + 99 others); Fri, 20 Dec 2019 07:15:45 -0500 Received: from mga12.intel.com ([192.55.52.136]:5665 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbfLTMPp (ORCPT ); Fri, 20 Dec 2019 07:15:45 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2019 04:15:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,335,1571727600"; d="scan'208";a="416519636" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga005.fm.intel.com with ESMTP; 20 Dec 2019 04:15:43 -0800 Received: from andy by smile with local (Exim 4.93-RC7) (envelope-from ) id 1iiHC3-0002kc-8y; Fri, 20 Dec 2019 14:15:43 +0200 Date: Fri, 20 Dec 2019 14:15:43 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Bartosz Golaszewski , Kent Gibson , Linus Walleij , Greg Kroah-Hartman , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Subject: Re: [PATCH v3 12/13] gpiolib: add new ioctl() for monitoring changes in line info Message-ID: <20191220121543.GY32742@smile.fi.intel.com> References: <20191219171528.6348-1-brgl@bgdev.pl> <20191219171528.6348-13-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 20, 2019 at 12:25:59PM +0100, Bartosz Golaszewski wrote: > czw., 19 gru 2019 o 19:17 Andy Shevchenko > napisaƂ(a): > > On Thu, Dec 19, 2019 at 7:17 PM Bartosz Golaszewski wrote: ... > > > +/** > > > + * struct gpioline_info_changed - Information about a change in status > > > + * of a GPIO line > > > + * @info: updated line information > > > + * @timestamp: estimate of time of status change occurrence, in nanoseconds > > > + * and GPIOLINE_CHANGED_CONFIG > > > + * @event_type: one of GPIOLINE_CHANGED_REQUESTED, GPIOLINE_CHANGED_RELEASED > > > + */ > > > +struct gpioline_info_changed { > > > > > + struct gpioline_info info; > > > > Is this guaranteed to be always 8 byte aligned? > > I'm expecting to see some comments there and / or here about it. > > > > struct gpioline_info alone is 32-bit aligned but its size is 72 bytes > which works for 64-bit alignment. This new structure's biggest element > in 64-bit, so it's 64-bit aligned on 64-bit arch. We have 72 bytes of > gpioline_info, 8 bytes of timestamp, 32 bytes of event type and 5 * 32 > bytes of padding. Should be fine, but I'll add comments to the header. Yes, what I meant is to add comment at least to struct gpioline_info definition that if somebody would like to change it there (which also might be a problematic here, if there is no versioning scheme / length member). > > > + __u64 timestamp; > > > + __u32 event_type; > > > + __u32 padding[5]; /* for future use */ > > > +}; Offtopic a bit, had you had a chance to look at Buildroot and our scripts I shared? -- With Best Regards, Andy Shevchenko