mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
selftests/powerpc: Add read/write debugfs file, int
Debugfs files are not always integers, so make *_file return/write a byte buffer, and *_int deal with int values specifically. This increases consistency with the other file read/write helpers. Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20230203003947.38033-3-bgray@linux.ibm.com
This commit is contained in:
committed by
Michael Ellerman
parent
a974f0c131
commit
121d340be9
@@ -34,18 +34,18 @@ int entry_flush_test(void)
|
||||
// The PMU event we use only works on Power7 or later
|
||||
SKIP_IF(!have_hwcap(PPC_FEATURE_ARCH_2_06));
|
||||
|
||||
if (read_debugfs_file("powerpc/rfi_flush", &rfi_flush_orig) < 0) {
|
||||
if (read_debugfs_int("powerpc/rfi_flush", &rfi_flush_orig) < 0) {
|
||||
perror("Unable to read powerpc/rfi_flush debugfs file");
|
||||
SKIP_IF(1);
|
||||
}
|
||||
|
||||
if (read_debugfs_file("powerpc/entry_flush", &entry_flush_orig) < 0) {
|
||||
if (read_debugfs_int("powerpc/entry_flush", &entry_flush_orig) < 0) {
|
||||
perror("Unable to read powerpc/entry_flush debugfs file");
|
||||
SKIP_IF(1);
|
||||
}
|
||||
|
||||
if (rfi_flush_orig != 0) {
|
||||
if (write_debugfs_file("powerpc/rfi_flush", 0) < 0) {
|
||||
if (write_debugfs_int("powerpc/rfi_flush", 0) < 0) {
|
||||
perror("error writing to powerpc/rfi_flush debugfs file");
|
||||
FAIL_IF(1);
|
||||
}
|
||||
@@ -105,7 +105,7 @@ again:
|
||||
|
||||
if (entry_flush == entry_flush_orig) {
|
||||
entry_flush = !entry_flush_orig;
|
||||
if (write_debugfs_file("powerpc/entry_flush", entry_flush) < 0) {
|
||||
if (write_debugfs_int("powerpc/entry_flush", entry_flush) < 0) {
|
||||
perror("error writing to powerpc/entry_flush debugfs file");
|
||||
return 1;
|
||||
}
|
||||
@@ -120,12 +120,12 @@ again:
|
||||
|
||||
set_dscr(0);
|
||||
|
||||
if (write_debugfs_file("powerpc/rfi_flush", rfi_flush_orig) < 0) {
|
||||
if (write_debugfs_int("powerpc/rfi_flush", rfi_flush_orig) < 0) {
|
||||
perror("unable to restore original value of powerpc/rfi_flush debugfs file");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (write_debugfs_file("powerpc/entry_flush", entry_flush_orig) < 0) {
|
||||
if (write_debugfs_int("powerpc/entry_flush", entry_flush_orig) < 0) {
|
||||
perror("unable to restore original value of powerpc/entry_flush debugfs file");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user