* [freescale-fslc:pr/341 14836/18812] drivers/misc/mic/scif/scif_api.c:1101:30: warning: left shift count >= width of type
@ 2021-05-19 3:06 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-19 3:06 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 11802 bytes --]
tree: https://github.com/Freescale/linux-fslc pr/341
head: a9cd93bab1195c192188b78911e8e2bf47cfd6c2
commit: 36c9b7a8085cc507a15927a4e333bc7778f6c9b3 [14836/18812] MLK-24937-2 misc: mic: add the correct dependencies and fix build errors for COSM/SCIF modules
config: ia64-randconfig-r032-20210519 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
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://github.com/Freescale/linux-fslc/commit/36c9b7a8085cc507a15927a4e333bc7778f6c9b3
git remote add freescale-fslc https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc pr/341
git checkout 36c9b7a8085cc507a15927a4e333bc7778f6c9b3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/misc/mic/scif/scif_api.c: In function '_scif_recv':
drivers/misc/mic/scif/scif_api.c:1000:6: warning: variable 'read_size' set but not used [-Wunused-but-set-variable]
1000 | int read_size;
| ^~~~~~~~~
In file included from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/ktime.h:24,
from include/linux/poll.h:7,
from include/linux/scif.h:57,
from drivers/misc/mic/scif/scif_api.c:9:
drivers/misc/mic/scif/scif_api.c: In function 'scif_user_send':
>> drivers/misc/mic/scif/scif_api.c:1101:30: warning: left shift count >= width of type [-Wshift-count-overflow]
1101 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~
include/linux/kernel.h:858:34: note: in definition of macro '__cmp'
858 | #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
| ^
include/linux/kernel.h:875:19: note: in expansion of macro '__careful_cmp'
875 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
drivers/misc/mic/scif/scif_api.c:1101:18: note: in expansion of macro 'min'
1101 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~~
>> drivers/misc/mic/scif/scif_api.c:1101:30: warning: left shift count >= width of type [-Wshift-count-overflow]
1101 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~
include/linux/kernel.h:858:46: note: in definition of macro '__cmp'
858 | #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
| ^
include/linux/kernel.h:875:19: note: in expansion of macro '__careful_cmp'
875 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
drivers/misc/mic/scif/scif_api.c:1101:18: note: in expansion of macro 'min'
1101 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~~
>> drivers/misc/mic/scif/scif_api.c:1101:30: warning: left shift count >= width of type [-Wshift-count-overflow]
1101 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~
include/linux/kernel.h:862:25: note: in definition of macro '__cmp_once'
862 | typeof(y) unique_y = (y); \
| ^
include/linux/kernel.h:875:19: note: in expansion of macro '__careful_cmp'
875 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
drivers/misc/mic/scif/scif_api.c:1101:18: note: in expansion of macro 'min'
1101 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~~
drivers/misc/mic/scif/scif_api.c: In function 'scif_user_recv':
drivers/misc/mic/scif/scif_api.c:1162:30: warning: left shift count >= width of type [-Wshift-count-overflow]
1162 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~
include/linux/kernel.h:858:34: note: in definition of macro '__cmp'
858 | #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
| ^
include/linux/kernel.h:875:19: note: in expansion of macro '__careful_cmp'
875 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
drivers/misc/mic/scif/scif_api.c:1162:18: note: in expansion of macro 'min'
1162 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~~
drivers/misc/mic/scif/scif_api.c:1162:30: warning: left shift count >= width of type [-Wshift-count-overflow]
1162 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~
include/linux/kernel.h:858:46: note: in definition of macro '__cmp'
858 | #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
| ^
include/linux/kernel.h:875:19: note: in expansion of macro '__careful_cmp'
875 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
drivers/misc/mic/scif/scif_api.c:1162:18: note: in expansion of macro 'min'
1162 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~~
drivers/misc/mic/scif/scif_api.c:1162:30: warning: left shift count >= width of type [-Wshift-count-overflow]
1162 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~
include/linux/kernel.h:862:25: note: in definition of macro '__cmp_once'
862 | typeof(y) unique_y = (y); \
| ^
include/linux/kernel.h:875:19: note: in expansion of macro '__careful_cmp'
875 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
drivers/misc/mic/scif/scif_api.c:1162:18: note: in expansion of macro 'min'
1162 | int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
| ^~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for FRAME_POINTER
Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
Selected by
- FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86
vim +1101 drivers/misc/mic/scif/scif_api.c
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1083
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1084 /**
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1085 * scif_user_send() - Send data to connection queue
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1086 * @epd: The end point returned from scif_open()
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1087 * @msg: Address to place data
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1088 * @len: Length to receive
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1089 * @flags: blocking or non blocking
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1090 *
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1091 * This function is called from the driver IOCTL entry point
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1092 * only and is a wrapper for _scif_send().
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1093 */
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1094 int scif_user_send(scif_epd_t epd, void __user *msg, int len, int flags)
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1095 {
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1096 struct scif_endpt *ep = (struct scif_endpt *)epd;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1097 int err = 0;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1098 int sent_len = 0;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1099 char *tmp;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1100 int loop_len;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 @1101 int chunk_len = min(len, (1 << (MAX_ORDER + PAGE_SHIFT - 1)));
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1102
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1103 dev_dbg(scif_info.mdev.this_device,
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1104 "SCIFAPI send (U): ep %p %s\n", ep, scif_ep_states[ep->state]);
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1105 if (!len)
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1106 return 0;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1107
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1108 err = scif_msg_param_check(epd, len, flags);
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1109 if (err)
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1110 goto send_err;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1111
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1112 tmp = kmalloc(chunk_len, GFP_KERNEL);
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1113 if (!tmp) {
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1114 err = -ENOMEM;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1115 goto send_err;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1116 }
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1117 /*
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1118 * Grabbing the lock before breaking up the transfer in
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1119 * multiple chunks is required to ensure that messages do
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1120 * not get fragmented and reordered.
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1121 */
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1122 mutex_lock(&ep->sendlock);
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1123 while (sent_len != len) {
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1124 loop_len = len - sent_len;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1125 loop_len = min(chunk_len, loop_len);
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1126 if (copy_from_user(tmp, msg, loop_len)) {
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1127 err = -EFAULT;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1128 goto send_free_err;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1129 }
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1130 err = _scif_send(epd, tmp, loop_len, flags);
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1131 if (err < 0)
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1132 goto send_free_err;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1133 sent_len += err;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1134 msg += err;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1135 if (err != loop_len)
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1136 goto send_free_err;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1137 }
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1138 send_free_err:
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1139 mutex_unlock(&ep->sendlock);
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1140 kfree(tmp);
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1141 send_err:
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1142 return err < 0 ? err : sent_len;
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1143 }
fdd9fd5c38afe7 Sudeep Dutt 2015-04-29 1144
:::::: The code@line 1101 was first introduced by commit
:::::: fdd9fd5c38afe732258a0af4c6be14f3fbd1585c misc: mic: SCIF messaging and node enumeration APIs
:::::: TO: Sudeep Dutt <sudeep.dutt@intel.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31025 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-19 3:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 3:06 [freescale-fslc:pr/341 14836/18812] drivers/misc/mic/scif/scif_api.c:1101:30: warning: left shift count >= width of type kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.