From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37EF4C433DB for ; Sat, 30 Jan 2021 05:17:09 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E013964DF5 for ; Sat, 30 Jan 2021 05:17:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E013964DF5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=m5Ysw34euh0/vWHESqVQWzUoXGYXgK6JoD2AyVsLxis=; b=g2ahJYNSWWjB0YpZq4MzOyegE iT6N4qLsuogOqoYjD+vl4AnhlX+prtc7dqwVFEYu1pTI1PjERV0DFI7VAf4q+uLS14fk4FzWmGG/G y81awKc5gDS5JI7M67VZa2UFUX4GdEmC5M9UmLB7u6uHE4N4gYDY/AhCcrMC7NqvUjn2uOIAr1wt5 6T7yRtZwsls1oD/Q8APE6in8FytmjZxCFCkbQPg3JRlu0fD8SxYkouRvlqrtPoZFWDT+vHczp8pRA Kd9Q05JNCeNmhLu7TBEAzpDSYiZS9o88Mmfyg9HRmhA6muCDO0lSdq6nZuuOvcMBB/QWEwBUIYGDf lUW4lt6Kw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l5ibq-0006jw-FL; Sat, 30 Jan 2021 05:15:46 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l5ibm-0006jG-Sy for linux-arm-kernel@lists.infradead.org; Sat, 30 Jan 2021 05:15:44 +0000 Received: by mail-pg1-x52b.google.com with SMTP id j2so6375610pgl.0 for ; Fri, 29 Jan 2021 21:15:42 -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=BYO4E6xr0JBY6pWhAYejYsxe5ml5Bqe/AUjkrrc1g0BVgJK/TlyE6UTesoiKGd6o4p 2HwxoP7GI53sXlH1HVVKysqRQy4WakDlTW1i6OIhBxhfCY9/RidSqh9GHMF69qwcLwNM +dKwBu9NEXUHDHWeE6aV8NRoHYyA8CN6lAkHvCLPKNWZDsRMma9KLpFUbnZaEeaCOtpO XDs28ZACeh9BA/WKANOuwkUXrTsO9jt6FwPoRt6ewF7SI3CJ3/yvBysY1lwY4FcoC4Ft STdC4qO31eKRVe+dhmPl5x6xtrzGdGc5rj1XJJoiRhZizkC0Q0jFoE8SdH5aoPqz3A8W w28Q== X-Gm-Message-State: AOAM5333y15O76nwvpjE4RhomT6ahYp2y2NMi8tHnrSAkORVHm6Xf/0s ueR7zxMNAf7r0wTzbTX8bws= X-Google-Smtp-Source: ABdhPJz3xXOhtRoebqWMcQVAVlzvOHOj3KQTzng9Dt2tFdWx6XxcAnUKxQc98am3f2V4rV+jkl4rog== 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 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 In-Reply-To: <20210128090113.GA8734@pengutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210130_001543_018186_A97FF611 X-CRM114-Status: GOOD ( 19.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, kamel.bouhara@bootlin.com, gwendal@chromium.org, a.fatoum@pengutronix.de, david@lechnology.com, linux-iio@vger.kernel.org, patrick.havelange@essensium.com, linux-stm32@st-md-mailman.stormreply.com, alexandre.belloni@bootlin.com, linux-kernel@vger.kernel.org, Dan Carpenter , mcoquelin.stm32@gmail.com, fabrice.gasnier@st.com, syednwaris@gmail.com, kernel@pengutronix.de, jic23@kernel.org, alexandre.torgue@st.com Content-Type: multipart/mixed; boundary="===============5864135473477609318==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5864135473477609318== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mYrx736tSU4e+spo" Content-Disposition: inline --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-- --===============5864135473477609318== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5864135473477609318==--