mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 14:43:16 +00:00
coresight: cti: Reduce scope for the variable 'cs_fwnode' in cti_plat_create_connection()
A local variable was used only within an else branch. Thus move the definition for the variable “cs_fwnode” into the corresponding code block. This issue was detected by using the Coccinelle software. Link: https://lore.kernel.org/r/c1b09b27-9012-324f-28d0-ba820dc468a5@web.de Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20210201181351.1475223-2-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
11a0b5e0ec
commit
65b2728145
@ -343,7 +343,6 @@ static int cti_plat_create_connection(struct device *dev,
|
|||||||
{
|
{
|
||||||
struct cti_trig_con *tc = NULL;
|
struct cti_trig_con *tc = NULL;
|
||||||
int cpuid = -1, err = 0;
|
int cpuid = -1, err = 0;
|
||||||
struct fwnode_handle *cs_fwnode = NULL;
|
|
||||||
struct coresight_device *csdev = NULL;
|
struct coresight_device *csdev = NULL;
|
||||||
const char *assoc_name = "unknown";
|
const char *assoc_name = "unknown";
|
||||||
char cpu_name_str[16];
|
char cpu_name_str[16];
|
||||||
@ -397,8 +396,9 @@ static int cti_plat_create_connection(struct device *dev,
|
|||||||
assoc_name = cpu_name_str;
|
assoc_name = cpu_name_str;
|
||||||
} else {
|
} else {
|
||||||
/* associated device ? */
|
/* associated device ? */
|
||||||
cs_fwnode = fwnode_find_reference(fwnode,
|
struct fwnode_handle *cs_fwnode = fwnode_find_reference(fwnode,
|
||||||
CTI_DT_CSDEV_ASSOC, 0);
|
CTI_DT_CSDEV_ASSOC,
|
||||||
|
0);
|
||||||
if (!IS_ERR(cs_fwnode)) {
|
if (!IS_ERR(cs_fwnode)) {
|
||||||
assoc_name = cti_plat_get_csdev_or_node_name(cs_fwnode,
|
assoc_name = cti_plat_get_csdev_or_node_name(cs_fwnode,
|
||||||
&csdev);
|
&csdev);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user