From owner-freebsd-bugs Mon Oct 21 12:41:41 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA06192 for bugs-outgoing; Mon, 21 Oct 1996 12:41:41 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id MAA06187 for ; Mon, 21 Oct 1996 12:41:38 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id FAA26416; Tue, 22 Oct 1996 05:37:19 +1000 Date: Tue, 22 Oct 1996 05:37:19 +1000 From: Bruce Evans Message-Id: <199610211937.FAA26416@godzilla.zeta.org.au> To: bugs@freebsd.org, hosokawa@mt.cs.keio.ac.jp Subject: Re: type of dk_flags (wd.c) should be longer Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >In sys/i386/isa/wd.c: > > short dk_flags; /* drive characteristics found */ >#define DKFL_SINGLE 0x00004 /* sector at a time mode */ >#define DKFL_ERROR 0x00008 /* processing a disk error */ >#define DKFL_LABELLING 0x00080 /* readdisklabel() in progress */ >#define DKFL_32BIT 0x00100 /* use 32-bit i/o mode */ >#define DKFL_MULTI 0x00200 /* use multi-i/o mode */ >#define DKFL_BADSCAN 0x00400 /* report all errors */ > >It seems bit operation to dk_flags results in invalid behavior. I >think that the type of dk_flags should be longer (ex. long). Erm, 0x400 fits in only 11 bits. Perhaps dk_flags should be `int' since accesses to shorts are slow. It doesn't matter much, because most accesses are optimized to byte accesses (and those that aren't are pessimizations - (du->dk_flags & BIT) is optimized to a testb inctruction, and (du->dk_flags |= BIT) is pessimized to an orw instruction). Bruce