qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] FDC: simplify code [v3]


From: Hervé Poussineau
Subject: Re: [Qemu-devel] [PATCH] FDC: simplify code [v3]
Date: Wed, 09 Apr 2008 08:11:13 +0200
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)

Fabrice Bellard a écrit :
Hervé Poussineau wrote:
Hi,

Attached patch prevents duplication of quite similar code in fdc.c, and
so, removes 300 lines and 8KB of code.
It first extracts implementation of FDC commands to separate methods,
and then uses a table to know which method to execute instead of a big
switch.

This version is quite similar to v1 (I removed the lookup table added in
v2), except that I tried to minimize the time spent to search in the
command table by putting most used commands at the beginning. I don't
have any statistics to proove the order, that's only observation and
guess...

A lookup table could be generated dynamically from your table by using a
few lines of code... You current solution is very slow, but you are
saved by the fact that the FDC speed is not critical anyway.

Thanks for the idea. I'll submit a patch for this later.

Hervé




reply via email to

[Prev in Thread] Current Thread [Next in Thread]