Re: Diff: Function Length Reduction

2021-09-11 Thread Tom Cosgrove
For example, making it look something like this would be better static void inc_buf(SCR *sp, VICMD *vp) { CHAR_T v = vp->buffer; if (v < '1' || v > '8') return; VIP(sp)->sdot.buffer = vp->buffer = ++v; } Thanks Tom On 10/09/2021 22:24, Stuart Henderson wrote: On

Re: Remove dead assignment in login(1)

2018-08-07 Thread Tom Cosgrove
>>> Tom Cosgrove 7-Aug-18 20:14 >>> > > >>> Frederic Cambus 7-Aug-18 16:15 >>> > > > > Hi tech@, > > > > Since rev 1.36, the instance variable is never read again so we can > > simply drop the else clause with th

Re: Remove dead assignment in login(1)

2018-08-07 Thread Tom Cosgrove
>>> Frederic Cambus 7-Aug-18 16:15 >>> > > Hi tech@, > > Since rev 1.36, the instance variable is never read again so we can > simply drop the else clause with the assignment. > > Comments? OK? > > Index: usr.bin/login/login.c > == >

Re: signed overflow in atan2

2018-02-14 Thread Tom Cosgrove
>>> Eitan Adler 14-Feb-18 08:09 >>> > > Hi all, > > you may want the following patch. Previous discussion: > https://lists.freebsd.org/pipermail/freebsd-numerics/2018-February/thread.html > > Original submission: https://github.com/freebsd/freebsd/pull/130 > > > === > > As a component of atan2(y,

Re: Basic SHA3 support

2018-01-10 Thread Tom Cosgrove
>>> "Todd C. Miller" 10-Jan-18 16:28 >>> > > On Wed, 10 Jan 2018 15:59:30 +0100, Jeremie Courreges-Anglas wrote: > > > Do we really want these? For SHA-2, sha256 and sha512 are enough IMHO. > > Does anyone actually use the sha512 command? I'd be fine with > retiring the sha512 link and adding a

Re: [patch] Initialize "cur" to avoid undefined behavior is dmesg.c

2017-09-04 Thread Tom Cosgrove
> - free(allocated); > + if (allocated) > + free(allocated); This is unnecessary, since free(NULL) is clearly defined as a no-op. See the malloc(3) man page. Tom >>> Nan Xiao 4-Sep-17 12:11 >>> > > Hi tech@, > > This patch fixes the extreme case in dmesg.c: if memf or nlistf

Re: enum unsigned or not?

2017-08-31 Thread Tom Cosgrove
>>> patrick keshishian 31-Aug-17 20:40 >>> > > On Thu, Aug 31, 2017 at 12:13:19PM -0700, William Ahern wrote: > > On Thu, Aug 31, 2017 at 02:08:07PM +0200, Otto Moerbeek wrote: > > > Hi, > > > > > > /usr/src/usr.sbin/sasyncd/carp.c:157:12: warning: comparison of > > > unsigned enum expression < 0

Re: RFC 7217: random but stable addresses (take 2)

2017-07-15 Thread Tom Cosgrove
>>> Christian Weisgerber 14-Jul-17 23:04 >>> > > > secondly, im always wary of truncating hash output in case it throws > > away some of the guarantees it's supposed to provide. if you cut > > sha512 output down to an 8th of its size, is it 8 times easier to > > calculate a collision, or more than

Re: regarding OpenSSL License change

2017-03-26 Thread Tom Cosgrove
>>> Jimmy Hess 27-Mar-17 02:49 >>> : > silence does not generally grant permission. Since never grants permission. > But the people in that project might be able to convincingly deliver some > kind of argument that they've had implicit or "understood" permissions > made at time of

Re: arm cpu.h rev 1.44 broken

2017-03-03 Thread Tom Cosgrove
Fixed, thanks >>> Markus Hennecke 3-Mar-17 14:29 >>> > > There is a comma missing in rev 1.44: > > Index: cpu.h > === > RCS file: /cvs/src/sys/arch/arm/include/cpu.h,v > retrieving revision 1.44 > diff -u -p -r1.44 cpu.h > --- cpu.h

Re: Implement fork1_to_pid(). It's fork1(), but with pid as argument

2017-02-27 Thread Tom Cosgrove
>>> Philip Guenther 27-Feb-17 06:09 >>> : > I've now gone back and forth on this diff a few times. I like the > simplfication of allocpid(), but then it seems like deck-chair shuffling > as the test is just moved to another function. > > But eliminating the magic-at-a-distance randompid

Re: ocspcheck typos

2017-01-26 Thread Tom Cosgrove
>>> Jason McIntyre 26-Jan-17 23:00 >>> > > On Thu, Jan 26, 2017 at 11:15:05PM +0100, Holger Mikolon wrote: > > Hi, > > > > below are two minor typo fixes: s/OSCP/OCSP/ > > > > Holger > > ;-se > > fixed, thanks, plus one more in nc. > jmc There are also these in comments and warning messages.

Re: libcrypto: get rid of I386_ONLY

2016-11-04 Thread Tom Cosgrove
>>> Miod Vallat 4-Nov-16 08:53 >>> > > I386_ONLY was used to prefer a different assembler sequence in the > sha512 code, which would be faster on 80386 processors, but slower on > 80486 and above. > > This code path has never been enabled, and there are actually no plans > to make libcrypto

Re: mount(8): strlen + malloc + snprintf == asprintf

2016-09-05 Thread Tom Cosgrove
>>> Ali H. Fardan <r...@firemail.cc> 5-Sep-16 09:09 >>> > > On 2016-09-05 11:03, Tom Cosgrove wrote: > : > > It does allocate the correct buffer size. It's got all the > > information it needs to do that with the format string and the > >

Re: mount(8): strlen + malloc + snprintf == asprintf

2016-09-05 Thread Tom Cosgrove
>>> Ali H. Fardan 5-Sep-16 08:47 >>> > > On 2016-09-05 10:44, David Gwynne wrote: > >> On 5 Sep 2016, at 17:39, Ali H. Fardan wrote: > >> > >> and why is he telling me this? I just said if the destination is a > >> pointer to char, how would a function

Re: better return type for usqrt() in factor(6)

2016-09-01 Thread Tom Cosgrove
ok tom@ >>> Theo Buehler 1-Sep-16 06:36 >>> > > In factor(6), there is the line > > 216 stop = usqrt(val) + 1; > > where the u_int64_t stop is the upper bound for the sieve of > Eratosthenes (I cautiously added 1 to be sure to be on the safe side). > Unfortunately, the right hand side

Remove unused function ether_cmp() from smc91cxx.c

2016-07-13 Thread Tom Cosgrove
Index: sys/dev/ic/smc91cxx.c === RCS file: /home/OpenBSD/cvs/src/sys/dev/ic/smc91cxx.c,v retrieving revision 1.47 diff -u -p -r1.47 smc91cxx.c --- sys/dev/ic/smc91cxx.c 13 Apr 2016 10:49:26 - 1.47 +++

Unsigned variables can't be < 0

2016-07-12 Thread Tom Cosgrove
... and size_t is unsigned. Index: sys/dev/wscons/wsmouse.c === RCS file: /home/OpenBSD/cvs/src/sys/dev/wscons/wsmouse.c,v retrieving revision 1.31 diff -u -p -U8 -r1.31 wsmouse.c --- sys/dev/wscons/wsmouse.c5 Jul 2016 19:33:14

Re: Fix return value of OF_getprop() when name has a '@' in it

2016-06-14 Thread Tom Cosgrove
>>> Tom Cosgrove 12-Jun-16 22:05 >>> > > In OF_getprop(), if the "name" property doesn't exist it is synthesised > from the unit name. If that synthesised property has an "@" in it, we > truncate the name just before the "@", but we cur

Fix return value of OF_getprop() when name has a '@' in it

2016-06-13 Thread Tom Cosgrove
In OF_getprop(), if the "name" property doesn't exist it is synthesised from the unit name. If that synthesised property has an "@" in it, we truncate the name just before the "@", but we currently continue to return the full length of the unit name. This diff returns the length of the truncated

Fix typos in comments in amd64/stand

2016-06-10 Thread Tom Cosgrove
Thanks Tom Index: sys/arch/amd64/stand/efiboot/efiboot.c === RCS file: /home/OpenBSD/cvs/src/sys/arch/amd64/stand/efiboot/efiboot.c,v retrieving revision 1.12 diff -u -p -u -r1.12 efiboot.c ---

