diff --git a/drivers/clk/qcom/clock-cpu-8994.c b/drivers/clk/qcom/clock-cpu-8994.c index 6eb346b75420..7928f2ec0caf 100644 --- a/drivers/clk/qcom/clock-cpu-8994.c +++ b/drivers/clk/qcom/clock-cpu-8994.c @@ -987,6 +987,8 @@ void sanity_check_clock_tree(u32 muxval, struct mux_clk *mux) case AUX_CLK_SEL: rate = sys_apcsaux_clk.c.rate; break; + default: + return; }; break; case PLL0_EARLY_SEL: @@ -997,6 +999,8 @@ void sanity_check_clock_tree(u32 muxval, struct mux_clk *mux) rate = readl_relaxed(base + C0_PLLA_L_VAL); rate *= xo_ao.c.rate; break; + default: + return; }; /* One regulator */ @@ -1556,7 +1560,7 @@ static void populate_opp_table(struct platform_device *pdev) struct platform_device *apc0_dev, *apc1_dev; struct device_node *apc0_node, *apc1_node; unsigned long apc0_fmax, apc1_fmax; - int cpu, a53_cpu, a57_cpu; + int cpu, a53_cpu = 0, a57_cpu = 0; apc0_node = of_parse_phandle(pdev->dev.of_node, "vdd-a53-supply", 0); apc1_node = of_parse_phandle(pdev->dev.of_node, "vdd-a57-supply", 0); @@ -1957,7 +1961,6 @@ static int cpu_clock_8994_driver_probe(struct platform_device *pdev) u64 pte_efuse; char a57speedbinstr[] = "qcom,a57-speedbinXX-vXX"; char a53speedbinstr[] = "qcom,a53-speedbinXX-vXX"; - v2 = msm8994_v2 | msm8992; a53_pll0_main.c.flags = CLKFLAG_NO_RATE_CACHE; @@ -1984,7 +1987,7 @@ static int cpu_clock_8994_driver_probe(struct platform_device *pdev) snprintf(a53speedbinstr, ARRAY_SIZE(a53speedbinstr), "qcom,a53-speedbin%d-v%d", a53speedbin, pvs_ver); - } else if (v2) + } else pte_efuse = readl_relaxed(vbases[EFUSE_BASE]); snprintf(a53speedbinstr, ARRAY_SIZE(a53speedbinstr), diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 76b3836acc4e..c5307105bdac 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -586,7 +586,7 @@ static void cpufreq_allstats_create(unsigned int cpu, static int cpufreq_stat_notifier_policy(struct notifier_block *nb, unsigned long val, void *data) { - int ret, count = 0, i; + int ret = 0, count = 0, i; struct cpufreq_policy *policy = data; struct cpufreq_frequency_table *table; unsigned int cpu_num, cpu = policy->cpu; diff --git a/drivers/input/touchscreen/synaptics_fw_update.c b/drivers/input/touchscreen/synaptics_fw_update.c index 3ceee2423697..80c7a93a84f0 100644 --- a/drivers/input/touchscreen/synaptics_fw_update.c +++ b/drivers/input/touchscreen/synaptics_fw_update.c @@ -2384,7 +2384,7 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data) fwu->ts_info = kzalloc(RMI4_INFO_MAX_LEN, GFP_KERNEL); if (!fwu->ts_info) { dev_err(&rmi4_data->i2c_client->dev, "Not enough memory\n"); - goto exit_free_ts_info; + goto exit_free_mem; } synaptics_rmi4_update_debug_info(); @@ -2398,7 +2398,6 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data) #endif return 0; -exit_free_ts_info: debugfs_remove(temp); exit_remove_attrs: for (attr_count--; attr_count >= 0; attr_count--) { diff --git a/drivers/power/qcom/debug_core.c b/drivers/power/qcom/debug_core.c index f0333cbcbf49..594055adb195 100644 --- a/drivers/power/qcom/debug_core.c +++ b/drivers/power/qcom/debug_core.c @@ -290,7 +290,7 @@ int msm_core_debug_init(void) msm_core_data = get_cpu_pwr_stats(); if (!msm_core_data) - goto fail; + return PTR_ERR(NULL); dir = debugfs_create_dir("msm_core", NULL); if (IS_ERR_OR_NULL(dir)) diff --git a/drivers/power/qcom/msm-core.c b/drivers/power/qcom/msm-core.c index ed7eb1a793e3..033c7f7beacd 100644 --- a/drivers/power/qcom/msm-core.c +++ b/drivers/power/qcom/msm-core.c @@ -347,10 +347,10 @@ static int update_userspace_power(struct sched_params __user *argp) { int i; int ret; - int cpu; struct cpu_activity_info *node; struct cpu_static_info *sp, *clear_sp; int cpumask, cluster, mpidr; + int cpu = num_possible_cpus(); get_user(cpumask, &argp->cpumask); get_user(cluster, &argp->cluster); diff --git a/drivers/power/qpnp-fg.c b/drivers/power/qpnp-fg.c index bd3bdc6ac734..6dd02330bd46 100644 --- a/drivers/power/qpnp-fg.c +++ b/drivers/power/qpnp-fg.c @@ -2449,9 +2449,7 @@ static int estimate_battery_age(struct fg_chip *chip, int *actual_capacity) } battery_soc = get_battery_soc_raw(chip) * 100 / FULL_PERCENT_3B; - if (rc) { - goto error_done; - } else if (battery_soc < 25 || battery_soc > 75) { + if (battery_soc < 25 || battery_soc > 75) { if (fg_debug_mask & FG_AGING) pr_info("Battery SoC (%d) out of range, aborting\n", (int)battery_soc); @@ -4401,6 +4399,7 @@ static int fg_batt_profile_init(struct fg_chip *chip) const char *data, *batt_type_str, *old_batt_type; bool tried_again = false, vbat_in_range, profiles_same; u8 reg = 0; + old_batt_type = default_batt_type; wait: fg_stay_awake(&chip->profile_wakeup_source); @@ -4428,7 +4427,6 @@ wait: fg_batt_type); if (!profile_node) { pr_err("couldn't find profile handle\n"); - old_batt_type = default_batt_type; rc = -ENODATA; goto fail; } @@ -5912,7 +5910,6 @@ static int fg_hw_init(struct fg_chip *chip) static int fg_setup_memif_offset(struct fg_chip *chip) { int rc; - u8 dig_major; rc = fg_read(chip, chip->revision, chip->mem_base + DIG_MINOR, 4); if (rc) { @@ -5930,7 +5927,7 @@ static int fg_setup_memif_offset(struct fg_chip *chip) chip->ima_supported = true; break; default: - pr_err("Digital Major rev=%d not supported\n", dig_major); + pr_err("Digital Major rev=%d not supported\n", chip->revision[DIG_MAJOR]); return -EINVAL; } diff --git a/drivers/power/qpnp-smbcharger.c b/drivers/power/qpnp-smbcharger.c index 5b7cbd4ff4af..9b782376ad8b 100644 --- a/drivers/power/qpnp-smbcharger.c +++ b/drivers/power/qpnp-smbcharger.c @@ -7592,6 +7592,8 @@ static int smbchg_probe(struct spmi_device *spmi) rc); return rc; } + } else { + vadc_dev = NULL; } if (of_find_property(spmi->dev.of_node, "qcom,vchg_sns-vadc", NULL)) { diff --git a/drivers/power/smb1351-charger.c b/drivers/power/smb1351-charger.c index 93fa303c276b..6ffc267f3dd6 100644 --- a/drivers/power/smb1351-charger.c +++ b/drivers/power/smb1351-charger.c @@ -1700,7 +1700,7 @@ static void smb1351_chg_ctrl_in_jeita(struct smb1351_charger *chip) static void smb1351_chg_adc_notification(enum qpnp_tm_state state, void *ctx) { struct smb1351_charger *chip = ctx; - struct battery_status *cur; + struct battery_status *cur = NULL; int temp; if (state >= ADC_TM_STATE_NUM) { @@ -1800,6 +1800,11 @@ static void smb1351_chg_adc_notification(enum qpnp_tm_state state, void *ctx) } } + if (!cur) { + pr_err("invalid transaction: state %d, temp %d\n", state, temp); + return; + } + if (cur->batt_present) chip->battery_missing = false; else diff --git a/drivers/soc/qcom/npa-dump.c b/drivers/soc/qcom/npa-dump.c index 2b8cb3ce0ccd..ef343f8721b2 100644 --- a/drivers/soc/qcom/npa-dump.c +++ b/drivers/soc/qcom/npa-dump.c @@ -155,7 +155,7 @@ static int npa_dump_probe(struct platform_device *pdev) struct resource *res; void __iomem *npa_base, *rpm_base; struct dentry *dent; - int ret; + int ret = 0; /* Get the location of the NPA log's start address offset */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); diff --git a/drivers/video/msm/mdss/mdss_mdp_intf_cmd.c b/drivers/video/msm/mdss/mdss_mdp_intf_cmd.c index f7152d14f4c2..d0767a21dd3b 100644 --- a/drivers/video/msm/mdss/mdss_mdp_intf_cmd.c +++ b/drivers/video/msm/mdss/mdss_mdp_intf_cmd.c @@ -1666,4 +1666,3 @@ int mdss_mdp_cmd_start(struct mdss_mdp_ctl *ctl) return 0; } - diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c index 1a04a15a290b..f295fbb1afbe 100644 --- a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c @@ -4337,10 +4337,10 @@ static int msm_routing_put_stereo_to_custom_stereo_control( int flag = 0, i = 0, rc = 0, idx = 0; int be_index = 0, port_id, topo_id; unsigned int session_id = 0; - uint16_t op_FL_ip_FL_weight; - uint16_t op_FL_ip_FR_weight; - uint16_t op_FR_ip_FL_weight; - uint16_t op_FR_ip_FR_weight; + uint16_t op_FL_ip_FL_weight = 0; + uint16_t op_FL_ip_FR_weight = 0; + uint16_t op_FR_ip_FL_weight = 0; + uint16_t op_FR_ip_FR_weight = 0; flag = ucontrol->value.integer.value[0]; pr_debug("%s E flag %d\n", __func__, flag);