Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error while compiling against 4.4.194 kernel version #542

Closed
wants to merge 1 commit into from

Conversation

ahtabrizi
Copy link

While building the repo against Linux kernel version 4.4.194 (on arm device) it throws the following error:

Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/firefly/v4l2loopback KCPPFLAGS="-DSNAPSHOT_VERSION='"0.12.7-387-g2c9b670"'" modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.194'
  CC [M]  /home/firefly/v4l2loopback/v4l2loopback.o
In file included from include/linux/printk.h:6:0,
                 from include/linux/kernel.h:13,
                 from include/linux/list.h:8,
                 from include/linux/preempt.h:10,
                 from include/linux/spinlock.h:50,
                 from include/linux/vmalloc.h:4,
                 from /home/firefly/v4l2loopback/v4l2loopback.c:17:
/home/firefly/v4l2loopback/v4l2loopback.c: In function 'vidioc_qbuf':
include/linux/kern_levels.h:4:18: warning: format '%lld' expects argument of type 'long long int', but argument 11 has type '__kernel_time_t {aka long int}' [-Wformat=]
error, forbidden warning:kern_levels.h:4
 #define KERN_SOH "\001"  /* ASCII Start Of Header */
                  ^
include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
 #define KERN_INFO KERN_SOH "6" /* informational */
                   ^~~~~~~~
/home/firefly/v4l2loopback/v4l2loopback.c:89:11: note: in expansion of macro 'KERN_INFO'
    printk(KERN_INFO "v4l2-loopback[" __stringify( \
           ^~~~~~~~~
/home/firefly/v4l2loopback/v4l2loopback.c:1698:3: note: in expansion of macro 'dprintkrw'
   dprintkrw(
   ^~~~~~~~~
include/linux/kern_levels.h:4:18: warning: format '%lld' expects argument of type 'long long int', but argument 11 has type '__kernel_time_t {aka long int}' [-Wformat=]
error, forbidden warning:kern_levels.h:4
 #define KERN_SOH "\001"  /* ASCII Start Of Header */
                  ^
include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
 #define KERN_INFO KERN_SOH "6" /* informational */
                   ^~~~~~~~
/home/firefly/v4l2loopback/v4l2loopback.c:89:11: note: in expansion of macro 'KERN_INFO'
    printk(KERN_INFO "v4l2-loopback[" __stringify( \
           ^~~~~~~~~
/home/firefly/v4l2loopback/v4l2loopback.c:1707:3: note: in expansion of macro 'dprintkrw'
   dprintkrw(
   ^~~~~~~~~
/home/firefly/v4l2loopback/v4l2loopback.c: In function 'vidioc_dqbuf':
include/linux/kern_levels.h:4:18: warning: format '%lld' expects argument of type 'long long int', but argument 11 has type '__kernel_time_t {aka long int}' [-Wformat=]
error, forbidden warning:kern_levels.h:4
 #define KERN_SOH "\001"  /* ASCII Start Of Header */
                  ^
include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
 #define KERN_INFO KERN_SOH "6" /* informational */
                   ^~~~~~~~
/home/firefly/v4l2loopback/v4l2loopback.c:89:11: note: in expansion of macro 'KERN_INFO'
    printk(KERN_INFO "v4l2-loopback[" __stringify( \
           ^~~~~~~~~
/home/firefly/v4l2loopback/v4l2loopback.c:1828:3: note: in expansion of macro 'dprintkrw'
   dprintkrw(
   ^~~~~~~~~
include/linux/kern_levels.h:4:18: warning: format '%lld' expects argument of type 'long long int', but argument 11 has type '__kernel_time_t {aka long int}' [-Wformat=]
error, forbidden warning:kern_levels.h:4
 #define KERN_SOH "\001"  /* ASCII Start Of Header */
                  ^
include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
 #define KERN_INFO KERN_SOH "6" /* informational */
                   ^~~~~~~~
/home/firefly/v4l2loopback/v4l2loopback.c:89:11: note: in expansion of macro 'KERN_INFO'
    printk(KERN_INFO "v4l2-loopback[" __stringify( \
           ^~~~~~~~~
/home/firefly/v4l2loopback/v4l2loopback.c:1847:3: note: in expansion of macro 'dprintkrw'
   dprintkrw(
   ^~~~~~~~~
scripts/Makefile.build:283: recipe for target '/home/firefly/v4l2loopback/v4l2loopback.o' failed
make[2]: *** [/home/firefly/v4l2loopback/v4l2loopback.o] Error 1
Makefile:1479: recipe for target '_module_/home/firefly/v4l2loopback' failed
make[1]: *** [_module_/home/firefly/v4l2loopback] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.194'
Makefile:51: recipe for target 'v4l2loopback.ko' failed
make: *** [v4l2loopback.ko] Error 2

This PR fixes this issue.

@umlaeute
Copy link
Owner

umlaeute commented May 7, 2023

this in turn breaks building on 64bit platforms (so I'm closing this).

a proper way would be to just cast the buf->timestamp.tv_sec to long long int. and leave the format-specifier as is.

feel free to open a new PR (based on current main)

@umlaeute umlaeute closed this May 7, 2023
umlaeute pushed a commit that referenced this pull request May 12, 2023
so it also compiles on 32bit platforms

Closes: #542
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants