aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/powerpc/dscr/dscr_sysfs_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/powerpc/dscr/dscr_sysfs_test.c')
-rw-r--r--tools/testing/selftests/powerpc/dscr/dscr_sysfs_test.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/testing/selftests/powerpc/dscr/dscr_sysfs_test.c b/tools/testing/selftests/powerpc/dscr/dscr_sysfs_test.c
index c350f193830a..4f1fef6198fc 100644
--- a/tools/testing/selftests/powerpc/dscr/dscr_sysfs_test.c
+++ b/tools/testing/selftests/powerpc/dscr/dscr_sysfs_test.c
@@ -12,16 +12,16 @@
static int check_cpu_dscr_default(char *file, unsigned long val)
{
- char buf[10] = {0};
- int rc;
+ unsigned long cpu_dscr;
+ int err;
- rc = read_file(file, buf, sizeof(buf) - 1, NULL);
- if (rc)
- return rc;
+ err = read_ulong(file, &cpu_dscr, 16);
+ if (err)
+ return err;
- if (strtol(buf, NULL, 16) != val) {
+ if (cpu_dscr != val) {
printf("DSCR match failed: %ld (system) %ld (cpu)\n",
- val, strtol(buf, NULL, 16));
+ val, cpu_dscr);
return 1;
}
return 0;