2016-11-09 47 views
0

我發現返回void時拋出錯誤消息error: void value not ignored as it ought to be。很公平。構建驅動程序產生錯誤:無效值不被忽略,因爲它應該是'

我試圖爲我的WIFI加密狗編譯驅動程序時出現此錯誤。這是錯誤的輸出:

[email protected]:~/AL100ac $ sudo make ARCH=arm 
make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.4.26+/build M=/home/birger/AL100ac modules 
make[1]: Entering directory '/usr/src/linux-headers-4.4.26+' 
    CC [M] /home/birger/AL100ac/core/rtw_debug.o 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘dump_drv_version’: 
/home/birger/AL100ac/core/rtw_debug.c:65:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:66:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘dump_log_level’: 
/home/birger/AL100ac/core/rtw_debug.c:71:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘mac_reg_dump’: 
/home/birger/AL100ac/core/rtw_debug.c:98:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:103:4: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:104:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:106:4: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘bb_reg_dump’: 
/home/birger/AL100ac/core/rtw_debug.c:114:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:118:4: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:119:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:121:4: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘rf_reg_dump’: 
/home/birger/AL100ac/core/rtw_debug.c:138:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:141:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:146:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:147:4: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:149:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_read_reg’: 
/home/birger/AL100ac/core/rtw_debug.c:208:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:215:4: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:218:4: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:221:4: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:224:4: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_fwstate’: 
/home/birger/AL100ac/core/rtw_debug.c:267:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_sec_info’: 
/home/birger/AL100ac/core/rtw_debug.c:278:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:282:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:285:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:287:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:290:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:292:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:295:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:297:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_mlmext_state’: 
/home/birger/AL100ac/core/rtw_debug.c:311:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_roam_flags’: 
/home/birger/AL100ac/core/rtw_debug.c:322:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_roam_param’: 
/home/birger/AL100ac/core/rtw_debug.c:356:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:357:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_qos_option’: 
/home/birger/AL100ac/core/rtw_debug.c:426:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_ht_option’: 
/home/birger/AL100ac/core/rtw_debug.c:438:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_rf_info’: 
/home/birger/AL100ac/core/rtw_debug.c:450:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:453:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_survey_info’: 
/home/birger/AL100ac/core/rtw_debug.c:478:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:499:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_ap_info’: 
/home/birger/AL100ac/core/rtw_debug.c:532:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:533:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:534:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:535:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:536:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:538:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:539:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:540:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:541:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:542:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:545:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:546:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:547:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:555:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:562:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_adapter_state’: 
/home/birger/AL100ac/core/rtw_debug.c:578:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_trx_info’: 
/home/birger/AL100ac/core/rtw_debug.c:594:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:596:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:598:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:604:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:608:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_rate_ctl’: 
/home/birger/AL100ac/core/rtw_debug.c:621:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:622:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:624:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_suspend_resume_info’: 
/home/birger/AL100ac/core/rtw_debug.c:695:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:696:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:697:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:698:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:699:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:700:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:701:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:702:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:703:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:704:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:705:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:706:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:707:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:708:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:709:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:710:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:711:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:712:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:713:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:714:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:715:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:716:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:717:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:718:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:719:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:720:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:721:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:722:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_rx_signal’: 
/home/birger/AL100ac/core/rtw_debug.c:996:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:998:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:999:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1000:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_hw_status’: 
/home/birger/AL100ac/core/rtw_debug.c:1016:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_ht_enable’: 
/home/birger/AL100ac/core/rtw_debug.c:1065:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_bw_mode’: 
/home/birger/AL100ac/core/rtw_debug.c:1103:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_ampdu_enable’: 
/home/birger/AL100ac/core/rtw_debug.c:1143:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_rx_ampdu’: 
/home/birger/AL100ac/core/rtw_debug.c:1184:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_en_fwps’: 
/home/birger/AL100ac/core/rtw_debug.c:1235:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_rx_stbc’: 
/home/birger/AL100ac/core/rtw_debug.c:1290:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_all_sta_info’: 
/home/birger/AL100ac/core/rtw_debug.c:1381:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1398:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1399:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1400:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1401:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1403:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1404:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1405:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1406:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1408:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1409:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1410:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1411:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1412:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1414:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1415:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1416:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1417:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1418:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1419:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1420:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1427:7: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1439:5: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c: In function ‘proc_get_best_channel’: 
/home/birger/AL100ac/core/rtw_debug.c:1512:3: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1517:2: error: void value not ignored as it ought to be 
/home/birger/AL100ac/core/rtw_debug.c:1518:2: error: void value not ignored as it ought to be 
scripts/Makefile.build:258: recipe for target '/home/birger/AL100ac/core/rtw_debug.o' failed 
make[2]: *** [/home/birger/AL100ac/core/rtw_debug.o] Error 1 
Makefile:1400: recipe for target '_module_/home/birger/AL100ac' failed 
make[1]: *** [_module_/home/birger/AL100ac] Error 2 
make[1]: Leaving directory '/usr/src/linux-headers-4.4.26+' 
Makefile:1385: recipe for target 'modules' failed 
make: *** [modules] Error 2 

具體來說,則會引發錯誤調用名爲DBG_871X_SEL_NL功能。

所以我猜宏是什麼導致這個問題。我試圖尋找驅動程序的源代碼,然後將其定義是這樣的:

/* dump message to selected 'stream' with driver-defined prefix */ 
#define DBG_871X_SEL_NL(sel, fmt, arg...) \ 
    do {\ 
     if (sel == RTW_DBGDUMP)\ 
      DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ 
     else {\ 
      if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \ 
     } \ 
    }while(0) 

我不能完成我的周圍是什麼原因造成這個錯誤的頭,以及如何解決它?

我四處搜尋了一下,發現這一點:https://github.com/hadess/rtl8723bs/issues/30

難道我影響一個類似的錯誤?

編輯:

我應該提到的是相同的代碼工作,我更新內核之前。所以我在內核頭文件中假設了一些以前返回值的函數,現在是一個void函數。

+0

那麼你覺得什麼'void'作爲功能「結果」是指?而'DBG_871X_SEL_NL'不是**函數,而是一個宏。 – Olaf

+0

@Off你說的是'空白'嗎? –

+1

@SouravGhosh:當然。謝謝。雖然'vodi'實際上聽起來更好。嗯,我應該定義一個宏,並只使用該名稱... ;-)如果沒有其他任何東西,它會驚喜的同事爲什麼它編譯... – Olaf

回答

1

發現內核被更新後,_seqdump函數不再返回一個值。

因此,我用_seqdump(sel, fmt, ##arg)

這裏更換if(_seqdump(sel, fmt, ##arg))固定誤差是影響了兩個宏:

/* dump message to selected 'stream' */ 
#define DBG_871X_SEL(sel, fmt, arg...) \ 
    do {\ 
     if (sel == RTW_DBGDUMP)\ 
      _DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ 
     else {\ 
      _seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \ 
     } \ 
    }while(0) 

而且

/* dump message to selected 'stream' with driver-defined prefix */ 
#define DBG_871X_SEL_NL(sel, fmt, arg...) \ 
    do {\ 
     if (sel == RTW_DBGDUMP)\ 
      DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ 
     else {\ 
      _seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \ 
     } \ 
    }while(0) 
相關問題