Fix typos in comments in i386/stand

2016-06-10 Thread Tom Cosgrove
Thanks Tom Index: sys/arch/i386/stand/libsa/apmprobe.c === RCS file: /home/OpenBSD/cvs/src/sys/arch/i386/stand/libsa/apmprobe.c,v retrieving revision 1.18 diff -u -p -u -r1.18 apmprobe.c --- sys/arch/i386/stand/libsa/apmprobe.c

Typo in comment in arm/undefined.c

2016-06-09 Thread Tom Cosgrove
Thanks Tom Index: sys/arch/arm/arm/undefined.c === RCS file: /home/OpenBSD/cvs/src/sys/arch/arm/arm/undefined.c,v retrieving revision 1.7 diff -u -p -u -r1.7 undefined.c --- sys/arch/arm/arm/undefined.c31 Jan 2016 00:14:50

Spelling correction for www/armv7.html

2016-06-09 Thread Tom Cosgrove
Thanks Tom Index: www/armv7.html === RCS file: /home/OpenBSD/cvs/www/armv7.html,v retrieving revision 1.26 diff -u -p -u -r1.26 armv7.html --- www/armv7.html 29 May 2016 14:44:33 - 1.26 +++ www/armv7.html 9 Jun

Update floppy58 and miniroot58 to *59.fs in www/

2016-06-09 Thread Tom Cosgrove
... to bring in line with sparc64.html (Didn't update vax.html as it's been discontinued) Thanks Tom Index: www/alpha.html === RCS file: /home/OpenBSD/cvs/www/alpha.html,v retrieving revision 1.276 diff -u -p -u -r1.276

No need to second guess SXIE_ROUNDUP

2016-06-08 Thread Tom Cosgrove
If (pktlen & 3) == 0, SXIE_ROUNDUP returns pktlen anyway (that's its job): it's defined as #define SXIE_ROUNDUP(size, unit) (((size) + (unit) - 1) & ~((unit) - 1)) Thanks Tom Index: sys/arch/armv7/sunxi/sxie.c === RCS file:

Uninitialised variable in sys/arch/armv7/exynos/crosec.c

2016-06-08 Thread Tom Cosgrove
Hi I can't test this :) but it might bite someone who was trying to hack in this area. Thanks Tom Index: sys/arch/armv7/exynos/crosec.c === RCS file: /home/OpenBSD/cvs/src/sys/arch/armv7/exynos/crosec.c,v retrieving revision 1.1

Re: 'continue' to appease style gods in i386,amd64 libsa

2016-06-08 Thread Tom Cosgrove
Hi > Two nits inline: Thanks for the feedback. Updated diff below. Tom >>> <pabl...@gmail.com> 8-Jun-16 11:52 >>> > > Hi Tom, > > Two nits inline: > > On Tue, Jun 7, 2016 at 9:47 PM, Tom Cosgrove > <tom.cosgr...@arches-consulti

Re: 'continue' to appease style gods in i386,amd64 libsa

2016-06-08 Thread Tom Cosgrove
>>> Tom Cosgrove 6-Jun-16 21:07 >>> > > As per subject, a couple of empty loop bodies in the i396 and amd64 boot > blocks. > > Diff below. > > Tom Subsequently found a few more, and a handful of trailing whitespaces. Updated diff below. Thanks To

Remove unused 'cpuprobe' from i386 bootblocks

2016-06-07 Thread Tom Cosgrove
/arch/i386/stand/libsa/cpuprobe.c --- sys/arch/i386/stand/libsa/cpuprobe.c29 Mar 2014 18:09:29 - 1.2 +++ /dev/null 1 Jan 1970 00:00:00 - @@ -1,147 +0,0 @@ -/* $OpenBSD: cpuprobe.c,v 1.2 2014/03/29 18:09:29 guenther Exp $ */ - -/* - * Copyright (c) 2004 Tom Cosgrove

'continue' to appease style gods in i386,amd64 libsa

2016-06-07 Thread Tom Cosgrove
As per subject, a couple of empty loop bodies in the i396 and amd64 boot blocks. Diff below. Tom Index: sys/arch/amd64/stand/libsa/biosdev.c === RCS file: /home/OpenBSD/cvs/src/sys/arch/amd64/stand/libsa/biosdev.c,v retrieving