[ammarfaizi2-block:broonie/sound/for-next 33/44] sound/soc/sof/compress.c:91:5: warning: no previous prototype for function 'sof_compr_open'
by kernel test robot
tree: https://github.com/ammarfaizi2/linux-block broonie/sound/for-next
head: 9193bc0558d1812343039b510797b669f054efc5
commit: 6324cf901e14c6662be508f30485e0f09c54694d [33/44] ASoC: SOF: compr: Add compress ops implementation
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20220211/202202111513.hHDovgro-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f6685f774697c85d6a352dcea013f46a99f9fe31)
reproduce (this is a W=1 build):
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
# https://github.com/ammarfaizi2/linux-block/commit/6324cf901e14c6662be508f...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block broonie/sound/for-next
git checkout 6324cf901e14c6662be508f30485e0f09c54694d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash sound/soc/sof/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> sound/soc/sof/compress.c:91:5: warning: no previous prototype for function 'sof_compr_open' [-Wmissing-prototypes]
int sof_compr_open(struct snd_soc_component *component,
^
sound/soc/sof/compress.c:91:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sof_compr_open(struct snd_soc_component *component,
^
static
>> sound/soc/sof/compress.c:127:5: warning: no previous prototype for function 'sof_compr_free' [-Wmissing-prototypes]
int sof_compr_free(struct snd_soc_component *component,
^
sound/soc/sof/compress.c:127:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sof_compr_free(struct snd_soc_component *component,
^
static
>> sound/soc/sof/compress.c:161:5: warning: no previous prototype for function 'sof_compr_set_params' [-Wmissing-prototypes]
int sof_compr_set_params(struct snd_soc_component *component,
^
sound/soc/sof/compress.c:161:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sof_compr_set_params(struct snd_soc_component *component,
^
static
>> sound/soc/sof/compress.c:224:5: warning: no previous prototype for function 'sof_compr_get_params' [-Wmissing-prototypes]
int sof_compr_get_params(struct snd_soc_component *component,
^
sound/soc/sof/compress.c:224:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sof_compr_get_params(struct snd_soc_component *component,
^
static
>> sound/soc/sof/compress.c:233:5: warning: no previous prototype for function 'sof_compr_trigger' [-Wmissing-prototypes]
int sof_compr_trigger(struct snd_soc_component *component,
^
sound/soc/sof/compress.c:233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sof_compr_trigger(struct snd_soc_component *component,
^
static
>> sound/soc/sof/compress.c:273:5: warning: no previous prototype for function 'sof_compr_copy' [-Wmissing-prototypes]
int sof_compr_copy(struct snd_soc_component *component,
^
sound/soc/sof/compress.c:273:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sof_compr_copy(struct snd_soc_component *component,
^
static
6 warnings generated.
vim +/sof_compr_open +91 sound/soc/sof/compress.c
90
> 91 int sof_compr_open(struct snd_soc_component *component,
92 struct snd_compr_stream *cstream)
93 {
94 struct snd_soc_pcm_runtime *rtd = cstream->private_data;
95 struct snd_compr_runtime *crtd = cstream->runtime;
96 struct snd_compr_tstamp *tstamp;
97 struct snd_sof_pcm *spcm;
98 int dir;
99
100 tstamp = kzalloc(sizeof(*tstamp), GFP_KERNEL);
101 if (!tstamp)
102 return -ENOMEM;
103
104 spcm = snd_sof_find_spcm_dai(component, rtd);
105 if (!spcm) {
106 kfree(tstamp);
107 return -EINVAL;
108 }
109
110 dir = cstream->direction;
111
112 if (spcm->stream[dir].cstream) {
113 kfree(tstamp);
114 return -EBUSY;
115 }
116
117 spcm->stream[dir].cstream = cstream;
118 spcm->stream[dir].posn.host_posn = 0;
119 spcm->stream[dir].posn.dai_posn = 0;
120 spcm->prepared[dir] = false;
121
122 crtd->private_data = tstamp;
123
124 return 0;
125 }
126
> 127 int sof_compr_free(struct snd_soc_component *component,
128 struct snd_compr_stream *cstream)
129 {
130 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component);
131 struct snd_compr_tstamp *tstamp = cstream->runtime->private_data;
132 struct snd_soc_pcm_runtime *rtd = cstream->private_data;
133 struct sof_ipc_stream stream;
134 struct sof_ipc_reply reply;
135 struct snd_sof_pcm *spcm;
136 int ret = 0;
137
138 spcm = snd_sof_find_spcm_dai(component, rtd);
139 if (!spcm)
140 return -EINVAL;
141
142 stream.hdr.size = sizeof(stream);
143 stream.hdr.cmd = SOF_IPC_GLB_STREAM_MSG | SOF_IPC_STREAM_PCM_FREE;
144 stream.comp_id = spcm->stream[cstream->direction].comp_id;
145
146 if (spcm->prepared[cstream->direction]) {
147 ret = sof_ipc_tx_message(sdev->ipc, stream.hdr.cmd,
148 &stream, sizeof(stream),
149 &reply, sizeof(reply));
150 if (!ret)
151 spcm->prepared[cstream->direction] = false;
152 }
153
154 cancel_work_sync(&spcm->stream[cstream->direction].period_elapsed_work);
155 spcm->stream[cstream->direction].cstream = NULL;
156 kfree(tstamp);
157
158 return ret;
159 }
160
> 161 int sof_compr_set_params(struct snd_soc_component *component,
162 struct snd_compr_stream *cstream, struct snd_compr_params *params)
163 {
164 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component);
165 struct snd_soc_pcm_runtime *rtd = cstream->private_data;
166 struct snd_compr_runtime *crtd = cstream->runtime;
167 struct sof_ipc_pcm_params_reply ipc_params_reply;
168 struct snd_compr_tstamp *tstamp;
169 struct sof_ipc_pcm_params pcm;
170 struct snd_sof_pcm *spcm;
171 int ret;
172
173 tstamp = crtd->private_data;
174
175 spcm = snd_sof_find_spcm_dai(component, rtd);
176
177 if (!spcm)
178 return -EINVAL;
179
180 cstream->dma_buffer.dev.type = SNDRV_DMA_TYPE_DEV_SG;
181 cstream->dma_buffer.dev.dev = sdev->dev;
182 ret = snd_compr_malloc_pages(cstream, crtd->buffer_size);
183 if (ret < 0)
184 return ret;
185
186 ret = create_page_table(component, cstream, crtd->dma_area, crtd->dma_bytes);
187 if (ret < 0)
188 return ret;
189
190 memset(&pcm, 0, sizeof(pcm));
191
192 pcm.params.buffer.pages = PFN_UP(crtd->dma_bytes);
193 pcm.hdr.size = sizeof(pcm);
194 pcm.hdr.cmd = SOF_IPC_GLB_STREAM_MSG | SOF_IPC_STREAM_PCM_PARAMS;
195
196 pcm.comp_id = spcm->stream[cstream->direction].comp_id;
197 pcm.params.hdr.size = sizeof(pcm.params);
198 pcm.params.buffer.phy_addr = spcm->stream[cstream->direction].page_table.addr;
199 pcm.params.buffer.size = crtd->dma_bytes;
200 pcm.params.direction = cstream->direction;
201 pcm.params.channels = params->codec.ch_out;
202 pcm.params.rate = params->codec.sample_rate;
203 pcm.params.buffer_fmt = SOF_IPC_BUFFER_INTERLEAVED;
204 pcm.params.frame_fmt = SOF_IPC_FRAME_S32_LE;
205 pcm.params.sample_container_bytes =
206 snd_pcm_format_physical_width(SNDRV_PCM_FORMAT_S32) >> 3;
207 pcm.params.host_period_bytes = params->buffer.fragment_size;
208
209 ret = sof_ipc_tx_message(sdev->ipc, pcm.hdr.cmd, &pcm, sizeof(pcm),
210 &ipc_params_reply, sizeof(ipc_params_reply));
211 if (ret < 0) {
212 dev_err(component->dev, "error ipc failed\n");
213 return ret;
214 }
215
216 tstamp->byte_offset = sdev->stream_box.offset + ipc_params_reply.posn_offset;
217 tstamp->sampling_rate = params->codec.sample_rate;
218
219 spcm->prepared[cstream->direction] = true;
220
221 return 0;
222 }
223
> 224 int sof_compr_get_params(struct snd_soc_component *component,
225 struct snd_compr_stream *cstream, struct snd_codec *params)
226 {
227 /* TODO: we don't query the supported codecs for now, if the
228 * application asks for an unsupported codec the set_params() will fail.
229 */
230 return 0;
231 }
232
> 233 int sof_compr_trigger(struct snd_soc_component *component,
234 struct snd_compr_stream *cstream, int cmd)
235 {
236 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component);
237 struct snd_soc_pcm_runtime *rtd = cstream->private_data;
238 struct sof_ipc_stream stream;
239 struct sof_ipc_reply reply;
240 struct snd_sof_pcm *spcm;
241
242 spcm = snd_sof_find_spcm_dai(component, rtd);
243 if (!spcm)
244 return -EINVAL;
245
246 stream.hdr.size = sizeof(stream);
247 stream.hdr.cmd = SOF_IPC_GLB_STREAM_MSG;
248 stream.comp_id = spcm->stream[cstream->direction].comp_id;
249
250 switch (cmd) {
251 case SNDRV_PCM_TRIGGER_START:
252 stream.hdr.cmd |= SOF_IPC_STREAM_TRIG_START;
253 break;
254 case SNDRV_PCM_TRIGGER_STOP:
255 stream.hdr.cmd |= SOF_IPC_STREAM_TRIG_STOP;
256 break;
257 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
258 stream.hdr.cmd |= SOF_IPC_STREAM_TRIG_PAUSE;
259 break;
260 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
261 stream.hdr.cmd |= SOF_IPC_STREAM_TRIG_RELEASE;
262 break;
263 default:
264 dev_err(component->dev, "error: unhandled trigger cmd %d\n", cmd);
265 break;
266 }
267
268 return sof_ipc_tx_message(sdev->ipc, stream.hdr.cmd,
269 &stream, sizeof(stream),
270 &reply, sizeof(reply));
271 }
272
> 273 int sof_compr_copy(struct snd_soc_component *component,
274 struct snd_compr_stream *cstream,
275 char __user *buf, size_t count)
276 {
277 struct snd_compr_runtime *rtd = cstream->runtime;
278 unsigned int offset, n;
279 void *ptr;
280 int ret;
281
282 if (count > rtd->buffer_size)
283 count = rtd->buffer_size;
284
285 div_u64_rem(rtd->total_bytes_available, rtd->buffer_size, &offset);
286 ptr = rtd->dma_area + offset;
287 n = rtd->buffer_size - offset;
288
289 if (count < n) {
290 ret = copy_from_user(ptr, buf, count);
291 } else {
292 ret = copy_from_user(ptr, buf, n);
293 ret += copy_from_user(rtd->dma_area, buf + n, count - n);
294 }
295
296 return count - ret;
297 }
298
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[avpatel:riscv_sbi_hsm_suspend_v11 6/8] drivers/cpuidle/cpuidle-riscv-sbi.c:350:5: warning: format specifies type 'long' but the argument has type 'int'
by kernel test robot
tree: https://github.com/avpatel/linux.git riscv_sbi_hsm_suspend_v11
head: 23c200d61b016e3b70c0f352ee89d8ff0511ba82
commit: 64abac12078cac4dcf481c1cb8f4bc72d9049bae [6/8] cpuidle: Add RISC-V SBI CPU idle driver
config: riscv-randconfig-r016-20220211 (https://download.01.org/0day-ci/archive/20220211/202202111542.VlZojqDX-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f6685f774697c85d6a352dcea013f46a99f9fe31)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/avpatel/linux/commit/64abac12078cac4dcf481c1cb8f4bc72d...
git remote add avpatel https://github.com/avpatel/linux.git
git fetch --no-tags avpatel riscv_sbi_hsm_suspend_v11
git checkout 64abac12078cac4dcf481c1cb8f4bc72d9049bae
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/cpuidle/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/cpuidle/cpuidle-riscv-sbi.c:350:5: error: implicit declaration of function 'cpuid_to_hartid_map' [-Werror,-Wimplicit-function-declaration]
cpuid_to_hartid_map(cpu));
^
>> drivers/cpuidle/cpuidle-riscv-sbi.c:350:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
cpuid_to_hartid_map(cpu));
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:576:38: note: expanded from macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:132:17: note: expanded from macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/printk.h:446:60: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
~~~~ ^~~~~~~~~~~
drivers/cpuidle/cpuidle-riscv-sbi.c:359:10: error: implicit declaration of function 'cpuid_to_hartid_map' [-Werror,-Wimplicit-function-declaration]
cpuid_to_hartid_map(cpu));
^
drivers/cpuidle/cpuidle-riscv-sbi.c:359:10: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
cpuid_to_hartid_map(cpu));
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:489:33: note: expanded from macro 'pr_err'
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:446:60: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
~~~~ ^~~~~~~~~~~
drivers/cpuidle/cpuidle-riscv-sbi.c:567:6: error: implicit declaration of function 'cpuid_to_hartid_map' [-Werror,-Wimplicit-function-declaration]
cpuid_to_hartid_map(cpu));
^
drivers/cpuidle/cpuidle-riscv-sbi.c:567:6: warning: format specifies type 'long' but the argument has type 'int' [-Wformat]
cpuid_to_hartid_map(cpu));
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:576:38: note: expanded from macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:132:17: note: expanded from macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/printk.h:446:60: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
~~~~ ^~~~~~~~~~~
3 warnings and 3 errors generated.
vim +350 drivers/cpuidle/cpuidle-riscv-sbi.c
317
318 static int sbi_cpuidle_init_cpu(struct device *dev, int cpu)
319 {
320 struct cpuidle_driver *drv;
321 unsigned int state_count = 0;
322 int ret = 0;
323
324 drv = devm_kzalloc(dev, sizeof(*drv), GFP_KERNEL);
325 if (!drv)
326 return -ENOMEM;
327
328 drv->name = "sbi_cpuidle";
329 drv->owner = THIS_MODULE;
330 drv->cpumask = (struct cpumask *)cpumask_of(cpu);
331
332 /* RISC-V architectural WFI to be represented as state index 0. */
333 drv->states[0].enter = sbi_cpuidle_enter_state;
334 drv->states[0].exit_latency = 1;
335 drv->states[0].target_residency = 1;
336 drv->states[0].power_usage = UINT_MAX;
337 strcpy(drv->states[0].name, "WFI");
338 strcpy(drv->states[0].desc, "RISC-V WFI");
339
340 /*
341 * If no DT idle states are detected (ret == 0) let the driver
342 * initialization fail accordingly since there is no reason to
343 * initialize the idle driver if only wfi is supported, the
344 * default archictectural back-end already executes wfi
345 * on idle entry.
346 */
347 ret = dt_init_idle_driver(drv, sbi_cpuidle_state_match, 1);
348 if (ret <= 0) {
349 pr_debug("HART%ld: failed to parse DT idle states\n",
> 350 cpuid_to_hartid_map(cpu));
351 return ret ? : -ENODEV;
352 }
353 state_count = ret + 1; /* Include WFI state as well */
354
355 /* Initialize idle states from DT. */
356 ret = sbi_cpuidle_dt_init_states(dev, drv, cpu, state_count);
357 if (ret) {
358 pr_err("HART%ld: failed to init idle states\n",
359 cpuid_to_hartid_map(cpu));
360 return ret;
361 }
362
363 ret = cpuidle_register(drv, NULL);
364 if (ret)
365 goto deinit;
366
367 cpuidle_cooling_register(drv);
368
369 return 0;
370 deinit:
371 sbi_cpuidle_deinit_cpu(cpu);
372 return ret;
373 }
374
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[jlayton:ceph-fscrypt 57/57] net/ceph/messenger_v2.c:1787:5: error: incomplete definition of type 'struct cepn_connection'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git ceph-fscrypt
head: adf69efebc954db1aa7af7b93febbc2a1b51dc6c
commit: adf69efebc954db1aa7af7b93febbc2a1b51dc6c [57/57] libceph: define a structure to track SPARSE_READ reply processing
config: i386-randconfig-a015 (https://download.01.org/0day-ci/archive/20220211/202202111558.NeRjba8E-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f6685f774697c85d6a352dcea013f46a99f9fe31)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/commit/...
git remote add jlayton https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git
git fetch --no-tags jlayton ceph-fscrypt
git checkout adf69efebc954db1aa7af7b93febbc2a1b51dc6c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash net/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
net/ceph/messenger_v2.c:1783:37: warning: declaration of 'struct cepn_connection' will not be visible outside of this function [-Wvisibility]
static int prepare_read_data(struct cepn_connection *con)
^
>> net/ceph/messenger_v2.c:1787:5: error: incomplete definition of type 'struct cepn_connection'
con->in_data_crc = -1;
~~~^
net/ceph/messenger_v2.c:1783:37: note: forward declaration of 'struct cepn_connection'
static int prepare_read_data(struct cepn_connection *con)
^
net/ceph/messenger_v2.c:1788:47: error: incomplete definition of type 'struct cepn_connection'
ret = prepare_read_data_len(con, data_len(con->in_msg));
~~~^
net/ceph/messenger_v2.c:1783:37: note: forward declaration of 'struct cepn_connection'
static int prepare_read_data(struct cepn_connection *con)
^
net/ceph/messenger_v2.c:1790:6: error: incomplete definition of type 'struct cepn_connection'
con->v2.in_state = IN_S_PREPARE_READ_DATA_CONT;
~~~^
net/ceph/messenger_v2.c:1783:37: note: forward declaration of 'struct cepn_connection'
static int prepare_read_data(struct cepn_connection *con)
^
>> net/ceph/messenger_v2.c:1842:24: error: use of undeclared identifier 'iter'
if (!iov_iter_is_bvec(iter))
^
>> net/ceph/messenger_v2.c:1881:10: error: implicit declaration of function 'handle_epilogue' [-Werror,-Wimplicit-function-declaration]
return handle_epilogue(con);
^
net/ceph/messenger_v2.c:1881:10: note: did you mean 'decode_epilogue'?
net/ceph/messenger_v2.c:573:12: note: 'decode_epilogue' declared here
static int decode_epilogue(void *p, u32 *front_crc, u32 *middle_crc,
^
net/ceph/messenger_v2.c:1898:24: error: use of undeclared identifier 'iter'
if (!iov_iter_is_kvec(iter))
^
>> net/ceph/messenger_v2.c:1951:28: error: incompatible pointer types passing 'struct ceph_connection *' to parameter of type 'struct cepn_connection *' [-Werror,-Wincompatible-pointer-types]
return prepare_read_data(con);
^~~
net/ceph/messenger_v2.c:1783:54: note: passing argument to parameter 'con' here
static int prepare_read_data(struct cepn_connection *con)
^
net/ceph/messenger_v2.c:2938:12: error: static declaration of 'handle_epilogue' follows non-static declaration
static int handle_epilogue(struct ceph_connection *con)
^
net/ceph/messenger_v2.c:1881:10: note: previous implicit declaration is here
return handle_epilogue(con);
^
net/ceph/messenger_v2.c:3012:28: error: incompatible pointer types passing 'struct ceph_connection *' to parameter of type 'struct cepn_connection *' [-Werror,-Wincompatible-pointer-types]
ret = prepare_read_data(con);
^~~
net/ceph/messenger_v2.c:1783:54: note: passing argument to parameter 'con' here
static int prepare_read_data(struct cepn_connection *con)
^
>> net/ceph/messenger_v2.c:3014:8: error: use of undeclared identifier 'IN_S_PREPARE_READ_SPARSE_DATA'
case IN_S_PREPARE_READ_SPARSE_DATA:
^
1 warning and 10 errors generated.
vim +1787 net/ceph/messenger_v2.c
1782
1783 static int prepare_read_data(struct cepn_connection *con)
1784 {
1785 int ret;
1786
> 1787 con->in_data_crc = -1;
1788 ret = prepare_read_data_len(con, data_len(con->in_msg));
1789 if (ret == 0)
1790 con->v2.in_state = IN_S_PREPARE_READ_DATA_CONT;
1791 return ret;
1792 }
1793
1794 static void prepare_read_data_cont(struct ceph_connection *con)
1795 {
1796 struct bio_vec bv;
1797
1798 if (ceph_test_opt(from_msgr(con->msgr), RXBOUNCE)) {
1799 con->in_data_crc = crc32c(con->in_data_crc,
1800 page_address(con->bounce_page),
1801 con->v2.in_bvec.bv_len);
1802
1803 get_bvec_at(&con->v2.in_cursor, &bv);
1804 memcpy_to_page(bv.bv_page, bv.bv_offset,
1805 page_address(con->bounce_page),
1806 con->v2.in_bvec.bv_len);
1807 } else {
1808 con->in_data_crc = ceph_crc32c_page(con->in_data_crc,
1809 con->v2.in_bvec.bv_page,
1810 con->v2.in_bvec.bv_offset,
1811 con->v2.in_bvec.bv_len);
1812 }
1813
1814 ceph_msg_data_advance(&con->v2.in_cursor, con->v2.in_bvec.bv_len);
1815 if (con->v2.in_cursor.total_resid) {
1816 get_bvec_at(&con->v2.in_cursor, &bv);
1817 if (ceph_test_opt(from_msgr(con->msgr), RXBOUNCE)) {
1818 bv.bv_page = con->bounce_page;
1819 bv.bv_offset = 0;
1820 }
1821 set_in_bvec(con, &bv);
1822 WARN_ON(con->v2.in_state != IN_S_PREPARE_READ_DATA_CONT);
1823 return;
1824 }
1825
1826 /*
1827 * We've read all data. Prepare to read epilogue.
1828 */
1829 reset_in_kvecs(con);
1830 add_in_kvec(con, con->v2.in_buf, CEPH_EPILOGUE_PLAIN_LEN);
1831 con->v2.in_state = IN_S_HANDLE_EPILOGUE;
1832 }
1833
1834 static int prepare_sparse_read_data_cont(struct ceph_connection *con)
1835 {
1836 int ret;
1837 struct bio_vec bv;
1838 char *buf = NULL;
1839 struct iov_iter *in_iter = &con->v2.in_iter;
1840 u64 off = 0, len = 0;
1841
> 1842 if (!iov_iter_is_bvec(iter))
1843 return -EIO;
1844
1845 if (ceph_test_opt(from_msgr(con->msgr), RXBOUNCE)) {
1846 con->in_data_crc = crc32c(con->in_data_crc,
1847 page_address(con->bounce_page),
1848 con->v2.in_bvec.bv_len);
1849
1850 get_bvec_at(&con->v2.in_cursor, &bv);
1851 memcpy_to_page(bv.bv_page, bv.bv_offset,
1852 page_address(con->bounce_page),
1853 con->v2.in_bvec.bv_len);
1854 } else {
1855 con->in_data_crc = ceph_crc32c_page(con->in_data_crc,
1856 con->v2.in_bvec.bv_page,
1857 con->v2.in_bvec.bv_offset,
1858 con->v2.in_bvec.bv_len);
1859 }
1860
1861 if (con->v2.in_cursor.total_resid) {
1862 get_bvec_at(&con->v2.in_cursor, &bv);
1863 if (ceph_test_opt(from_msgr(con->msgr), RXBOUNCE)) {
1864 bv.bv_page = con->bounce_page;
1865 bv.bv_offset = 0;
1866 }
1867 set_in_bvec(con, &bv);
1868 WARN_ON(con->v2.in_state != IN_S_PREPARE_SPARSE_DATA_CONT);
1869 return 0;
1870 }
1871
1872 /* get next extent */
1873 ret = con->ops->sparse_read(con, &off, &len, &buf);
1874 if (ret <= 0) {
1875 if (ret < 0)
1876 return ret;
1877
1878 reset_in_kvecs(con);
1879 add_in_kvec(con, con->v2.in_buf, CEPH_EPILOGUE_PLAIN_LEN);
1880 con->v2.in_state = IN_S_HANDLE_EPILOGUE;
> 1881 return handle_epilogue(con);
1882 }
1883
1884 ret = prepare_read_data_len(con, off + len);
1885 if (!ret)
1886 ceph_msg_data_advance(&con->v2.in_cursor, off);
1887 return ret;
1888 }
1889
1890 static int prepare_sparse_read_header(struct ceph_connection *con)
1891 {
1892 int ret;
1893 struct bio_vec bv;
1894 char *buf = NULL;
1895 struct iov_iter *in_iter = &con->v2.in_iter;
1896 u64 off = 0, len = 0;
1897
1898 if (!iov_iter_is_kvec(iter))
1899 return -EIO;
1900
1901 /* On first call, we have no kvec so don't compute crc */
1902 if (con->v2.in_kvec_cnt) {
1903 WARN_ON_ONCE(con->v2.in_kvec_cnt > 1);
1904 con->in_data_crc = crc32c(con->in_data_crc,
1905 con->v2.in_kvecs[0].iov_base,
1906 con->v2.in_kvecs[0].iov_len);
1907 }
1908
1909 ret = con->ops->sparse_read(con, &off, &len, &buf);
1910 if (ret < 0)
1911 return ret;
1912
1913 /* No actual data? */
1914 if (WARN_ON_ONCE(!ret))
1915 return -EIO;
1916
1917 if (!buf) {
1918 ret = prepare_read_data_len(con, off + len);
1919 if (!ret) {
1920 ceph_msg_data_advance(&con->v2.in_cursor, off);
1921 con->v2.in_state = IN_S_PREPARE_SPARSE_DATA_CONT;
1922 }
1923 return ret;
1924 }
1925
1926 WARN_ON_ONCE(con->v2.in_state != IN_S_PREPARE_SPARSE_DATA_HDR);
1927 reset_in_kvecs(con);
1928 add_in_kvec(con, buf, len);
1929 return 0;
1930 }
1931
1932 static int prepare_sparse_read_data(struct ceph_connection *con)
1933 {
1934 if (WARN_ON_ONCE(!con->ops->sparse_read))
1935 return -EOPNOTSUPP;
1936
1937 if (!con_secure(con))
1938 con->in_data_crc = -1;
1939
1940 reset_in_kvecs(con);
1941 con->v2.in_state = IN_S_PREPARE_SPARSE_DATA_HDR;
1942 return prepare_sparse_read_header(con);
1943 }
1944
1945 static int prepare_read_tail_plain(struct ceph_connection *con)
1946 {
1947 struct ceph_msg *msg = con->in_msg;
1948
1949 if (!front_len(msg) && !middle_len(msg)) {
1950 WARN_ON(!data_len(msg));
> 1951 return prepare_read_data(con);
1952 }
1953
1954 reset_in_kvecs(con);
1955 if (front_len(msg)) {
1956 add_in_kvec(con, msg->front.iov_base, front_len(msg));
1957 WARN_ON(msg->front.iov_len != front_len(msg));
1958 }
1959 if (middle_len(msg)) {
1960 add_in_kvec(con, msg->middle->vec.iov_base, middle_len(msg));
1961 WARN_ON(msg->middle->vec.iov_len != middle_len(msg));
1962 }
1963
1964 if (data_len(msg)) {
1965 if (msg->sparse_read)
1966 con->v2.in_state = IN_S_PREPARE_SPARSE_DATA;
1967 else
1968 con->v2.in_state = IN_S_PREPARE_READ_DATA;
1969 } else {
1970 add_in_kvec(con, con->v2.in_buf, CEPH_EPILOGUE_PLAIN_LEN);
1971 con->v2.in_state = IN_S_HANDLE_EPILOGUE;
1972 }
1973 return 0;
1974 }
1975
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[jlayton:ceph-fscrypt 57/57] net/ceph/messenger_v2.c:1783:37: warning: 'struct cepn_connection' declared inside parameter list will not be visible outside of this definition or declaration
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git ceph-fscrypt
head: adf69efebc954db1aa7af7b93febbc2a1b51dc6c
commit: adf69efebc954db1aa7af7b93febbc2a1b51dc6c [57/57] libceph: define a structure to track SPARSE_READ reply processing
config: x86_64-randconfig-a015 (https://download.01.org/0day-ci/archive/20220211/202202111451.CXV1VUqM-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/commit/...
git remote add jlayton https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git
git fetch --no-tags jlayton ceph-fscrypt
git checkout adf69efebc954db1aa7af7b93febbc2a1b51dc6c
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash net/ceph/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> net/ceph/messenger_v2.c:1783:37: warning: 'struct cepn_connection' declared inside parameter list will not be visible outside of this definition or declaration
1783 | static int prepare_read_data(struct cepn_connection *con)
| ^~~~~~~~~~~~~~~
net/ceph/messenger_v2.c: In function 'prepare_read_data':
net/ceph/messenger_v2.c:1787:5: error: dereferencing pointer to incomplete type 'struct cepn_connection'
1787 | con->in_data_crc = -1;
| ^~
net/ceph/messenger_v2.c:1788:30: error: passing argument 1 of 'prepare_read_data_len' from incompatible pointer type [-Werror=incompatible-pointer-types]
1788 | ret = prepare_read_data_len(con, data_len(con->in_msg));
| ^~~
| |
| struct cepn_connection *
net/ceph/messenger_v2.c:1759:58: note: expected 'struct ceph_connection *' but argument is of type 'struct cepn_connection *'
1759 | static int prepare_read_data_len(struct ceph_connection *con, int len)
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~
net/ceph/messenger_v2.c: In function 'prepare_sparse_read_data_cont':
net/ceph/messenger_v2.c:1842:24: error: 'iter' undeclared (first use in this function)
1842 | if (!iov_iter_is_bvec(iter))
| ^~~~
net/ceph/messenger_v2.c:1842:24: note: each undeclared identifier is reported only once for each function it appears in
net/ceph/messenger_v2.c:1881:10: error: implicit declaration of function 'handle_epilogue'; did you mean 'decode_epilogue'? [-Werror=implicit-function-declaration]
1881 | return handle_epilogue(con);
| ^~~~~~~~~~~~~~~
| decode_epilogue
net/ceph/messenger_v2.c:1839:19: warning: unused variable 'in_iter' [-Wunused-variable]
1839 | struct iov_iter *in_iter = &con->v2.in_iter;
| ^~~~~~~
net/ceph/messenger_v2.c: In function 'prepare_sparse_read_header':
net/ceph/messenger_v2.c:1898:24: error: 'iter' undeclared (first use in this function)
1898 | if (!iov_iter_is_kvec(iter))
| ^~~~
net/ceph/messenger_v2.c:1895:19: warning: unused variable 'in_iter' [-Wunused-variable]
1895 | struct iov_iter *in_iter = &con->v2.in_iter;
| ^~~~~~~
net/ceph/messenger_v2.c:1893:17: warning: unused variable 'bv' [-Wunused-variable]
1893 | struct bio_vec bv;
| ^~
net/ceph/messenger_v2.c: In function 'prepare_read_tail_plain':
net/ceph/messenger_v2.c:1951:28: error: passing argument 1 of 'prepare_read_data' from incompatible pointer type [-Werror=incompatible-pointer-types]
1951 | return prepare_read_data(con);
| ^~~
| |
| struct ceph_connection *
net/ceph/messenger_v2.c:1783:54: note: expected 'struct cepn_connection *' but argument is of type 'struct ceph_connection *'
1783 | static int prepare_read_data(struct cepn_connection *con)
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~
net/ceph/messenger_v2.c: At top level:
net/ceph/messenger_v2.c:2938:12: error: static declaration of 'handle_epilogue' follows non-static declaration
2938 | static int handle_epilogue(struct ceph_connection *con)
| ^~~~~~~~~~~~~~~
net/ceph/messenger_v2.c:1881:10: note: previous implicit declaration of 'handle_epilogue' was here
1881 | return handle_epilogue(con);
| ^~~~~~~~~~~~~~~
net/ceph/messenger_v2.c: In function 'populate_in_iter':
net/ceph/messenger_v2.c:3012:28: error: passing argument 1 of 'prepare_read_data' from incompatible pointer type [-Werror=incompatible-pointer-types]
3012 | ret = prepare_read_data(con);
| ^~~
| |
| struct ceph_connection *
net/ceph/messenger_v2.c:1783:54: note: expected 'struct cepn_connection *' but argument is of type 'struct ceph_connection *'
1783 | static int prepare_read_data(struct cepn_connection *con)
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~
net/ceph/messenger_v2.c:3014:8: error: 'IN_S_PREPARE_READ_SPARSE_DATA' undeclared (first use in this function); did you mean 'IN_S_PREPARE_SPARSE_DATA'?
3014 | case IN_S_PREPARE_READ_SPARSE_DATA:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| IN_S_PREPARE_SPARSE_DATA
At top level:
net/ceph/messenger_v2.c:1834:12: warning: 'prepare_sparse_read_data_cont' defined but not used [-Wunused-function]
1834 | static int prepare_sparse_read_data_cont(struct ceph_connection *con)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +1783 net/ceph/messenger_v2.c
1782
> 1783 static int prepare_read_data(struct cepn_connection *con)
1784 {
1785 int ret;
1786
1787 con->in_data_crc = -1;
1788 ret = prepare_read_data_len(con, data_len(con->in_msg));
1789 if (ret == 0)
1790 con->v2.in_state = IN_S_PREPARE_READ_DATA_CONT;
1791 return ret;
1792 }
1793
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week