Hi Rishabh, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linux/master] [also build test WARNING on linus/master v5.8-rc2 next-20200624] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Rishabh-Bhatnagar/Extend-coredump-functionality/20200624-092759 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5e857ce6eae7ca21b2055cca4885545e29228fe2 config: i386-randconfig-a011-20200624 (attached as .config) compiler: gcc-9 (Debian 9.3.0-13) 9.3.0 reproduce (this is a W=1 build): # save the attached .config to linux build tree make W=1 ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All warnings (new ones prefixed by >>): In file included from include/linux/export.h:43, from include/linux/linkage.h:7, from include/linux/kernel.h:8, from include/linux/list.h:9, from include/linux/swait.h:5, from include/linux/completion.h:12, from drivers/remoteproc/remoteproc_coredump.c:8: drivers/remoteproc/remoteproc_coredump.c: In function 'rproc_coredump_read': drivers/remoteproc/remoteproc_coredump.c:186:15: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 186 | if (copy_sz < 0) | ^ include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var' 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | ^~~~ >> drivers/remoteproc/remoteproc_coredump.c:186:3: note: in expansion of macro 'if' 186 | if (copy_sz < 0) | ^~ drivers/remoteproc/remoteproc_coredump.c:186:15: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 186 | if (copy_sz < 0) | ^ include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var' 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | ^~~~ >> drivers/remoteproc/remoteproc_coredump.c:186:3: note: in expansion of macro 'if' 186 | if (copy_sz < 0) | ^~ drivers/remoteproc/remoteproc_coredump.c:186:15: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 186 | if (copy_sz < 0) | ^ include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value' 69 | (cond) ? \ | ^~~~ include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | ^~~~~~~~~~~~~~ >> drivers/remoteproc/remoteproc_coredump.c:186:3: note: in expansion of macro 'if' 186 | if (copy_sz < 0) | ^~ vim +/if +186 drivers/remoteproc/remoteproc_coredump.c 171 172 static ssize_t rproc_coredump_read(char *buffer, loff_t offset, size_t count, 173 void *data, size_t header_sz) 174 { 175 size_t seg_data; 176 size_t copy_sz, bytes_left = count; 177 struct rproc_dump_segment *seg; 178 struct rproc_coredump_state *dump_state = data; 179 struct rproc *rproc = dump_state->rproc; 180 void *elfcore = dump_state->header; 181 182 /* Copy the vmalloc'ed header first. */ 183 if (offset < header_sz) { 184 copy_sz = memory_read_from_buffer(buffer, count, &offset, 185 elfcore, header_sz); > 186 if (copy_sz < 0) 187 return -EINVAL; 188 189 return copy_sz; 190 } 191 192 /* 193 * Find out the segment memory chunk to be copied based on offset. 194 * Keep copying data until count bytes are read. 195 */ 196 while (bytes_left) { 197 seg = rproc_coredump_find_segment(offset - header_sz, 198 &rproc->dump_segments, 199 &seg_data); 200 /* EOF check */ 201 if (!seg) { 202 dev_info(&rproc->dev, "Ramdump done, %lld bytes read", 203 offset); 204 break; 205 } 206 207 copy_sz = min_t(size_t, bytes_left, seg_data); 208 209 rproc_copy_segment(rproc, buffer, seg, seg->size - seg_data, 210 copy_sz); 211 212 offset += copy_sz; 213 buffer += copy_sz; 214 bytes_left -= copy_sz; 215 } 216 217 return count - bytes_left; 218 } 219 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip