Fix incorrect tests for command line arguments in userclk program.
@@ -46,7 +46,7 @@ struct option longopts[] = {
{"help", no_argument, NULL, 'h'},
{"bus", required_argument, NULL, 'B'},
{"device", required_argument, NULL, 'D'},
- {"functionr", required_argument, NULL, 'F'},
+ {"function", required_argument, NULL, 'F'},
{"socket-id", required_argument, NULL, 'S'},
{"port", required_argument, NULL, 'P'},
{"freq-high", required_argument, NULL, 'H'},
@@ -144,22 +144,22 @@ int main( int argc, char** argv )
result = fpgaPropertiesSetObjectType(filter, FPGA_DEVICE);
ON_ERR_GOTO(result, out_destroy_prop, "setting object type");
- if (userclkCmdLine.bus >0){
+ if (-1 != userclkCmdLine.bus) {
result = fpgaPropertiesSetBus(filter, userclkCmdLine.bus);
ON_ERR_GOTO(result, out_destroy_prop, "setting bus");
}
- if (userclkCmdLine.device >0) {
+ if (-1 != userclkCmdLine.device) {
result = fpgaPropertiesSetDevice(filter, userclkCmdLine.device);
ON_ERR_GOTO(result, out_destroy_prop, "setting device");
}
- if (userclkCmdLine.function >0){
+ if (-1 != userclkCmdLine.function){
result = fpgaPropertiesSetFunction(filter, userclkCmdLine.function);
ON_ERR_GOTO(result, out_destroy_prop, "setting function");
}
- if (userclkCmdLine.socket >0){
+ if (-1 != userclkCmdLine.socket){
result = fpgaPropertiesSetSocketID(filter, userclkCmdLine.socket);
ON_ERR_GOTO(result, out_destroy_prop, "setting socket");
}
