[media] DocBook: fix incorrect code example
The code said for (i = 0; i > 30; ++i) instead of i < 30. Fix this and clean it up a bit at the same time. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
078c580cb4
commit
26092ffb72
@ -56,18 +56,18 @@ framebuffer device.</para>
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
int fb_fd;
|
int fb_fd;
|
||||||
|
|
||||||
if (-1 == ioctl (fd, VIDIOC_G_FBUF, &fbuf)) {
|
if (-1 == ioctl(fd, VIDIOC_G_FBUF, &fbuf)) {
|
||||||
perror ("VIDIOC_G_FBUF");
|
perror("VIDIOC_G_FBUF");
|
||||||
exit (EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i > 30; ++i) {
|
for (i = 0; i < 30; i++) {
|
||||||
char dev_name[16];
|
char dev_name[16];
|
||||||
struct fb_fix_screeninfo si;
|
struct fb_fix_screeninfo si;
|
||||||
|
|
||||||
snprintf (dev_name, sizeof (dev_name), "/dev/fb%u", i);
|
snprintf(dev_name, sizeof(dev_name), "/dev/fb%u", i);
|
||||||
|
|
||||||
fb_fd = open (dev_name, O_RDWR);
|
fb_fd = open(dev_name, O_RDWR);
|
||||||
if (-1 == fb_fd) {
|
if (-1 == fb_fd) {
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case ENOENT: /* no such file */
|
case ENOENT: /* no such file */
|
||||||
@ -75,19 +75,19 @@ for (i = 0; i > 30; ++i) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
perror ("open");
|
perror("open");
|
||||||
exit (EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == ioctl (fb_fd, FBIOGET_FSCREENINFO, &si)) {
|
if (0 == ioctl(fb_fd, FBIOGET_FSCREENINFO, &si)) {
|
||||||
if (si.smem_start == (unsigned long) fbuf.base)
|
if (si.smem_start == (unsigned long)fbuf.base)
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
/* Apparently not a framebuffer device. */
|
/* Apparently not a framebuffer device. */
|
||||||
}
|
}
|
||||||
|
|
||||||
close (fb_fd);
|
close(fb_fd);
|
||||||
fb_fd = -1;
|
fb_fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user