From nobody Mon Oct 25 21:26:51 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4221B182BCD0 for ; Mon, 25 Oct 2021 21:27:00 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5c.ore.mailhop.org (outbound5c.ore.mailhop.org [54.244.192.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HdShM6Tnlz3k77 for ; Mon, 25 Oct 2021 21:26:59 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1635197213; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=tnQk8L4OsEtC1u9QHDICCqQSuaOPEn9uYE3S9QeBXW27laPSYkeZ2AEFBxJUTq4RyaYJjB8tcC8qR CJjaENjZGSlwUN/5rc+Q+uI5QVvAJW1SYYDsBJ4XuQB98PyNdNg4kn4WzNfpUfo06vf4iPCfsl9uJk LSodOkS4Z25u4QRx+/NQ2gmbwH2nWZzwGdRpIGyHmK7Vvuw3m/qiQP1pRUeFgK4WwinOWOKT4lNaDi YsyPsmB1Qa6I2OGe89BVB3iaU6/Jgu4gV9EVD2UgBWBNwP6nOZG+rPWy5FFFPXCuCRyYHw297wv845 m78qfLgz9lIxEjyuEUEsJ2DSjzb6Cug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=QV21owQ4ug0Hov0jVReRoF7b4Mgbce/2wFhgiHODKH4=; b=ByOEcmPIlNLOL00dildn31m36oMHA9zAlqERQiR+ZR/3iFab+jMhcOoJXbS2GB5VuAU715Osf4zvt AxMIzbpuAcciMuwdq4vlyBaaetcUShThl/89HP9ZWWXEjnjJCdoBXFoY4o6qArpWksi9reETxEX/Vu +gjR1Oo6a9eQL2yU6Cb/80Co2eMEZMLBQjy2pKsR2zlqMgtoW2hVhWakXj61+BOuY/p2x/nCoD/EC9 ILbPZBf00GAHMYLfklsZi7BCcyBHM00otVw678n9VpHRlZthSzezp58ZdMzgtsTRsvuIvj8qhRGw4g gybQVVHceRy79tQA6vWCBejk/W6/X6w== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=24.8.225.114; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=QV21owQ4ug0Hov0jVReRoF7b4Mgbce/2wFhgiHODKH4=; b=EwTBLu0Qx+f6P/TYrePDetIBMp4OuIbZkYCj1jIXZN8SWGXkLAX82ajDqCGY311X8Gpn6rYEPKyeX WMCPdCpP0ifSg1md60292YBXQ9+IY+QBUD43uZ7FeZaRrw0j+850GmaFYBC1VJ/UOVcYoEdt+Z8au6 i/XLacL7GJ+pAG73agweZ2iw9qr82APpo6+Ee7V/buuAJegNYceBu6/qWgMwH+e50D0vQn8uRnsak6 qaBlHXnS6P2mCM3VCxfIky4uoB/oCkE2rmYjoF1deqV56+elgPIg6KhJcFa3Vfly2env+lTg3TYMfP yvDApul/Fv+3gxhadx0pjoaPBktLNew== X-Originating-IP: 24.8.225.114 X-MHO-RoutePath: aGlwcGll X-MHO-User: 44e8e02d-35da-11ec-9f98-bf9d68d023b6 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-24-8-225-114.hsd1.co.comcast.net [24.8.225.114]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 44e8e02d-35da-11ec-9f98-bf9d68d023b6; Mon, 25 Oct 2021 21:26:52 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 19PLQpHV097789; Mon, 25 Oct 2021 15:26:51 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: <845d99d8f7c189418b36a832017518c493af729b.camel@freebsd.org> Subject: Re: git: 548ada00e54a - main - LinuxKPI: add bcd.h From: Ian Lepore To: "Bjoern A. Zeeb" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Date: Mon, 25 Oct 2021 15:26:51 -0600 In-Reply-To: References: <202110252023.19PKNSRO031788@gitrepo.freebsd.org> <832a2403091df094d6f7ab471aef0694adebb939.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HdShM6Tnlz3k77 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, 2021-10-25 at 21:17 +0000, Bjoern A. Zeeb wrote: > On Mon, 25 Oct 2021, Ian Lepore wrote: > > > On Mon, 2021-10-25 at 20:23 +0000, Bjoern A. Zeeb wrote: > > > The branch main has been updated by bz: > > > > > > URL: > > > https://cgit.FreeBSD.org/src/commit/?id=548ada00e54a9e7745d041b1ec7f68f3bd493365 > > > > > > commit 548ada00e54a9e7745d041b1ec7f68f3bd493365 > > > Author:     Bjoern A. Zeeb > > > AuthorDate: 2021-10-25 18:14:08 +0000 > > > Commit:     Bjoern A. Zeeb > > > CommitDate: 2021-10-25 20:20:53 +0000 > > > > > >     LinuxKPI: add bcd.h > > >     > > >     Add bcd2bin() as linuxkpi_bcd2bin().  Libkern does provide a > > > bcd2bin() > > > > > > [...] > > > + * We could use libkern, but we need the argument truncating. > > > + * > > > > > > What does that mean, "we need the argument truncating"? > > This one takes an uint8_t as argument. > > If my memory serves me correctly the Linux driver code through > macros passes in larger values 0xabcdxx which are truncated by > the argument type. > > We take an int and then have a KASSERT() which doesn't work so well > for these larger values. > > /bz > > -- > Bjoern A. Zeeb                                                     > r15:7 I had forgotten that we added a KASSERT a few years ago. But we don't expect linux to be relying on getting bad answers in response to bad inputs, do we? I wonder why we can't just change the prototype of our inline function from int to uint8_t and remove the >= 0 part from the assert? -- Ian