driver/hwtracing: use ERR_CAST instead of ERR_PTR
PATCH 1/1 driver/hwtracing: use ERR_CAST instead of ERR_PTR
Use ERR_CAT inlined function to replace the ERR_PTR(PTR_ERR). It make the code more concise.
Signed-off-by zhong jiang <[email protected]>
--- drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-tmc-etr.c +1 -1
@@ -536,7 +536,7 @@ static void tmc_etr_sg_table_populate(struct etr_sg_table *etr_table) sg_table =tmc_alloc_sg_table (dev, node, nr_tpages, nr_dpages, pages);if (IS_ERR (sg_table)) {kfree (etr_table); -return ERR_PTR (PTR_ERR (sg_table)); +return ERR_CAST (sg_table); } etr_table->sg_table = sg_table;
Signature · 1 line
1.7.12.4
Quoted 14 lines · zhong jiang
Use
ERR_CATinlined function to replace theERR_PTR(PTR_ERR). It make the code more concise.Signed-off-by zhong jiang <[email protected]>--- drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwtracing/coresight/coresight-tmc-etr.c +0
-0
drivers/hwtracing/coresight/coresight-tmc-etr.c static void tmc_etr_sg_table_populate(struct etr_sg_table *etr_table) · line 539
Quoted 5 lines
drivers/hwtracing/coresight/coresight-tmc-etr.c +1
-1@@ -536,7 +536,7 @@ static void tmc_etr_sg_table_populate(struct etr_sg_table *etr_table) sg_table =tmc_alloc_sg_table (dev, node, nr_tpages, nr_dpages, pages);if (IS_ERR (sg_table)) {kfree (etr_table); -return ERR_PTR (PTR_ERR (sg_table)); +return ERR_CAST (sg_table);
Applied - thanks.
Mathieu
Quoted 6 lines
drivers/hwtracing/coresight/coresight-tmc-etr.c +0
-1} etr_table->sg_table = sg_table; --1.7.12.4