Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2392938ybv; Mon, 24 Feb 2020 04:31:44 -0800 (PST) X-Google-Smtp-Source: APXvYqw/wgE78UiqiHdD+Fn6roa+i03dAvuwb68n3/UtEvJcsZa2lvzoNuRApZf6OSrk0L1tdbYj X-Received: by 2002:aca:56d1:: with SMTP id k200mr12028733oib.25.1582547504518; Mon, 24 Feb 2020 04:31:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582547504; cv=none; d=google.com; s=arc-20160816; b=bYlEkmZybxWsnyuOZODT7AzYPlps4LrNSMJuB2G6y17JzHTxYWaMjDmMtvt6BmC7P7 m+NHP3gXyseIscC55QigqlhLVAOfw9ovcvsY8ym1sOxS8O1cQDuNhvAUOLXDiPClrGnY 84jSsDMm4oGcJO016k71oMbZ8nw+0lZ1ZQSJA5FZpIAKWkC5wQsIK1FZtOyye/aelQWf 025wDmSDA634txXj32N0leDiCbIfKLyBGYpHCyrjv9FuBImEzk6LNd2V91/OEDE0AqBW 7X4NRFENyqbPTPxG1d6NkX5mBW3RZN0Bl8GfpknBX5qARatIen1xOEkNC1J3ajMPqoJT BctA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/dNA8kAzClaavMgj21dSpT8ieHWkrIRvjA5TOlTc28o=; b=mokrnc2Wh46AlhiQ9vdol9QlXobACh0nD/8NNuJ22eSz9Dfs+/Jj4JgIUMNa02xK3k rYalTdIhqcSTysvyAtHoIlZ+IHidr3xaWe0+IL/chuecGyxafIKTke16zO+yvCNDfPaS km3BDPraQ2Z6bqNtomPxP/+sj7yK7+QvnaVTPdXuhLLSNUJmEawHNXbviZ7p5mXJU2Bu l6Lbuk+xP7+FnkhQsvH62DoggJFf1FqrJXjZzhvsIkbrJr/leATXa3VGwTLzKqXBDIgG F+ImnSf78SoBL9RAAODgUeaSacv2AP+HEyNX70TOg3D0TvZ4hZtDPsdubApfr0u34M2Y 0zcg== 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k125si5173812oib.212.2020.02.24.04.31.30; Mon, 24 Feb 2020 04:31:44 -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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727339AbgBXMbZ (ORCPT + 99 others); Mon, 24 Feb 2020 07:31:25 -0500 Received: from foss.arm.com ([217.140.110.172]:36478 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbgBXMbZ (ORCPT ); Mon, 24 Feb 2020 07:31:25 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C6B8A30E; Mon, 24 Feb 2020 04:31:24 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4B2C93F534; Mon, 24 Feb 2020 04:31:24 -0800 (PST) Date: Mon, 24 Feb 2020 12:31:22 +0000 From: Mark Brown To: "H. Nikolaus Schaller" Cc: Andreas Kemnade , j.neuschaefer@gmx.net, contact@paulk.fr, GNUtoo@cyberdimension.org, josua.mayer@jm0.eu, lgirdwood@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] regulator: core: fix handling negative voltages e.g. in EPD PMICs Message-ID: <20200224123122.GH6215@sirena.org.uk> References: <20200223153502.15306-1-andreas@kemnade.info> <20200224120512.GG6215@sirena.org.uk> <1548203B-9D64-4128-9BED-D3BC30F9DC49@goldelico.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="X1xGqyAVbSpAWs5A" Content-Disposition: inline In-Reply-To: <1548203B-9D64-4128-9BED-D3BC30F9DC49@goldelico.com> X-Cookie: How you look depends on where you go. 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 --X1xGqyAVbSpAWs5A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 24, 2020 at 01:22:21PM +0100, H. Nikolaus Schaller wrote: > > Am 24.02.2020 um 13:05 schrieb Mark Brown : > > This is what'd be needed, your approach here is a bit of a hack and > > leaves some values unrepresentable if they overlap with errnos which > > obviously has issues if someone has a need for those values. > Negative ERRNOs have BIT(31) set. This code is working with the numberic representation, not with the bitwise representation - it's using -MAX_ERRNO. =20 > But then it seems to be a little inconsistent that the voltage > parameters of regulator_set_voltage_unlocked() are signed integers > and not unsigned. > So shouldn't that be protected against attempting to set negative voltage= s? Or just convert it to unsigned, I don't recall there being any particular reason why it's signed. --X1xGqyAVbSpAWs5A Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl5TwhoACgkQJNaLcl1U h9B1IAf/bzn84Uy6Bu9ClVtEYIjBmXCGq7OXxfeMu26eU/ISxWvDeS+0uCXCuCR1 2MmGJxh0llTRdUsDFbuwe+OT5UcKwqmo4sihpXPPn35v9VsiBsIu4hIBu4foFuQh a5vNLVGJ1wx0KHiwFrn/8hqFYZ2JGmOBVF6SWxhCMlvsr3Cuw+QGAM0//38Prrwl oXTzv48sWaFCFs6829R99KbSykCnvTTa5zsNS683vLEcxpTb7jbL5r1ylTcC1PcK 7zJjYTgiMw87uSeEoc3nvR9lpP0FNga4yKoABbv+y8Oiyc5r7bJpCgzGTqvlsHON LA04m9mKcjXyBzj0Et2Tk+qj+CElOQ== =Izqs -----END PGP SIGNATURE----- --X1xGqyAVbSpAWs5A--