Skip to content

Commit 0cd8b6a

Browse files
committed
jtag: drivers: ulink: special align switch and case statements
The coding style requires the 'case' to be at the same indentation level of its 'switch' statement. Checkpatch is not able to detect numbers in exponential format, like 6E-5, and complains about missing space around the operator minus. To complete the alignment of switch and case statements in this file, use a separate commit with the special checkpatch ignore tag in the commit message. Align the code accordingly. No changes are reported by git log -p -w --ignore-blank-lines --patience Checkpatch-ignore: SPACING Change-Id: Ibe70c4a4d3f0bb44c03007103910b778944bb90e Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/9056 Tested-by: jenkins Reviewed-by: zapb <[email protected]>
1 parent 867611d commit 0cd8b6a

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

src/jtag/drivers/ulink.c

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,24 +1285,24 @@ static int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay)
12851285
t = 1.0 / (float)(f);
12861286

12871287
switch (type) {
1288-
case DELAY_CLOCK_TCK:
1289-
x = (t - (float)(6E-6)) / (float)(4E-6);
1290-
break;
1291-
case DELAY_CLOCK_TMS:
1292-
x = (t - (float)(8.5E-6)) / (float)(4E-6);
1293-
break;
1294-
case DELAY_SCAN_IN:
1295-
x = (t - (float)(8.8308E-6)) / (float)(4E-6);
1296-
break;
1297-
case DELAY_SCAN_OUT:
1298-
x = (t - (float)(1.0527E-5)) / (float)(4E-6);
1299-
break;
1300-
case DELAY_SCAN_IO:
1301-
x = (t - (float)(1.3132E-5)) / (float)(4E-6);
1302-
break;
1303-
default:
1304-
return ERROR_FAIL;
1305-
break;
1288+
case DELAY_CLOCK_TCK:
1289+
x = (t - (float)(6E-6)) / (float)(4E-6);
1290+
break;
1291+
case DELAY_CLOCK_TMS:
1292+
x = (t - (float)(8.5E-6)) / (float)(4E-6);
1293+
break;
1294+
case DELAY_SCAN_IN:
1295+
x = (t - (float)(8.8308E-6)) / (float)(4E-6);
1296+
break;
1297+
case DELAY_SCAN_OUT:
1298+
x = (t - (float)(1.0527E-5)) / (float)(4E-6);
1299+
break;
1300+
case DELAY_SCAN_IO:
1301+
x = (t - (float)(1.3132E-5)) / (float)(4E-6);
1302+
break;
1303+
default:
1304+
return ERROR_FAIL;
1305+
break;
13061306
}
13071307

13081308
/* Check if the delay value is negative. This happens when a frequency is
@@ -1345,38 +1345,38 @@ static long ulink_calculate_frequency(enum ulink_delay_type type, int delay)
13451345
return 0;
13461346

13471347
switch (type) {
1348-
case DELAY_CLOCK_TCK:
1349-
if (delay < 0)
1350-
t = (float)(2.666E-6);
1351-
else
1352-
t = (float)(4E-6) * (float)(delay) + (float)(6E-6);
1353-
break;
1354-
case DELAY_CLOCK_TMS:
1355-
if (delay < 0)
1356-
t = (float)(5.666E-6);
1357-
else
1358-
t = (float)(4E-6) * (float)(delay) + (float)(8.5E-6);
1359-
break;
1360-
case DELAY_SCAN_IN:
1361-
if (delay < 0)
1362-
t = (float)(5.5E-6);
1363-
else
1364-
t = (float)(4E-6) * (float)(delay) + (float)(8.8308E-6);
1365-
break;
1366-
case DELAY_SCAN_OUT:
1367-
if (delay < 0)
1368-
t = (float)(7.0E-6);
1369-
else
1370-
t = (float)(4E-6) * (float)(delay) + (float)(1.0527E-5);
1371-
break;
1372-
case DELAY_SCAN_IO:
1373-
if (delay < 0)
1374-
t = (float)(9.926E-6);
1375-
else
1376-
t = (float)(4E-6) * (float)(delay) + (float)(1.3132E-5);
1377-
break;
1378-
default:
1379-
return 0;
1348+
case DELAY_CLOCK_TCK:
1349+
if (delay < 0)
1350+
t = (float)(2.666E-6);
1351+
else
1352+
t = (float)(4E-6) * (float)(delay) + (float)(6E-6);
1353+
break;
1354+
case DELAY_CLOCK_TMS:
1355+
if (delay < 0)
1356+
t = (float)(5.666E-6);
1357+
else
1358+
t = (float)(4E-6) * (float)(delay) + (float)(8.5E-6);
1359+
break;
1360+
case DELAY_SCAN_IN:
1361+
if (delay < 0)
1362+
t = (float)(5.5E-6);
1363+
else
1364+
t = (float)(4E-6) * (float)(delay) + (float)(8.8308E-6);
1365+
break;
1366+
case DELAY_SCAN_OUT:
1367+
if (delay < 0)
1368+
t = (float)(7.0E-6);
1369+
else
1370+
t = (float)(4E-6) * (float)(delay) + (float)(1.0527E-5);
1371+
break;
1372+
case DELAY_SCAN_IO:
1373+
if (delay < 0)
1374+
t = (float)(9.926E-6);
1375+
else
1376+
t = (float)(4E-6) * (float)(delay) + (float)(1.3132E-5);
1377+
break;
1378+
default:
1379+
return 0;
13801380
}
13811381

13821382
f_float = 1.0 / t;

0 commit comments

Comments
 (0)