On Fri, 1 Dec 2006 22:39:21 -0600
Corey Minyard <[EMAIL PROTECTED]> wrote:

> 
> The IPMI BT subdriver has been patched to survive "long busy"
> timeouts seen during firmware upgrades and resets.  The patch
> never returns the HOSED state, synthesizes response messages with
> meaningful completion codes, and recovers gracefully when the
> hardware finishes the long busy.  The subdriver now issues a "Get BT
> Capabilities" command and properly uses those results.
> More informative completion codes are returned on error from
> transaction starts; this logic was propogated to the KCS and
> SMIC subdrivers.  Finally, indent and other style quirks were
> normalized.
> 
> ...
>
> +     BT_CONTROL(BT_CLR_WR_PTR);      /* always reset */

argh.

#define BT_STATUS       bt->io->inputb(bt->io, 0)
#define BT_CONTROL(x)   bt->io->outputb(bt->io, 0, x)

#define BMC2HOST        bt->io->inputb(bt->io, 1)
#define HOST2BMC(x)     bt->io->outputb(bt->io, 1, x)

#define BT_INTMASK_R    bt->io->inputb(bt->io, 2)
#define BT_INTMASK_W(x) bt->io->outputb(bt->io, 2, x)

Please don't write macros which require that the caller have a particular
local variable of a particular name.

In fact, please don't write macros.

All the above would be perfectly nice as

static inline void bt_control(struct si_sm_data *bt, int val)
{
        bt->io->outputb(bt->io, val);
}



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to