mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
selftests/powerpc/papr_vpd: Check devfd before get_system_loc_code()
Calling get_system_loc_code before checking devfd and errno fails the test when the device is not available, the expected behaviour is a SKIP. Change the order of 'SKIP_IF_MSG' to correctly SKIP when the /dev/ papr-vpd device is not available. Test output before: Test FAILED on line 271 Test output after: [SKIP] Test skipped on line 266: /dev/papr-vpd not present Signed-off-by: R Nageswara Sastry <rnsastry@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240131130859.14968-1-rnsastry@linux.ibm.com
This commit is contained in:
parent
aad98efd0b
commit
f09696279b
1 changed files with 2 additions and 2 deletions
|
@ -263,10 +263,10 @@ static int papr_vpd_system_loc_code(void)
|
|||
off_t size;
|
||||
int fd;
|
||||
|
||||
SKIP_IF_MSG(get_system_loc_code(&lc),
|
||||
"Cannot determine system location code");
|
||||
SKIP_IF_MSG(devfd < 0 && errno == ENOENT,
|
||||
DEVPATH " not present");
|
||||
SKIP_IF_MSG(get_system_loc_code(&lc),
|
||||
"Cannot determine system location code");
|
||||
|
||||
FAIL_IF(devfd < 0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue