NetBSD-Bugs archive

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

kern/41011: Useless code in arch/i386/stand/lib/conio.S

>Number:         41011
>Category:       kern
>Synopsis:       Useless code in  arch/i386/stand/lib/conio.S
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 14 08:30:00 +0000 2009
>Originator:     Gao Ya'nan
>Release:        NetBSD-current and NetBSD-4.0
NetBSD 4.0 NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:20:10 PST 
In arch/i386/stand/lib/conio.S, the function conclr is below:

        ... ...

        movb    8(%ebp),%cl

        call    _C_LABEL(prot_to_real)  # enter real mode

        /* Clear screen. */
        movw    $0x0600, %ax
        movw    $0x0700, %bx
        xorw    %cx, %cx
        movw    $0x184f, %dx    /* 80x25 */
        int     $0x10

        /* Home cursor. */
        movb    $0x02, %ah
        xorw    %bx, %bx
        xorw    %dx, %dx
        int     $0x10

        ... ...

Before calling prot_to_real, we move a byte to CL register from stack, but 
actually we don't employ CL register and clear CX register immediately.

And I guess the code was from the function conputc without delete the useless 
Review the code
Delete the useless code

Home | Main Index | Thread Index | Old Index