Cleanup discover_device in examples
Andrei Tchijov pointed out that the discover_device() function is written in a strange way.
This commit is contained in:
parent
3479dee0e4
commit
c1f8581ec9
5 changed files with 36 additions and 51 deletions
|
@ -26,16 +26,13 @@
|
|||
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
struct fp_dscv_dev *ddev = NULL;
|
||||
int i;
|
||||
|
||||
for (i = 0; ddev = discovered_devs[i]; i++) {
|
||||
struct fp_driver *drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n",
|
||||
fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,16 +24,13 @@
|
|||
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
struct fp_dscv_dev *ddev = NULL;
|
||||
int i;
|
||||
|
||||
for (i = 0; ddev = discovered_devs[i]; i++) {
|
||||
struct fp_driver *drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n",
|
||||
fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,18 +116,15 @@ static void QueryXv()
|
|||
printf("No suitable Xv adaptor found\n");
|
||||
}
|
||||
|
||||
static struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
struct fp_dscv_dev *ddev = NULL;
|
||||
int i;
|
||||
|
||||
for (i = 0; ddev = discovered_devs[i]; i++) {
|
||||
struct fp_driver *drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n",
|
||||
fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,16 +26,13 @@
|
|||
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
struct fp_dscv_dev *ddev = NULL;
|
||||
int i;
|
||||
|
||||
for (i = 0; ddev = discovered_devs[i]; i++) {
|
||||
struct fp_driver *drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n",
|
||||
fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,16 +25,13 @@
|
|||
|
||||
struct fp_dscv_dev *discover_device(struct fp_dscv_dev **discovered_devs)
|
||||
{
|
||||
struct fp_dscv_dev *ddev = NULL;
|
||||
int i;
|
||||
|
||||
for (i = 0; ddev = discovered_devs[i]; i++) {
|
||||
struct fp_driver *drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n",
|
||||
fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
struct fp_dscv_dev *ddev = discovered_devs[0];
|
||||
struct fp_driver *drv;
|
||||
if (!ddev)
|
||||
return NULL;
|
||||
|
||||
drv = fp_dscv_dev_get_driver(ddev);
|
||||
printf("Found device claimed by %s driver\n", fp_driver_get_full_name(drv));
|
||||
return ddev;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue