Skip to content

Commit

Permalink
Always use ssize_t for number of devices
Browse files Browse the repository at this point in the history
  • Loading branch information
tormodvolden committed Feb 3, 2024
1 parent baa76f2 commit 02a1655
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/stress_mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static thread_return_t THREAD_CALL_TYPE init_and_exit(void * arg)

/* single thread will set devcount_ref, otherwise check against it
* same for access_failures_ref */
static int test_multi_init(int nthreads, bool enumerate, bool opendev, int *devcount_ref, int *access_failures_ref)
static int test_multi_init(int nthreads, bool enumerate, bool opendev, ssize_t *devcount_ref, int *access_failures_ref)
{
int t, i;
int errs = 0;
Expand Down Expand Up @@ -280,15 +280,15 @@ static int test_multi_init(int nthreads, bool enumerate, bool opendev, int *devc
int main(void)
{
int errs, errs_enum, errs_open, errs_ref;
int ndevices;
ssize_t ndevices;
int access_errs;

printf("Running single-threaded init/exit test for counting devices...\n");

/* single thread with enumeration */
errs_ref = test_multi_init(1, true, true, &ndevices, &access_errs);

printf("Single thread discovered %d devices (%d errors)\n", ndevices, errs_ref);
printf("Single thread discovered %ld devices (%d errors)\n", (long int) ndevices, errs_ref);

printf("Running multithreaded init/exit test...\n");

Expand Down

0 comments on commit 02a1655

Please sign in to comment.