From: Julia Lawall Date: Sat, 14 Aug 2010 19:08:47 +0000 (+0200) Subject: hwmon: (k8temp) Adjust confusing if indentation X-Git-Tag: v2.6.36-rc1~14^2~21 X-Git-Url: http://bbs.cooldavid.org/git/?p=net-next-2.6.git;a=commitdiff_plain;h=df149d02ea8ee49cd14c6609cc7ef980d62dce80 hwmon: (k8temp) Adjust confusing if indentation Move the if(err) statement after the if into the if branch indicated by its indentation. The preceding if(err) test implies that err cannot be nonzero unless the if branch is taken. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r disable braces5@ position p1,p2; statement S1,S2; @@ ( if (...) { ... } | if (...) S1@p1 S2@p2 ) @script:python@ p1 << r.p1; p2 << r.p2; @@ if (p1[0].column == p2[0].column): cocci.print_main("branch",p4) cocci.print_secs("after",p5) // Signed-off-by: Julia Lawall Signed-off-by: Jean Delvare --- diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c index 8bdf80d9159..b9bb3e0ca53 100644 --- a/drivers/hwmon/k8temp.c +++ b/drivers/hwmon/k8temp.c @@ -252,12 +252,13 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, &sensor_dev_attr_temp3_input.dev_attr); if (err) goto exit_remove; - if (data->sensorsp & SEL_PLACE) + if (data->sensorsp & SEL_PLACE) { err = device_create_file(&pdev->dev, &sensor_dev_attr_temp4_input. dev_attr); if (err) goto exit_remove; + } } err = device_create_file(&pdev->dev, &dev_attr_name);