Rajaram-Regupathy / libtypec

“libtypec” is aimed to provide a generic interface abstracting all platform complexity for user space to develop tools for efficient USB-C port management. The library can also enable development of diagnostic and debug tools to debug system issues around USB-C/USB PD topology.
34 stars 4 forks source link

missing return value in function libtypec_dbgfs_get_conn_capability_ops #20

Closed ColinIanKing closed 12 months ago

ColinIanKing commented 1 year ago

The function is not explicitly returning an int value. Should it be returning ret?

static int libtypec_dbgfs_get_conn_capability_ops(int conn_num, struct libtypec_connector_cap_data *conn_cap_data)
{
    int ret=-1;
        unsigned char buf[64];

    if(fp_command > 0)
    {
                snprintf(buf, sizeof(buf), "%d", (conn_num+1)<<16|7);

        ret = write(fp_command,buf,sizeof(buf));

        if(ret)
        {
            ret = get_ucsi_response(buf);
            if(ret<31)
                ret = -1;
                        conn_cap_data->opr_mode = buf[28] << 12 | buf[29] <<8 | buf[30] << 4 | buf[31];
                }
        }
}

return ret; missing?

Rajaram-Regupathy commented 12 months ago

resolved