Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2317397pxb; Fri, 29 Jan 2021 21:31:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2dSNLD12b06xSCN+nXKqCFn+NNITC8uV+O53ZZfVTHU9sAGjZSlB25qdczg1H+BLPrRTs X-Received: by 2002:a05:6402:310d:: with SMTP id dc13mr8703724edb.291.1611984660828; Fri, 29 Jan 2021 21:31:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611984660; cv=none; d=google.com; s=arc-20160816; b=ReZEpv25S2Nf9UnC/JmDIIj0MZDTGcL7PY/pC3mp+f2SiJnXd6jBgUPdoNDrusWRuh SzKPmlJOWnuZ4BRL7wmwCK7BVL17bZWEhW4WxOyDHE5jayMvlFwKocuT6Iv74d4CC1iV tIvjRb4cQ4F41A8QnGzG+iozn+daJ9u/+aU0w9m7cWIonqkbEp+izGJhbfHlEf/ymEvT tjxhjSSKztSXPlMeWJTGXHsrCzDYz/9k7lpOtwZmieylbhsOFYT6sCq6CVzh2jGkFl+5 s2OaG7HgwckW2YiGzEAJ+awDt2VsGbnkz/qs9lnXlqVZcUP6gJid2e0SnkD9951AiwlO s74w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DajhKcQbvSudZ+FOJNrz2aW0zOcE1tiQUOXaXnxB8PI=; b=b8GLZcz1EpEt2EEJ4gq2AP4PnkNTKBF7aQJQstxyRrAwewtiuOK1T47O4NC950xFYv uMUJoNTpxPRIPywqVwvLXGwuCTMzM+muGbqidweS9FP+WWjkJsmmndJUv/p/RPMUWT6+ e3QZWW2Ic70zMAW937IScCMRb6TDYIxBGQFghf1KYNvvBYSQ9CCAOgy0tzmUqo16F3xd 5AsNGMBRRieCo7p69KzOVXQQPMddAZ9v6kvbz70gDVu+AZITMeL+880r7EHUhIDGJFMT Kz+aQYTJ2QKqFmPCQCtNNuo0Q1V0dTlHWVvcEHDpQUEIZRcnS5EY0faw5ytsqcxliAVw bOew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=A2wpAIaW; 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 jp25si5783568ejb.519.2021.01.29.21.30.36; Fri, 29 Jan 2021 21:31:00 -0800 (PST) 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=A2wpAIaW; 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 S233708AbhA3FYX (ORCPT + 99 others); Sat, 30 Jan 2021 00:24:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233780AbhA3FQY (ORCPT ); Sat, 30 Jan 2021 00:16:24 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4036BC06174A; Fri, 29 Jan 2021 21:15:41 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id o20so7562547pfu.0; Fri, 29 Jan 2021 21:15:41 -0800 (PST) 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=DajhKcQbvSudZ+FOJNrz2aW0zOcE1tiQUOXaXnxB8PI=; b=A2wpAIaWTg4pDD9bNSTe4FEpzxuaqCYRaCVihvKx9wk4a53sZUM30exdllaZC+58wB DcS/Eju4Mj+AWigJelaiXevcBUWJgdFgRGpphd01ISsYAwKghf1M6aksu+BlnwN6eX8w 2LctfS3dvly0L7a/zRbjYVfOCKG0X2vW3nIh5bYs0+u4Y4OZ6ZoeUJaKj9qOUh7XeBoL RsILgZWUtTyoktjsIFoSGaxIv5MTTFaN4KJSZe5FBaZV5hTghnl1KrHqz1cmWfdOB+EH +x1t/hUWbaWdRZGKDmXZMXVrYhScbRb2bbsA1he8ykO28gGC1Dn0efZe94Q/Xan9wJEq elPw== 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=DajhKcQbvSudZ+FOJNrz2aW0zOcE1tiQUOXaXnxB8PI=; b=b/e4jLpodm4lg8QlXMewuFFDiCGVqTQKbSfFe1Z5wRBpoz87HiZcuydxYPyW7ZVnmf /MR7O+9tGFnCLq+u4hCmynGPzeNM73rKSTgjGHKk3b0wPs5PiOfMQDp7msXL/WoTHCyY 7ZUqemvP4Wqq4sjOTHyGNWTUb9U242ceHle7xrMKUPn6zIbhoZrMFGTUvxZt8t4nDeMx HNVZLfma9uzH/Qs+usErZROUgqXCxMe29E5oZfZugZahEZWg/tBB6TYprR9zAKPY4c7u OrT2VIssjRQVMJzCi/HF6jr2mmLsNgM9CvfIYSQ3ldRNw92qtQkfvCRMkjspN9pDVrwh WKmw== X-Gm-Message-State: AOAM531iNEiYYDuGjw03qx/yChFrUSRoMvewi0CR+wCcF8ve3yMfV/OR i4tWcEZI4kiVoDFKGjaw/lg= X-Received: by 2002:a65:62cd:: with SMTP id m13mr7931884pgv.108.1611983740662; Fri, 29 Jan 2021 21:15:40 -0800 (PST) Received: from shinobu (113x33x126x33.ap113.ftth.ucom.ne.jp. [113.33.126.33]) by smtp.gmail.com with ESMTPSA id v8sm10269068pfn.114.2021.01.29.21.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 21:15:39 -0800 (PST) Date: Sat, 30 Jan 2021 14:15:29 +0900 From: William Breathitt Gray To: Oleksij Rempel Cc: jic23@kernel.org, kamel.bouhara@bootlin.com, gwendal@chromium.org, a.fatoum@pengutronix.de, david@lechnology.com, linux-iio@vger.kernel.org, patrick.havelange@essensium.com, alexandre.belloni@bootlin.com, mcoquelin.stm32@gmail.com, linux-kernel@vger.kernel.org, Dan Carpenter , kernel@pengutronix.de, fabrice.gasnier@st.com, syednwaris@gmail.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, alexandre.torgue@st.com Subject: Re: [PATCH v7 3/5] counter: Add character device interface Message-ID: References: <57bc509273bf288d74835e6ebdaebf27b4991888.1608935587.git.vilhelm.gray@gmail.com> <20210128090113.GA8734@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mYrx736tSU4e+spo" Content-Disposition: inline In-Reply-To: <20210128090113.GA8734@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --mYrx736tSU4e+spo Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 28, 2021 at 10:01:13AM +0100, Oleksij Rempel wrote: > Hello William, >=20 >=20 > On Fri, Dec 25, 2020 at 07:15:36PM -0500, William Breathitt Gray wrote: > > This patch introduces a character device interface for the Counter > > subsystem. Device data is exposed through standard character device read > > operations. Device data is gathered when a Counter event is pushed by > > the respective Counter device driver. Configuration is handled via ioctl > > operations on the respective Counter character device node. > >=20 > > Cc: David Lechner > > Cc: Gwendal Grignou > > Cc: Dan Carpenter > > Signed-off-by: William Breathitt Gray > > --- > ... > > +struct counter_event { > > + __aligned_u64 timestamp; > > + __aligned_u64 value; > > + struct counter_watch watch; > > + __u8 errno; >=20 > This variable clashed in user space, as soon as you include errno.h, > with the libc's "magic" definition of errno. What about "err" instead. > I'm not sure it an __u8 is the proper type, IIRC usually it's an int. >=20 > Regards, > Oleksij > --=20 > Pengutronix e.K. | | > Steuerwalder Str. 21 | http://www.pengutronix.de/ | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | Sure, I can rename this to avoid a possible clash with libc's errno. Maybe "status" would be more apt to indicate that this is an exit status for the event -- the code returned may simply be a warning and not necessarily a critical error. Regarding the datatype for this value, I've opened up the discussion in my reply to David Lechner [1], so perhaps we can continue it there. [1] https://lkml.org/lkml/2021/1/30/5 William Breathitt Gray --mYrx736tSU4e+spo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAmAU63EACgkQhvpINdm7 VJLsxRAAhlCPUhj65vzfuqQStMkmCoKCekEBmx0CS9yJR2Ilrcqm0yvEZdq5q/c4 /FjnucZRerDshexfeRaaDg4h8guEXzp8YcmM74NTEn8tpsvwNVFWFcbwbePlvHTt VtU6qRRN8Bu50wVwdqchRiMuJA9jcAR/5YcfGslq7bxGcvEhQgNvlrjI+NG9tNUU smKjjeqBW1AMMFs7CQ4i2QwNA+Vdfy3/Fun9Qsx41zMHAV8/c7UVbIBF3XsqdJHl AAphNutr43FIjqrvb3MMVrk06sQ0f8SjEjypX6jODB0dzug5JDtnt1/MdvBO5gSN e6/QLq4wgz8Rvl6YECPFBZvt9Bk31tmPWsUg6JQduASolLoM7kCW4XDIGzeHBEiT ESipbOGVVeM3WQlON5+bf9li7ARIPEFajcOViw1R8LbASwSXv1MOuDoLHHHfVRg4 kVFJCD0K/g635AkOHB/Nve9ju0x15u7aJOibOzU6YyyuY+kkj1Yir8QMYf2IBUvA CMHkZwxt2uSIFvjVdXrOFuHCoqQnRSIL+USgBk3T/NtCMrGDaPd2RDEE0VL2+O0Z T2Dwuzzd1QnCYrZWQFgjaPOgUIPYf1sRWUpkr4s1//RQN+kLCEepauTHgApP9+4m 7peK1qgaGSNZYjq7lcdzv8J410JU6D9ZgIGe3BpUhLqGGBDHQcE= =9dBE -----END PGP SIGNATURE----- --mYrx736tSU4e+spo--