[tglx-devel:x86/entry 80/125] arch/x86/kernel/doublefault_32.c:73:2: error: implicit declaration of function 'exc_double_fault'; did you mean 'do_page_fault'?
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/entry
head: 552572a83438a85d885f4638d65dee36927920ce
commit: a603685f0f8ab008afb582c6f319ceb2ad506537 [80/125] x86/entry: Convert double fault exception to IDTENTRY_DF
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
git checkout a603685f0f8ab008afb582c6f319ceb2ad506537
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
arch/x86/kernel/doublefault_32.c: In function 'doublefault_shim':
>> arch/x86/kernel/doublefault_32.c:73:2: error: implicit declaration of function 'exc_double_fault'; did you mean 'do_page_fault'? [-Werror=implicit-function-declaration]
exc_double_fault(®s, 0, cr2);
^~~~~~~~~~~~~~~~
do_page_fault
arch/x86/kernel/doublefault_32.c: At top level:
>> arch/x86/kernel/doublefault_32.c:97:26: error: 'asm_exc_double_fault' undeclared here (not in a function); did you mean 'async_page_fault'?
.ip = (unsigned long) asm_exc_double_fault,
^~~~~~~~~~~~~~~~~~~~
async_page_fault
cc1: some warnings being treated as errors
vim +73 arch/x86/kernel/doublefault_32.c
19
20 /*
21 * Called by double_fault with CR0.TS and EFLAGS.NT cleared. The CPU thinks
22 * we're running the doublefault task. Cannot return.
23 */
24 asmlinkage noinstr void __noreturn doublefault_shim(void)
25 {
26 unsigned long cr2;
27 struct pt_regs regs;
28
29 BUILD_BUG_ON(sizeof(struct doublefault_stack) != PAGE_SIZE);
30
31 cr2 = native_read_cr2();
32
33 /* Reset back to the normal kernel task. */
34 force_reload_TR();
35 set_df_gdt_entry(smp_processor_id());
36
37 trace_hardirqs_off();
38
39 /*
40 * Fill in pt_regs. A downside of doing this in C is that the unwinder
41 * won't see it (no ENCODE_FRAME_POINTER), so a nested stack dump
42 * won't successfully unwind to the source of the double fault.
43 * The main dump from exc_double_fault() is fine, though, since it
44 * uses these regs directly.
45 *
46 * If anyone ever cares, this could be moved to asm.
47 */
48 regs.ss = TSS(ss);
49 regs.__ssh = 0;
50 regs.sp = TSS(sp);
51 regs.flags = TSS(flags);
52 regs.cs = TSS(cs);
53 /* We won't go through the entry asm, so we can leave __csh as 0. */
54 regs.__csh = 0;
55 regs.ip = TSS(ip);
56 regs.orig_ax = 0;
57 regs.gs = TSS(gs);
58 regs.__gsh = 0;
59 regs.fs = TSS(fs);
60 regs.__fsh = 0;
61 regs.es = TSS(es);
62 regs.__esh = 0;
63 regs.ds = TSS(ds);
64 regs.__dsh = 0;
65 regs.ax = TSS(ax);
66 regs.bp = TSS(bp);
67 regs.di = TSS(di);
68 regs.si = TSS(si);
69 regs.dx = TSS(dx);
70 regs.cx = TSS(cx);
71 regs.bx = TSS(bx);
72
> 73 exc_double_fault(®s, 0, cr2);
74
75 /*
76 * x86_32 does not save the original CR3 anywhere on a task switch.
77 * This means that, even if we wanted to return, we would need to find
78 * some way to reconstruct CR3. We could make a credible guess based
79 * on cpu_tlbstate, but that would be racy and would not account for
80 * PTI.
81 *
82 * Instead, don't bother. We can return through
83 * rewind_stack_do_exit() instead.
84 */
85 panic("cannot return from double fault\n");
86 }
87
88 DEFINE_PER_CPU_PAGE_ALIGNED(struct doublefault_stack, doublefault_stack) = {
89 .tss = {
90 /*
91 * No sp0 or ss0 -- we never run CPL != 0 with this TSS
92 * active. sp is filled in later.
93 */
94 .ldt = 0,
95 .io_bitmap_base = IO_BITMAP_OFFSET_INVALID,
96
> 97 .ip = (unsigned long) asm_exc_double_fault,
98 .flags = X86_EFLAGS_FIXED,
99 .es = __USER_DS,
100 .cs = __KERNEL_CS,
101 .ss = __KERNEL_DS,
102 .ds = __USER_DS,
103 .fs = __KERNEL_PERCPU,
104 #ifndef CONFIG_X86_32_LAZY_GS
105 .gs = __KERNEL_STACK_CANARY,
106 #endif
107
108 .__cr3 = __pa_nodebug(swapper_pg_dir),
109 },
110 };
111
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [RFC PATCH 06/13] scsi: scsi_dh: ufshpb: Prepare for L2P cache management
by kbuild test robot
Hi Avri,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on scsi/for-next]
[also build test ERROR on next-20200515]
[cannot apply to mkp-scsi/for-next v5.7-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Avri-Altman/scsi-ufs-Add-HPB-Sup...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
m68k-linux-ld: drivers/scsi/device_handler/scsi_dh_ufshpb.o: in function `ufshpb_attach':
scsi_dh_ufshpb.c:(.text+0x178): undefined reference to `sdev_prefix_printk'
m68k-linux-ld: drivers/scsi/device_handler/scsi_dh_ufshpb.o: in function `ufshpb_activate':
scsi_dh_ufshpb.c:(.text+0x270): undefined reference to `__udivdi3'
>> m68k-linux-ld: scsi_dh_ufshpb.c:(.text+0x2a0): undefined reference to `__udivdi3'
>> m68k-linux-ld: scsi_dh_ufshpb.c:(.text+0x2be): undefined reference to `__umoddi3'
m68k-linux-ld: drivers/scsi/device_handler/scsi_dh_ufshpb.o: in function `ufshpb_init':
scsi_dh_ufshpb.c:(.init.text+0xc): undefined reference to `scsi_register_device_handler'
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[skn:smccc_v1_2_soc_id 7/7] drivers/firmware/smccc/soc_id.c:96:6: error: implicit declaration of function 'arm_smccc_version_get'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git smccc_v1_2_soc_id
head: e5d38d7d28222b9a997e1ec7521493b87d302389
commit: e5d38d7d28222b9a997e1ec7521493b87d302389 [7/7] firmware: smccc: Add ARCH_SOC_ID support
config: arm64-randconfig-r025-20200515 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project b31cb3aa5ee7ea92d830b06a0a7e42c7f2791dd4)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git checkout e5d38d7d28222b9a997e1ec7521493b87d302389
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/firmware/smccc/soc_id.c:96:6: error: implicit declaration of function 'arm_smccc_version_get' [-Werror,-Wimplicit-function-declaration]
if (arm_smccc_version_get() < ARM_SMCCC_VERSION_1_2)
^
1 error generated.
vim +/arm_smccc_version_get +96 drivers/firmware/smccc/soc_id.c
88
89 static int __init smccc_soc_init(void)
90 {
91 struct device *dev;
92 int ret, soc_id_rev;
93 struct arm_smccc_res res;
94 static char soc_id_str[8], soc_id_rev_str[12];
95
> 96 if (arm_smccc_version_get() < ARM_SMCCC_VERSION_1_2)
97 return 0;
98
99 ret = smccc_soc_id_support_check();
100 if (ret) {
101 pr_info("Feature not implemented, skipping ....\n");
102 return 0;
103 }
104
105 arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_SOC_ID, 0, &res);
106
107 ret = smccc_map_error_codes(res.a0);
108 if (ret) {
109 pr_err("Failed to fetch version, Err = %d\n", ret);
110 return ret;
111 }
112
113 soc_id_version = res.a0;
114
115 arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_SOC_ID, 1, &res);
116
117 ret = smccc_map_error_codes(res.a0);
118 if (ret) {
119 pr_err("Failed to fetch revision, Err = %d\n", ret);
120 return ret;
121 }
122
123 soc_id_rev = res.a0;
124
125 soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
126 if (!soc_dev_attr)
127 return -ENOMEM;
128
129 sprintf(soc_id_str, "0x%04x", IMP_DEF_SOC_ID(soc_id_version));
130 sprintf(soc_id_rev_str, "0x%08x", soc_id_rev);
131
132 soc_dev_attr->soc_id = soc_id_str;
133 soc_dev_attr->revision = soc_id_rev_str;
134
135 soc_dev = soc_device_register(soc_dev_attr);
136 if (IS_ERR(soc_dev)) {
137 ret = PTR_ERR(soc_dev);
138 goto free_soc;
139 }
140
141 dev = soc_device_to_device(soc_dev);
142
143 ret = devm_device_add_groups(dev, jep106_id_groups);
144 if (ret) {
145 dev_err(dev, "sysfs create failed: %d\n", ret);
146 goto unregister_soc;
147 }
148
149 pr_info("ID = %s Revision = %s\n", soc_dev_attr->soc_id,
150 soc_dev_attr->revision);
151
152 return 0;
153
154 unregister_soc:
155 soc_device_unregister(soc_dev);
156 free_soc:
157 kfree(soc_dev_attr);
158 return ret;
159 }
160 module_init(smccc_soc_init);
161
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[skn:smccc_v1_2_soc_id 7/7] drivers/firmware/smccc/soc_id.c:96:6: error: implicit declaration of function 'arm_smccc_version_get'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git smccc_v1_2_soc_id
head: e5d38d7d28222b9a997e1ec7521493b87d302389
commit: e5d38d7d28222b9a997e1ec7521493b87d302389 [7/7] firmware: smccc: Add ARCH_SOC_ID support
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout e5d38d7d28222b9a997e1ec7521493b87d302389
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/firmware/smccc/soc_id.c: In function 'smccc_soc_init':
>> drivers/firmware/smccc/soc_id.c:96:6: error: implicit declaration of function 'arm_smccc_version_get' [-Werror=implicit-function-declaration]
96 | if (arm_smccc_version_get() < ARM_SMCCC_VERSION_1_2)
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/arm_smccc_version_get +96 drivers/firmware/smccc/soc_id.c
88
89 static int __init smccc_soc_init(void)
90 {
91 struct device *dev;
92 int ret, soc_id_rev;
93 struct arm_smccc_res res;
94 static char soc_id_str[8], soc_id_rev_str[12];
95
> 96 if (arm_smccc_version_get() < ARM_SMCCC_VERSION_1_2)
97 return 0;
98
99 ret = smccc_soc_id_support_check();
100 if (ret) {
101 pr_info("Feature not implemented, skipping ....\n");
102 return 0;
103 }
104
105 arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_SOC_ID, 0, &res);
106
107 ret = smccc_map_error_codes(res.a0);
108 if (ret) {
109 pr_err("Failed to fetch version, Err = %d\n", ret);
110 return ret;
111 }
112
113 soc_id_version = res.a0;
114
115 arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_SOC_ID, 1, &res);
116
117 ret = smccc_map_error_codes(res.a0);
118 if (ret) {
119 pr_err("Failed to fetch revision, Err = %d\n", ret);
120 return ret;
121 }
122
123 soc_id_rev = res.a0;
124
125 soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
126 if (!soc_dev_attr)
127 return -ENOMEM;
128
129 sprintf(soc_id_str, "0x%04x", IMP_DEF_SOC_ID(soc_id_version));
130 sprintf(soc_id_rev_str, "0x%08x", soc_id_rev);
131
132 soc_dev_attr->soc_id = soc_id_str;
133 soc_dev_attr->revision = soc_id_rev_str;
134
135 soc_dev = soc_device_register(soc_dev_attr);
136 if (IS_ERR(soc_dev)) {
137 ret = PTR_ERR(soc_dev);
138 goto free_soc;
139 }
140
141 dev = soc_device_to_device(soc_dev);
142
143 ret = devm_device_add_groups(dev, jep106_id_groups);
144 if (ret) {
145 dev_err(dev, "sysfs create failed: %d\n", ret);
146 goto unregister_soc;
147 }
148
149 pr_info("ID = %s Revision = %s\n", soc_dev_attr->soc_id,
150 soc_dev_attr->revision);
151
152 return 0;
153
154 unregister_soc:
155 soc_device_unregister(soc_dev);
156 free_soc:
157 kfree(soc_dev_attr);
158 return ret;
159 }
160 module_init(smccc_soc_init);
161
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [PATCH] usb: dwc3: gadget: Check for prepared TRBs
by kbuild test robot
Hi Thinh,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on balbi-usb/next]
[also build test ERROR on usb/usb-testing peter.chen-usb/ci-for-usb-next v5.7-rc5 next-20200515]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Thinh-Nguyen/usb-dwc3-gadget-Che...
base: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/usb/dwc3/gadget.c: In function 'dwc3_prepare_trbs':
>> drivers/usb/dwc3/gadget.c:1203:42: error: 'struct usb_request' has no member named 'is_last'
if (dep->stream_capable && req->request.is_last)
^
vim +1203 drivers/usb/dwc3/gadget.c
1166
1167 /*
1168 * dwc3_prepare_trbs - setup TRBs from requests
1169 * @dep: endpoint for which requests are being prepared
1170 *
1171 * The function goes through the requests list and sets up TRBs for the
1172 * transfers. The function returns once there are no more TRBs available or
1173 * it runs out of requests.
1174 */
1175 static void dwc3_prepare_trbs(struct dwc3_ep *dep)
1176 {
1177 struct dwc3_request *req, *n;
1178
1179 BUILD_BUG_ON_NOT_POWER_OF_2(DWC3_TRB_NUM);
1180
1181 /*
1182 * We can get in a situation where there's a request in the started list
1183 * but there weren't enough TRBs to fully kick it in the first time
1184 * around, so it has been waiting for more TRBs to be freed up.
1185 *
1186 * In that case, we should check if we have a request with pending_sgs
1187 * in the started list and prepare TRBs for that request first,
1188 * otherwise we will prepare TRBs completely out of order and that will
1189 * break things.
1190 */
1191 list_for_each_entry(req, &dep->started_list, list) {
1192 if (req->num_pending_sgs > 0)
1193 dwc3_prepare_one_trb_sg(dep, req);
1194
1195 if (!dwc3_calc_trbs_left(dep))
1196 return;
1197
1198 /*
1199 * Don't prepare beyond a transfer. In DWC_usb32, its transfer
1200 * burst capability may try to read and use TRBs beyond the
1201 * active transfer instead of stopping.
1202 */
> 1203 if (dep->stream_capable && req->request.is_last)
1204 return;
1205 }
1206
1207 list_for_each_entry_safe(req, n, &dep->pending_list, list) {
1208 struct dwc3 *dwc = dep->dwc;
1209 int ret;
1210
1211 ret = usb_gadget_map_request_by_dev(dwc->sysdev, &req->request,
1212 dep->direction);
1213 if (ret)
1214 return;
1215
1216 req->sg = req->request.sg;
1217 req->start_sg = req->sg;
1218 req->num_queued_sgs = 0;
1219 req->num_pending_sgs = req->request.num_mapped_sgs;
1220
1221 if (req->num_pending_sgs > 0)
1222 dwc3_prepare_one_trb_sg(dep, req);
1223 else
1224 dwc3_prepare_one_trb_linear(dep, req);
1225
1226 if (!dwc3_calc_trbs_left(dep))
1227 return;
1228 }
1229 }
1230
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [RFC, WIP, v5 10/10] media: vidtv: Add a MPEG Transport Stream Multiplexer
by kbuild test robot
Hi "Daniel,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on next-20200515]
[cannot apply to v5.7-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Daniel-W-S-Almeida/media-vidtv-i...
base: git://linuxtv.org/media_tree.git master
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:64:43: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:174:43: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:261:43: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:297:43: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:512:50: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:513:50: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:514:50: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:702:44: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:703:44: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:704:44: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:705:44: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:852:44: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:853:44: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:854:44: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_psi.c:855:44: sparse: sparse: Using plain integer as NULL pointer
--
>> drivers/media/test-drivers/vidtv/vidtv_pes.c:83:54: sparse: sparse: missing braces around initializer
drivers/media/test-drivers/vidtv/vidtv_pes.c:84:54: sparse: sparse: missing braces around initializer
drivers/media/test-drivers/vidtv/vidtv_pes.c:142:54: sparse: sparse: missing braces around initializer
drivers/media/test-drivers/vidtv/vidtv_pes.c:143:54: sparse: sparse: missing braces around initializer
>> drivers/media/test-drivers/vidtv/vidtv_pes.c:303:59: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_pes.c:304:59: sparse: sparse: Using plain integer as NULL pointer
>> drivers/media/test-drivers/vidtv/vidtv_pes.c:96:47: sparse: sparse: shift count is negative (-1)
drivers/media/test-drivers/vidtv/vidtv_pes.c:105:47: sparse: sparse: shift count is negative (-1)
drivers/media/test-drivers/vidtv/vidtv_pes.c:117:47: sparse: sparse: shift count is negative (-1)
--
>> drivers/media/test-drivers/vidtv/vidtv_s302m.c:404:42: sparse: sparse: missing braces around initializer
drivers/media/test-drivers/vidtv/vidtv_s302m.c:427:45: sparse: sparse: missing braces around initializer
drivers/media/test-drivers/vidtv/vidtv_s302m.c:428:45: sparse: sparse: missing braces around initializer
--
>> drivers/media/test-drivers/vidtv/vidtv_channel.c:59:62: sparse: sparse: Using plain integer as NULL pointer
--
>> drivers/media/test-drivers/vidtv/vidtv_mux.c:163:39: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_mux.c:205:39: sparse: sparse: Using plain integer as NULL pointer
drivers/media/test-drivers/vidtv/vidtv_mux.c:267:47: sparse: sparse: Using plain integer as NULL pointer
vim +64 drivers/media/test-drivers/vidtv/vidtv_psi.c
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 36
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 37 static u32
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 38 vidtv_psi_ts_psi_write_into(struct psi_write_args args)
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 39 {
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 40 /*
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 41 * Packetize PSI sections into TS packets:
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 42 * push a TS header (4bytes) every 184 bytes
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 43 * manage the continuity_counter
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 44 * add stuffing after the CRC
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 45 */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 46
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 47 u32 nbytes_past_boundary = (args.dest_offset % TS_PACKET_LEN);
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 48 bool aligned = nbytes_past_boundary == 0;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 49
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 50 /*
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 51 * whether we need to fragment the data into multiple ts packets
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 52 * if we are aligned we need to spare one byte for the pointer_field
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 53 */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 54 bool split = (aligned) ?
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 55 args.len > TS_PAYLOAD_LEN - 1 :
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 56 nbytes_past_boundary + args.len > TS_PACKET_LEN;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 57
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 58 /* how much we can write in this packet */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 59 u32 payload_write_len = (split) ?
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 60 (aligned) ? TS_PAYLOAD_LEN :
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 61 TS_PACKET_LEN - nbytes_past_boundary :
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 62 args.len;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 63
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 @64 struct psi_write_args new_args = {0};
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 65 struct vidtv_mpeg_ts ts_header = {0};
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 66
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 67 u32 nbytes = 0; /* number of bytes written by this function */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 68 u32 temp = 0;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 69
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 70 /* Just a sanity check, should not really happen because we stuff
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 71 * the packet when we finish a section, i.e. when we write the crc at
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 72 * the end. But if this happens then we have messed up the logic
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 73 * somewhere.
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 74 */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 75 if (args.new_psi_section && !aligned) {
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 76 pr_warn_ratelimited("Cannot write a new PSI section in a misaligned buffer\n");
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 77
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 78 /* forcibly align and hope for the best */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 79 nbytes += vidtv_memset(args.dest_buf,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 80 args.dest_offset + nbytes,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 81 args.dest_buf_sz,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 82 TS_FILL_BYTE,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 83 TS_PACKET_LEN - nbytes_past_boundary);
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 84
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 85 aligned = true;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 86 }
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 87
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 88 if (aligned) {
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 89 /* if at a packet boundary, write a new TS header */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 90 ts_header.sync_byte = TS_SYNC_BYTE;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 91 ts_header.tei = 0;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 92 ts_header.payload_start = 1;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 93 ts_header.pid = args.pid;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 94 ts_header.priority = 0;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 95 ts_header.scrambling = 0;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 96 ts_header.continuity_counter = *args.continuity_counter;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 97 ts_header.payload = 1;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 98 /* no adaptation field */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 99 ts_header.adaptation_field = 0;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 100
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 101 /* copy the header */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 102 nbytes += vidtv_memcpy(args.dest_buf,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 103 args.dest_offset + nbytes,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 104 args.dest_buf_sz,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 105 &ts_header,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 106 sizeof(ts_header));
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 107
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 108 /*
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 109 * increment the countinuity counter since we have started a new
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 110 * packet
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 111 *
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 112 * This will trigger a discontinuity if the buffer is full,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 113 * which is what we want: the continuity counter will be
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 114 * incremented but nothing will get copied by
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 115 * vidtv_memcpy/vidtv_memset, effectively dropping the packet.
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 116 */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 117 vidtv_ts_inc_cc(args.continuity_counter);
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 118 }
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 119
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 120 if (args.new_psi_section) {
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 121 /* write the pointer_field in the first byte of the payload */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 122 temp = vidtv_memset(args.dest_buf,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 123 args.dest_offset + nbytes,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 124 args.dest_buf_sz,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 125 0x0,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 126 1);
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 127 /* one byte was used by the pointer field*/
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 128 nbytes += temp;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 129 if (payload_write_len == TS_PAYLOAD_LEN)
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 130 payload_write_len -= temp;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 131 }
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 132
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 133 /* write as much of the payload as we possibly can */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 134 nbytes += vidtv_memcpy(args.dest_buf,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 135 args.dest_offset + nbytes,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 136 args.dest_buf_sz,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 137 args.from,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 138 payload_write_len);
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 139
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 140 if (split) {
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 141 /* 'payload_write_len' written from a total of 'len' requested*/
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 142 args.len -= payload_write_len;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 143 /*
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 144 * recursively write the rest of the data until we do not
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 145 * need to split it anymore
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 146 */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 147 memcpy(&new_args, &args, sizeof(struct psi_write_args));
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 148 new_args.from = args.from + payload_write_len;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 149 new_args.dest_offset = args.dest_offset + nbytes;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 150 new_args.new_psi_section = false;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 151
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 152 nbytes += vidtv_psi_ts_psi_write_into(new_args);
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 153 }
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 154
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 155 /*
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 156 * as the CRC is last in the section, stuff the rest of the
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 157 * packet if there is any remaining space in there
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 158 */
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 159 if (args.is_crc)
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 160 nbytes += vidtv_memset(args.dest_buf,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 161 args.dest_offset + nbytes,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 162 args.dest_buf_sz,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 163 TS_FILL_BYTE,
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 164 TS_PACKET_LEN - payload_write_len);
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 165
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 166 return nbytes;
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 167 }
07dd2778c1ca46 Daniel W. S. Almeida 2020-05-15 168
:::::: The code at line 64 was first introduced by commit
:::::: 07dd2778c1ca4652a340f23dfb44bab57e1e6066 media: vidtv: implement a PSI generator
:::::: TO: Daniel W. S. Almeida <dwlsalmeida(a)gmail.com>
:::::: CC: 0day robot <lkp(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months