{"id":444,"date":"2015-12-02T10:25:38","date_gmt":"2015-12-02T10:25:38","guid":{"rendered":"http:\/\/www.struck.de\/blog\/?p=444"},"modified":"2015-12-02T10:31:47","modified_gmt":"2015-12-02T10:31:47","slug":"fix-for-compilation-error-for-sis1100-linux-driver-under-kernel-4-2-x","status":"publish","type":"post","link":"https:\/\/www.struck.de\/blog\/?p=444","title":{"rendered":"Fix for compilation error for SIS1100 Linux driver under kernel 4.2.x"},"content":{"rendered":"<h1>Used Driver:<\/h1>\n<p>sis1100-2.13-9<\/p>\n<h1>Error Description:<\/h1>\n<p>Building errors:<br \/>\n===============================<br \/>\nCC [M]<br \/>\n\/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.o<br \/>\n\/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.c:<br \/>\nIn function \u2018sis1100_ddma_unmap_block\u2019:<br \/>\n\/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.c:54:9:<br \/>\nerror: implicit declaration of function \u2018vfree\u2019<br \/>\n[-Werror=implicit-function-declaration]<br \/>\nvfree(block-&gt;desc_pages);<br \/>\n^<br \/>\n\/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.c:<br \/>\nIn function \u2018sis1100_ddma_map_block\u2019:<br \/>\n\/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.c:130:5:<br \/>\nerror: implicit declaration of function \u2018vmalloc\u2019<br \/>\n[-Werror=implicit-function-declaration]<br \/>\nblock-&gt;desc_pages=vmalloc(block-&gt;dsegs* sizeof(struct sis1100_dmapage));<br \/>\n^<br \/>\n\/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.c:130:22:<br \/>\nwarning: assignment makes pointer from integer without a cast<br \/>\nblock-&gt;desc_pages=vmalloc(block-&gt;dsegs* sizeof(struct sis1100_dmapage));<br \/>\n^<\/p>\n<h1>Solution:<\/h1>\n<p>Fixing is simple, just add the missing include &#8220;#include &lt;linux\/vmaclloc.h&gt;&#8221; to &#8220;compat_linux.h&#8221;.<br \/>\n===============================<br \/>\n+++ b\/vme\/sis3100\/driver\/src\/compat_linux.h<br \/>\n@@ -41,6 +41,7 @@<br \/>\n#include &lt;linux\/kthread.h&gt;<br \/>\n#include &lt;linux\/delay.h&gt;<br \/>\n#include &lt;linux\/time.h&gt;<br \/>\n+#include &lt;linux\/vmalloc.h&gt;<br \/>\n#include &lt;asm\/poll.h&gt;<br \/>\n#include &lt;asm\/uaccess.h&gt;<\/p>\n<h1>Thanks and DKMS option:<\/h1>\n<p>Thanks to Exaos Lee from\u00a0China Institute of Atomic Energy for bringing this to our attention.<\/p>\n<p>Eaxos generated a DKMS version of the 2.13-9 also, which can be emailed to interested parties.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Used Driver: sis1100-2.13-9 Error Description: Building errors: =============================== CC [M] \/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.o \/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.c: In function \u2018sis1100_ddma_unmap_block\u2019: \/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.c:54:9: error: implicit declaration of function \u2018vfree\u2019 [-Werror=implicit-function-declaration] vfree(block-&gt;desc_pages); ^ \/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.c: In function \u2018sis1100_ddma_map_block\u2019: \/home\/daq\/Workspace\/daq\/exaos\/eldaq\/vme\/sis3100\/driver\/src\/sis1100_ddma_map_linux.c:130:5: error: implicit declaration of function \u2018vmalloc\u2019 [-Werror=implicit-function-declaration] block-&gt;desc_pages=vmalloc(block-&gt;dsegs* sizeof(struct sis1100_dmapage)); &hellip; <a href=\"https:\/\/www.struck.de\/blog\/?p=444\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[94,93,9,95],"class_list":["post-444","post","type-post","status-publish","format-standard","hentry","category-driver","tag-4-2-x","tag-kernel","tag-linux","tag-sis1100"],"_links":{"self":[{"href":"https:\/\/www.struck.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.struck.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.struck.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.struck.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.struck.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=444"}],"version-history":[{"count":2,"href":"https:\/\/www.struck.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/444\/revisions"}],"predecessor-version":[{"id":446,"href":"https:\/\/www.struck.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/444\/revisions\/446"}],"wp:attachment":[{"href":"https:\/\/www.struck.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.struck.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.struck.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}