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=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 03E9AC433DB for ; Tue, 16 Feb 2021 01:29:19 +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 6E2AF64DCF for ; Tue, 16 Feb 2021 01:29:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E2AF64DCF 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=9tnvWmOixHfgq+vso8hGXZH+XiPiavW83yAuDdL70S0=; b=yJrHywV92Nf/LK6Zz75qylSUg FPo/U3LZlF6tsPLQjJtDObCqJxzCOS0NXkRw3HwD6n5XxllAMcYVPHTxAh11QWFBMQlSMjgjpQfmv F8Jb72FS9bgWLtNVeKa/lTBt/ERauSGjPCP1LLm7UFSENG6N05oENFgCWBIIELKONpG5lvj/1Fakz LfZuM9KkPdu7GnRRreZU96MlwlUaSogv2PZgxNndxUlsJxBik4uZ3rnx7bnunAR2mcvgqTbbHm6t7 r8OkhJzDDiOhaNSnKEXEY0pVFDHJJFkNVr3B5JgHhgeQlf/e8kw/s2Vk2XpWLIc8lgrcNBYHp+jRK B7Z6ZXDbg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBp8q-0003sY-P6; Tue, 16 Feb 2021 01:27:04 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBp8n-0003s9-EP for linux-arm-kernel@lists.infradead.org; Tue, 16 Feb 2021 01:27:02 +0000 Received: by mail-pj1-x102b.google.com with SMTP id gb24so4724560pjb.4 for ; Mon, 15 Feb 2021 17:27:00 -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=cpP1ahAbYan7YrhKGABY7qWKdkXmh1J8OMHCMFf0SeI=; b=aoUt/JAVVyZWrlbnPdFWPTtECiCDrkWw0PZguZKigVVFgc5qwZGJjYiPd5dbwTu31m 4FosxisgDEvys+q00Jl9n3zTX551puDWyzKBtC9aGzfNel55RJcolxngGvtuR+tkrhKO 03Sn/IwH4sjnNveqar68xFfrkZqMXrwfmErJ9UBSN42wVeofYUVVpS+b5tEpZnX8izCT 1WweRKYjX8v6DE41T+7fQtG+43ScIZ5YciuRtWwaWfxdgqDRceiPCwLeK4OISr5N+2N2 MsgC5CWOUVaL94U1KtZxMpzs4gOueffK2axcnnQsiHxjxFWdEsf816hEclVlxkeOfk2s tvYw== 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=cpP1ahAbYan7YrhKGABY7qWKdkXmh1J8OMHCMFf0SeI=; b=LAYoZmIOQu3eoerVE74udagGd6+tRqOC9hqMRUXANuqZbFAo7DWmvOsaKBrvgcKw4H znuDtjp2ysN1rIEQo4BuUROb+rJ56UQuuJePJzYYm0ggRlzQK3nJj3MyxicdyB8DeuLf Rak9hTefQnCfC1t7x2Sdol1IB8JmF4HCL0MtikVgetk5TL5wObn2uqRZ+KmCDty7ayrP MdAQhI1OQrRH7eclUY0R/TTBxwFfDm6j7h7GJohC70XQo4BhntNemx1OikFD9IwWO+O2 fw/au9tjbGIj3aMLS2faYD1UVsblAXkLFHrXl5J2QzcNfsnLsaU56/fC+KwijazLXDwO FclQ== X-Gm-Message-State: AOAM533RI04+tg0s2VbygJKXzXLFSy6rsEGMJV6hLfjMf72H+Morqnbe I8y2nm4wMbZvdcxoLnxvHUA= X-Google-Smtp-Source: ABdhPJxo90mkA+P5tI6ctkDDRI6HmZSiLwFtseUgjjIOvHod2nOVgNMt+VfUkzRX9aWtvjLuDYkq6A== X-Received: by 2002:a17:902:e9d4:b029:e3:4192:8de with SMTP id 20-20020a170902e9d4b02900e3419208demr11335432plk.57.1613438819185; Mon, 15 Feb 2021 17:26:59 -0800 (PST) Received: from shinobu ([156.146.35.76]) by smtp.gmail.com with ESMTPSA id n10sm10056704pgk.91.2021.02.15.17.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 17:26:58 -0800 (PST) Date: Tue, 16 Feb 2021 10:26:52 +0900 From: William Breathitt Gray To: Jonathan Cameron Subject: Re: [PATCH v8 10/22] counter: Standardize to ERANGE for limit exceeded errors Message-ID: References: <7fa80c10fcd10d1d47d1bddced2b2cca3ff59ba9.1613131238.git.vilhelm.gray@gmail.com> <20210214171021.41b3e4e3@archlinux> MIME-Version: 1.0 In-Reply-To: <20210214171021.41b3e4e3@archlinux> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210215_202701_527671_0929F5D3 X-CRM114-Status: GOOD ( 15.57 ) 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: 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, o.rempel@pengutronix.de, 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 Content-Type: multipart/mixed; boundary="===============1608158093927311809==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1608158093927311809== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LCIwYMzstikRFa/y" Content-Disposition: inline --LCIwYMzstikRFa/y Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 14, 2021 at 05:10:21PM +0000, Jonathan Cameron wrote: > On Fri, 12 Feb 2021 21:13:34 +0900 > William Breathitt Gray wrote: >=20 > > ERANGE is a semantically better error code to return when an argument > > value falls outside the supported limit range of a device. >=20 > #define ERANGE 34 /* Math result not representable */ >=20 > Not generally applicable to a parameter being out of range > despite the name. > #define EINVAL 22 /* Invalid argument */ > Is probably closer to what we want to describe here. >=20 > Jonathan The comment for ERANGE in error-base.h may be terse to a fault. I believe there's a connotation here provided by ERANGE that is absent =66rom EINVAL: primarily that the device buffer is incapable of supporting the desired value (i.e. there is a hardware limitation). This is why strtoul() returns ERANGE if the correct value is outside the range of representable values: the result of the operation is valid in theory (it would be an unsigned integer), but it cannot be returned to the user due to a limitation of the hardware to support that value (e.g. 32-bit registers) [1]. The changes in this patch follow the same logic: these are arguments that are valid in theory (e.g. they are unsigned integers), but the underlying devices are incapable of processing such a value (e.g. the 104-QUAD-8 can only handle 24-bit values). [1] https://stackoverflow.com/a/34981398/1806289 William Breathitt Gray --LCIwYMzstikRFa/y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAmArHzgACgkQhvpINdm7 VJIx5BAA6jicWLlVTYqEHvX6K51XipDK7p5f6FQAAriMLEauLvpeW+e4yUHkKwYS xLjPabXpTHvPkAsjW96EgIxx2WTze/Ev8FJXRG0QIEaujtxJJ5L1rK1UYN1y6zXt /Mmv3gTJeKDq5AWHmMlLlFj5rXiXELi2U+FNz8kO6uIHAUpsRgatL/uWwujGfPO/ qP4zDz8IzhFU1ml90Wl+dZLO1nCQrM0CIi5sTFTvd4vBl9hV299mMuHJYFCIttGU T6QGtuoirMIS1SFYE7/RmapuakagCTRgeD/CPsaNhSBegqVJ+ouIcUpAV3mtBg44 VoweVhNDW8zG+n67KiTOACOEY4w4KFNfLwIH0ofMZ1GKyraqmlkf56wvCkQ04BoA LlD0eD3CoIZQjt+2L9tSc3gm/VugwGukmiJzQGAcfSv7cXeolPkYw9PD3h0wYdeT pUSYg2XS8bPCVmgjs4rVEjJEcXCpyTCOqqe6oUXyIBItCujTwKp2INaLdK0m/pUf zJgyT3uze5jKrKlsCWDbAgXoigrHAvNbb7YOR+yMYh50n9M4hOHDbBn3VbPUWjMk K+zLEh07ITk9D9IksCGvGacIMIJhCTFxmh0L+azrysOUCBzicvdIar7vfofbjV/t +ct7S8NTEYO/cBuf4CI4EKWAyGZSr+loGy9kfBeA+bT/Cf5AaCM= =oLJj -----END PGP SIGNATURE----- --LCIwYMzstikRFa/y-- --===============1608158093927311809== 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 --===============1608158093927311809==--