Date: Mon, 21 Jul 1997 14:14:39 +0930 (CST) From: Michael Smith <msmith@atrad.adelaide.edu.au> To: skynyrd@opus.cts.cwu.edu (Chris Timmons) Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: suggested enhancement: linux_ioctl.c diagnostic output Message-ID: <199707210444.OAA21177@genesis.atrad.adelaide.edu.au> In-Reply-To: <Pine.BSF.3.95.970720102920.26163B-100000@opus.cts.cwu.edu> from Chris Timmons at "Jul 20, 97 10:46:36 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Chris Timmons stands accused of saying: > > I tried to get some comments about this from -emulation but perhaps the > subject line wasn't to the point enough. It was; you're just buried in my to-do list 8( > If you read down to the end I've sketched out a proposed change to > linux_ioctl.c. I'd like to know: > > 1. Overall is this a worthwile change? Yes. > 2. Is the long comment which documents linux ioctl encoding > inappropriate for this source file? No. > 3. I see from style(9) that I should have spaces between the > operands to the bitwise and operator. What about the > style of the nested conditional? I guess there might also be > some unnecessary parens in the printf argument list. Bruce will have his own interpretation; I would be inclined to say : uprintf("LINUX: unimplemented ioctl: fd=%d, cmd=0x%lx (IO%s%s, '%c', %lu, %lu)\n", args->fd, args->cmd, (args->cmd & 0x400000000) ? "W" : "", (args->cmd & 0x800000000) ? "R" : "", ((args->cmd & 0x0000ff00) >> 8) >= 0x20) ? (char)((args->cmd & 0x0000ff00)>>8) : '?', args->cmd & 0xff, (args->cmd & 0x3fff0000) >> 16); return EINVAL; } The other implementation of the IO[WR] decoding I would consider would use a small lookup table and a large shift to generate an index. The massively nested ? set you used makes for very difficult reading. I don't think that the performance of the printf() should be a consideration in contrast to the usefulness of verbose output. -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707210444.OAA21177>