Search code examples
gccgcc-warning

GCC 5 error, maybe used uninitialized


How do I initialize ua in this struct?

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


Solution

  • Found answer, Line # 683 Edited by adding

    int *uv = 0, *ua = 0;
    

    Here is full code

        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]);
        }