alpine 3.6
obsolete weakness #28

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

xf86-video-ast/src/xf86-video-ast-1.1.5/src/ast_mode.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.6 obsolete weakness.

 }

static UCHAR GetChrontelReg(ASTRecPtr pAST, UCHAR jChannel, UCHAR jIndex)
{
    ULONG ulData, ulI2CAddr, ulI2CPortBase;
    UCHAR jData;
    ULONG retry;

    {
        ulI2CPortBase = I2C_BASE_AST1180 + 0x40 * jChannel;
        ulI2CAddr = I2C_DEVICEADDR_AST1180;
    }

    WriteAST1180SOC(ulI2CPortBase + 0x00, 0x00);
    WriteAST1180SOC(ulI2CPortBase + 0x04, 0x77743355);
    WriteAST1180SOC(ulI2CPortBase + 0x08, 0x0);
    WriteAST1180SOC(ulI2CPortBase + 0x10, 0xffffffff);
    WriteAST1180SOC(ulI2CPortBase + 0x00, 0x1);
    WriteAST1180SOC(ulI2CPortBase + 0x0C, 0xAF);
    WriteAST1180SOC(ulI2CPortBase + 0x20, ulI2CAddr);
    WriteAST1180SOC(ulI2CPortBase + 0x14, 0x03);
    retry = 0;
    do {
        ReadAST1180SOC(ulI2CPortBase + 0x10, ulData);
        usleep(10);
        if (retry++ > 1000)
            return 0;
    } while (!(ulData & 0x01));

    WriteAST1180SOC(ulI2CPortBase + 0x10, 0xffffffff);
    WriteAST1180SOC(ulI2CPortBase + 0x20, (ULONG) jIndex);
    WriteAST1180SOC(ulI2CPortBase + 0x14, 0x02);
    do {
        ReadAST1180SOC(ulI2CPortBase + 0x10, ulData);
     } while (!(ulData & 0x01));

    WriteAST1180SOC(ulI2CPortBase + 0x10, 0xffffffff);
    WriteAST1180SOC(ulI2CPortBase + 0x20, (ULONG) (ulI2CAddr + 1) );
    WriteAST1180SOC(ulI2CPortBase + 0x14, 0x1B);
    do {
        ReadAST1180SOC(ulI2CPortBase + 0x10, ulData);
     } while (!(ulData & 0x04));

    WriteAST1180SOC(ulI2CPortBase + 0x10, 0xffffffff);
    WriteAST1180SOC(ulI2CPortBase + 0x0C, 0xBF);
    WriteAST1180SOC(ulI2CPortBase + 0x14, 0x20);
    do {
        ReadAST1180SOC(ulI2CPortBase + 0x10, ulData);
    } while (!(ulData & 0x10));
 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.