public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Dalecki <dalecki@evision-ventures.com>
To: Oliver Xymoron <oxymoron@waste.org>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Pavel Machek <pavel@ucw.cz>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.10 IDE 42
Date: Sat, 27 Apr 2002 00:25:48 +0200	[thread overview]
Message-ID: <3CC9D3EC.80504@evision-ventures.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0204261454440.30456-100000@waste.org>

>>Somewhat agreed. Also, the above is just not the right way to do
>>printouts.
>>
>>I'd suggest rewriting the whole big mess as something like
>>
>>	#define STAT_STR(x,s) \
>>		((stat & x ##_STAT) ? s " " : "")
>>
>>	...
>>
>>	printf("IDE: %s%s%s%s%s%s..\n"
>>		STAT_STR(READY, "DriveReady"),
>>		STAT_STR(WERR, "DeviceFault"),
>>		...
> 
> 
> I'd go even further and suggest that pulling the mapping from a mask or
> key to string out into a table and looping through it is preferable for
> this sort of thing. You win later if you decide you need the same mapping
> elsewhere or if you want to format your messages differently, add bits to
> it, etc. Tables are generally easier to inspect for errors than code,
> although Linus' version is very nearly a table.
> 
> Maintaining tables as code is a pain and is generally only a win for
> small or sparse state machines.


Once could have a look at the ll_rw_blk.c file. There is
a function there, which is dissecting the differnt request
attributes, which are stored as bitfields there.


  parent reply	other threads:[~2002-04-26 23:28 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-23  8:18 2.5.9 -- OOPS in IDE code (symbolic dump and boot log included) Miles Lane
2002-04-23  8:00 ` Martin Dalecki
2002-04-23  9:18   ` Jens Axboe
2002-04-23  8:43     ` Martin Dalecki
2002-04-23  9:54       ` Jens Axboe
2002-04-23 17:39   ` Miles Lane
2002-04-23 17:54     ` Miles Lane
2002-04-24  8:06       ` Martin Dalecki
2002-04-24  9:11         ` Jens Axboe
2002-04-24  8:20           ` Martin Dalecki
2002-04-25 11:07           ` Martin Dalecki
2002-04-25 17:25             ` Jens Axboe
2002-04-25 17:34               ` Jens Axboe
2002-04-25 21:02                 ` Linus Torvalds
2002-04-26  7:33                   ` [PATCH] 2.5.10 UTS_VERSION Martin Dalecki
2002-04-26  9:52                     ` Keith Owens
2002-04-26  8:58                       ` Martin Dalecki
2002-04-26  7:41                   ` [PATCH] 2.5.10 IDE 42 Martin Dalecki
2002-04-26 16:09                     ` Pavel Machek
2002-04-26 17:31                       ` Dave Jones
2002-04-26 17:37                       ` Linus Torvalds
2002-04-26 20:05                         ` Oliver Xymoron
2002-04-26 21:34                           ` Martin Dalecki
2002-04-26 22:25                           ` Martin Dalecki [this message]
2002-04-26 21:32                         ` Martin Dalecki
2002-04-26 23:21                           ` Rene Rebe
2002-04-26 21:42                       ` Martin Dalecki
2002-04-26 16:10                     ` Sebastian Droege
2002-04-26 21:28                       ` Martin Dalecki
2002-04-26 22:44                         ` Padraig Brady
2002-04-28  9:18                           ` Kai Henningsen
2002-05-05 15:54                   ` [PATCH] 2.5.13 IDE 52 Martin Dalecki
2002-05-05 17:09                     ` Jens Axboe
2002-05-05 16:16                       ` Martin Dalecki
2002-05-05 15:55                   ` [PATCH] 2.5.13 IDE 53 Martin Dalecki
2002-05-06  9:53                     ` Russell King
2002-05-06  8:55                       ` Martin Dalecki
2002-05-06 23:48                         ` jw schultz
2002-05-05 15:56                   ` [PATCH 2.5.13 IDE 54 Martin Dalecki
2002-05-07 12:52                     ` Paul Mackerras
2002-05-07 12:06                       ` Martin Dalecki
2002-05-07 14:40                         ` benh
2002-05-07 13:40                           ` Martin Dalecki
2002-05-07 15:18                             ` benh
2002-05-07 14:07                       ` Alan Cox
2002-05-07 13:24                         ` Martin Dalecki
2002-04-24  9:29         ` 2.5.9 -- OOPS in IDE code (symbolic dump and boot log included) Luigi Genoni
2002-04-23 18:23   ` Melchior FRANZ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CC9D3EC.80504@evision-ventures.com \
    --to=dalecki@evision-ventures.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oxymoron@waste.org \
    --cc=pavel@ucw.cz \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox