xref: /aosp_15_r20/external/ltp/testcases/lib/tst_check_drivers.c (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker // SPDX-License-Identifier: GPL-2.0-or-later
2*49cdfc7eSAndroid Build Coastguard Worker /* Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved. */
3*49cdfc7eSAndroid Build Coastguard Worker 
4*49cdfc7eSAndroid Build Coastguard Worker #include <stdio.h>
5*49cdfc7eSAndroid Build Coastguard Worker #include "tst_kernel.h"
6*49cdfc7eSAndroid Build Coastguard Worker 
main(int argc,const char * argv[])7*49cdfc7eSAndroid Build Coastguard Worker int main(int argc, const char *argv[])
8*49cdfc7eSAndroid Build Coastguard Worker {
9*49cdfc7eSAndroid Build Coastguard Worker 	const char *name;
10*49cdfc7eSAndroid Build Coastguard Worker 	int i;
11*49cdfc7eSAndroid Build Coastguard Worker 
12*49cdfc7eSAndroid Build Coastguard Worker 	if (argc < 2) {
13*49cdfc7eSAndroid Build Coastguard Worker 		fprintf(stderr, "Please provide kernel driver list\n");
14*49cdfc7eSAndroid Build Coastguard Worker 		return 1;
15*49cdfc7eSAndroid Build Coastguard Worker 	}
16*49cdfc7eSAndroid Build Coastguard Worker 
17*49cdfc7eSAndroid Build Coastguard Worker 	for (i = 1; (name = argv[i]); ++i) {
18*49cdfc7eSAndroid Build Coastguard Worker 		if (tst_check_driver(name)) {
19*49cdfc7eSAndroid Build Coastguard Worker 			fprintf(stderr, "%s", name);
20*49cdfc7eSAndroid Build Coastguard Worker 			return 1;
21*49cdfc7eSAndroid Build Coastguard Worker 		}
22*49cdfc7eSAndroid Build Coastguard Worker 	}
23*49cdfc7eSAndroid Build Coastguard Worker 
24*49cdfc7eSAndroid Build Coastguard Worker 	return 0;
25*49cdfc7eSAndroid Build Coastguard Worker }
26