Loading drivers/soc/qcom/llcc-slice.c +6 −2 Original line number Original line Diff line number Diff line Loading @@ -76,6 +76,7 @@ static struct llcc_slice_desc *llcc_slice_get_entry(struct device *dev, int n) const struct llcc_slice_config *llcc_data_ptr; const struct llcc_slice_config *llcc_data_ptr; struct llcc_slice_desc *desc; struct llcc_slice_desc *desc; struct platform_device *pdev; struct platform_device *pdev; u32 sz, count; if (of_parse_phandle_with_args(dev->of_node, "cache-slices", if (of_parse_phandle_with_args(dev->of_node, "cache-slices", "#cache-cells", n, &phargs)) { "#cache-cells", n, &phargs)) { Loading @@ -96,14 +97,17 @@ static struct llcc_slice_desc *llcc_slice_get_entry(struct device *dev, int n) } } llcc_data_ptr = drv->slice_data; llcc_data_ptr = drv->slice_data; sz = drv->llcc_config_data_sz; count = 0; while (llcc_data_ptr) { while (llcc_data_ptr && count < sz) { if (llcc_data_ptr->usecase_id == phargs.args[0]) if (llcc_data_ptr->usecase_id == phargs.args[0]) break; break; llcc_data_ptr++; llcc_data_ptr++; count++; } } if (llcc_data_ptr == NULL) { if (llcc_data_ptr == NULL || count == sz) { pr_err("can't find %d usecase id\n", phargs.args[0]); pr_err("can't find %d usecase id\n", phargs.args[0]); return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV); } } Loading Loading
drivers/soc/qcom/llcc-slice.c +6 −2 Original line number Original line Diff line number Diff line Loading @@ -76,6 +76,7 @@ static struct llcc_slice_desc *llcc_slice_get_entry(struct device *dev, int n) const struct llcc_slice_config *llcc_data_ptr; const struct llcc_slice_config *llcc_data_ptr; struct llcc_slice_desc *desc; struct llcc_slice_desc *desc; struct platform_device *pdev; struct platform_device *pdev; u32 sz, count; if (of_parse_phandle_with_args(dev->of_node, "cache-slices", if (of_parse_phandle_with_args(dev->of_node, "cache-slices", "#cache-cells", n, &phargs)) { "#cache-cells", n, &phargs)) { Loading @@ -96,14 +97,17 @@ static struct llcc_slice_desc *llcc_slice_get_entry(struct device *dev, int n) } } llcc_data_ptr = drv->slice_data; llcc_data_ptr = drv->slice_data; sz = drv->llcc_config_data_sz; count = 0; while (llcc_data_ptr) { while (llcc_data_ptr && count < sz) { if (llcc_data_ptr->usecase_id == phargs.args[0]) if (llcc_data_ptr->usecase_id == phargs.args[0]) break; break; llcc_data_ptr++; llcc_data_ptr++; count++; } } if (llcc_data_ptr == NULL) { if (llcc_data_ptr == NULL || count == sz) { pr_err("can't find %d usecase id\n", phargs.args[0]); pr_err("can't find %d usecase id\n", phargs.args[0]); return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV); } } Loading