File: fwctrl-include-missing-function-declarations.patch

package info (click to toggle)
mstflint 4.31.0%2B1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 37,200 kB
  • sloc: ansic: 205,509; cpp: 103,810; ada: 15,143; sh: 11,406; python: 8,039; makefile: 1,413
file content (56 lines) | stat: -rw-r--r-- 1,889 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 05f14a16bb8182ebea7f5cf4f771a02b7660f572 Mon Sep 17 00:00:00 2001
From: Til Kaiser <mail@tk154.de>
Date: Fri, 7 Feb 2025 14:26:52 +0100
Subject: [PATCH] fwctrl: include missing function declarations

The fwctrl fails to build with the following error:

fwctrl.c: In function 'fwctl_control_access_register':
fwctrl.c:190:27: error: implicit declaration of function 'return_by_reg_status' [-Wimplicit-function-declaration]
  190 |             *reg_status = return_by_reg_status(cmd_status);
      |                           ^~~~~~~~~~~~~~~~~~~~
In file included from fwctrl.c:45:
fwctrl.c:195:56: error: implicit declaration of function 'm_err2str' [-Wimplicit-function-declaration]
  195 |                       reg_id, cmd_status, *reg_status, m_err2str(status));
      |

This commit adds the return_by_reg_status prototype to the
mtcr_ul_com.h file and includes mtcr_ul_com.h and mtcr.h
(where the m_err2str prototype is defined) inside fwctrl.c.

Signed-off-by: Til Kaiser <mail@tk154.de>
---
 mtcr_ul/fwctrl.c      | 2 ++
 mtcr_ul/mtcr_ul_com.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/mtcr_ul/fwctrl.c b/mtcr_ul/fwctrl.c
index f000e9e1..90da0b54 100644
--- a/mtcr_ul/fwctrl.c
+++ b/mtcr_ul/fwctrl.c
@@ -40,7 +40,9 @@
 #include <errno.h>
 #include <string.h>
 #include <stddef.h>
+#include "mtcr.h"
 #include "mtcr_mf.h"
+#include "mtcr_ul_com.h"
 #include "fwctrl.h"
 #include "fwctrl_ioctl.h"
 
diff --git a/mtcr_ul/mtcr_ul_com.h b/mtcr_ul/mtcr_ul_com.h
index 6d502d0d..8e298bd8 100644
--- a/mtcr_ul/mtcr_ul_com.h
+++ b/mtcr_ul/mtcr_ul_com.h
@@ -165,6 +165,8 @@ int mclear_pci_semaphore_ul(const char* name);
 
 int mvpd_read4_ul(mfile* mf, unsigned int offset, u_int8_t value[4]);
 
+int return_by_reg_status(int reg_status);
+
 int space_to_cap_offset(int space);
 
 int get_dma_pages(mfile* mf, struct mtcr_page_info* page_info, int page_amount);
-- 
2.47.2