GCC 5错误,可能未初始化使用

时间:2015-08-01 05:15:19

标签: gcc gcc-warning

如何在此结构中初始化ua?

static int clk_init_vdd_class(struct device *dev, struct clk *clk, int num,
             unsigned long *fmax, int *uv, int *ua)

Here is is rest of code, krait-8974.c

1 个答案:

答案 0 :(得分:0)

找到答案, 第#683行 通过添加

进行编辑
int *uv = 0, *ua = 0;

这是完整的代码

    static int
clock_krait_8974_driver_probe(struct platform_device *pdev)
    {
    struct device *dev = &pdev->dev;
    struct clk *c;
    int speed, pvs, pvs_ver, config_ver, rows, cpu;
    unsigned long *freq, cur_rate, aux_rate;
    int *uv = 0, *ua = 0;
    u32 *dscr = NULL, vco_mask, config_val;
    int ret;

    vdd_l2.regulator[0] = devm_regulator_get(dev, "l2-dig");
    if (IS_ERR(vdd_l2.regulator[0])) {
        dev_err(dev, "Unable to get l2-dig regulator!\n");
        return PTR_ERR(vdd_l2.regulator[0]);
    }