CC: l...@lists.linux.dev
CC: kbuild-...@lists.01.org
BCC: l...@intel.com
CC: Linux Memory Management List <linux...@kvack.org>
TO: Arnd Bergmann <a...@arndb.de>
CC: Masahiro Yamada <masahi...@kernel.org>
CC: Alex Shi <al...@kernel.org>
CC: Nick Desaulniers <ndesaulni...@google.com>
CC: Miguel Ojeda <oj...@kernel.org>
CC: Nathan Chancellor <nat...@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   dd315b5800612e6913343524aa9b993f9a8bb0cf
commit: e8c07082a810fbb9db303a2b66b66b8d7e588b53 [11468/14337] Kbuild: move to 
-std=gnu11
:::::: branch date: 18 hours ago
:::::: commit date: 12 days ago
config: arm-randconfig-c002-20220324 
(https://download.01.org/0day-ci/archive/20220325/202203250932.6dh1qkdv-...@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
0f6d9501cf49ce02937099350d08f20c4af86f3d)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=e8c07082a810fbb9db303a2b66b66b8d7e588b53
        git remote add linux-next 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout e8c07082a810fbb9db303a2b66b66b8d7e588b53
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <l...@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
       ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress.c:4520:5: note: Call to function 'memcpy' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memcpy_s' in case of C11
       ZSTD_memcpy(cctx->blockState.nextCBlock->rep, updatedRepcodes.rep, 
sizeof(repcodes_t));
       ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress.c:4570:5: warning: Call to function 'memcpy' 
is insecure as it does not provide security checks introduced in the C11 
standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
       ZSTD_memcpy(updatedRepcodes.rep, cctx->blockState.prevCBlock->rep, 
sizeof(repcodes_t));
       ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress.c:4570:5: note: Call to function 'memcpy' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memcpy_s' in case of C11
       ZSTD_memcpy(updatedRepcodes.rep, cctx->blockState.prevCBlock->rep, 
sizeof(repcodes_t));
       ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress.c:4650:5: warning: Call to function 'memcpy' 
is insecure as it does not provide security checks introduced in the C11 
standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
       ZSTD_memcpy(cctx->blockState.nextCBlock->rep, updatedRepcodes.rep, 
sizeof(repcodes_t));
       ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress.c:4650:5: note: Call to function 'memcpy' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memcpy_s' in case of C11
       ZSTD_memcpy(cctx->blockState.nextCBlock->rep, updatedRepcodes.rep, 
sizeof(repcodes_t));
       ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress.c:5096:5: warning: Call to function 'memset' 
is insecure as it does not provide security checks introduced in the C11 
standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memset_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
       ZSTD_memset(&params, 0, sizeof(params));
       ^
   lib/zstd/compress/../common/zstd_deps.h:34:28: note: expanded from macro 
'ZSTD_memset'
   #define ZSTD_memset(d,s,n) __builtin_memset((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress.c:5096:5: note: Call to function 'memset' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memset_s' in case of C11
       ZSTD_memset(&params, 0, sizeof(params));
       ^
   lib/zstd/compress/../common/zstd_deps.h:34:28: note: expanded from macro 
'ZSTD_memset'
   #define ZSTD_memset(d,s,n) __builtin_memset((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   Suppressed 10 warnings (10 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   14 warnings generated.
   lib/zstd/compress/zstd_compress_literals.c:38:5: warning: Call to function 
'memcpy' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
       ZSTD_memcpy(ostart + flSize, src, srcSize);
       ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress_literals.c:38:5: note: Call to function 
'memcpy' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11
       ZSTD_memcpy(ostart + flSize, src, srcSize);
       ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress_literals.c:89:5: warning: Call to function 
'memcpy' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
       ZSTD_memcpy(nextHuf, prevHuf, sizeof(*prevHuf));
       ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress_literals.c:89:5: note: Call to function 
'memcpy' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11
       ZSTD_memcpy(nextHuf, prevHuf, sizeof(*prevHuf));
       ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress_literals.c:121:9: warning: Call to function 
'memcpy' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           ZSTD_memcpy(nextHuf, prevHuf, sizeof(*prevHuf));
           ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress_literals.c:121:9: note: Call to function 
'memcpy' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11
           ZSTD_memcpy(nextHuf, prevHuf, sizeof(*prevHuf));
           ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress_literals.c:125:9: warning: Call to function 
'memcpy' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           ZSTD_memcpy(nextHuf, prevHuf, sizeof(*prevHuf));
           ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   lib/zstd/compress/zstd_compress_literals.c:125:9: note: Call to function 
'memcpy' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11
           ZSTD_memcpy(nextHuf, prevHuf, sizeof(*prevHuf));
           ^
   lib/zstd/compress/../common/zstd_deps.h:32:28: note: expanded from macro 
'ZSTD_memcpy'
   #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
                              ^~~~~~~~~~~~~~~~
   Suppressed 10 warnings (10 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   36 warnings generated.
>> drivers/usb/typec/altmodes/displayport.c:396:8: warning: Call to function 
>> 'sprintf' is insecure as it does not provide bounding of the memory buffer 
>> or security checks introduced in the C11 standard. Replace with analogous 
>> functions that support length arguments or provides boundary checks such as 
>> 'sprintf_s' in case of C11 
>> [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           len = sprintf(buf, "%s ", cur ? "USB" : "[USB]");
                 ^~~~~~~
   drivers/usb/typec/altmodes/displayport.c:396:8: note: Call to function 
'sprintf' is insecure as it does not provide bounding of the memory buffer or 
security checks introduced in the C11 standard. Replace with analogous 
functions that support length arguments or provides boundary checks such as 
'sprintf_s' in case of C11
           len = sprintf(buf, "%s ", cur ? "USB" : "[USB]");
                 ^~~~~~~
   drivers/usb/typec/altmodes/displayport.c:400:11: warning: Call to function 
'sprintf' is insecure as it does not provide bounding of the memory buffer or 
security checks introduced in the C11 standard. Replace with analogous 
functions that support length arguments or provides boundary checks such as 
'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
                           len += sprintf(buf + len, "[%s] ", 
configurations[i]);
                                  ^~~~~~~
   drivers/usb/typec/altmodes/displayport.c:400:11: note: Call to function 
'sprintf' is insecure as it does not provide bounding of the memory buffer or 
security checks introduced in the C11 standard. Replace with analogous 
functions that support length arguments or provides boundary checks such as 
'sprintf_s' in case of C11
                           len += sprintf(buf + len, "[%s] ", 
configurations[i]);
                                  ^~~~~~~
   drivers/usb/typec/altmodes/displayport.c:403:11: warning: Call to function 
'sprintf' is insecure as it does not provide bounding of the memory buffer or 
security checks introduced in the C11 standard. Replace with analogous 
functions that support length arguments or provides boundary checks such as 
'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
                           len += sprintf(buf + len, "%s ", configurations[i]);
                                  ^~~~~~~
   drivers/usb/typec/altmodes/displayport.c:403:11: note: Call to function 
'sprintf' is insecure as it does not provide bounding of the memory buffer or 
security checks introduced in the C11 standard. Replace with analogous 
functions that support length arguments or provides boundary checks such as 
'sprintf_s' in case of C11
                           len += sprintf(buf + len, "%s ", configurations[i]);
                                  ^~~~~~~
   drivers/usb/typec/altmodes/displayport.c:496:12: warning: Call to function 
'sprintf' is insecure as it does not provide bounding of the memory buffer or 
security checks introduced in the C11 standard. Replace with analogous 
functions that support length arguments or provides boundary checks such as 
'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
                                   len += sprintf(buf + len, "[%s] ",
                                          ^~~~~~~
   drivers/usb/typec/altmodes/displayport.c:496:12: note: Call to function 
'sprintf' is insecure as it does not provide bounding of the memory buffer or 
security checks introduced in the C11 standard. Replace with analogous 
functions that support length arguments or provides boundary checks such as 
'sprintf_s' in case of C11
                                   len += sprintf(buf + len, "[%s] ",
                                          ^~~~~~~
   drivers/usb/typec/altmodes/displayport.c:499:12: warning: Call to function 
'sprintf' is insecure as it does not provide bounding of the memory buffer or 
security checks introduced in the C11 standard. Replace with analogous 
functions that support length arguments or provides boundary checks such as 
'sprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
                                   len += sprintf(buf + len, "%s ",
                                          ^~~~~~~
   drivers/usb/typec/altmodes/displayport.c:499:12: note: Call to function 
'sprintf' is insecure as it does not provide bounding of the memory buffer or 
security checks introduced in the C11 standard. Replace with analogous 
functions that support length arguments or provides boundary checks such as 
'sprintf_s' in case of C11
                                   len += sprintf(buf + len, "%s ",
                                          ^~~~~~~
   Suppressed 31 warnings (30 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   32 warnings generated.
   drivers/char/xillybus/xillybus_class.c:66:3: warning: Call to function 
'snprintf' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'snprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
                   snprintf(unit->name, UNITNAMELEN, "%s", prefix);
                   ^~~~~~~~
   drivers/char/xillybus/xillybus_class.c:66:3: note: Call to function 
'snprintf' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'snprintf_s' in case of C11
                   snprintf(unit->name, UNITNAMELEN, "%s", prefix);
                   ^~~~~~~~
   drivers/char/xillybus/xillybus_class.c:69:3: warning: Call to function 
'snprintf' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'snprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
                   snprintf(unit->name, UNITNAMELEN, "%s_%02d",
                   ^~~~~~~~
   drivers/char/xillybus/xillybus_class.c:69:3: note: Call to function 
'snprintf' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'snprintf_s' in case of C11
                   snprintf(unit->name, UNITNAMELEN, "%s_%02d",
                   ^~~~~~~~
   drivers/char/xillybus/xillybus_class.c:118:3: warning: Call to function 
'snprintf' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'snprintf_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
                   snprintf(devname, sizeof(devname), "%s_%s",
                   ^~~~~~~~
   drivers/char/xillybus/xillybus_class.c:118:3: note: Call to function 
'snprintf' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'snprintf_s' in case of C11
                   snprintf(devname, sizeof(devname), "%s_%s",
                   ^~~~~~~~
   Suppressed 29 warnings (29 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   30 warnings generated.
   Suppressed 30 warnings (30 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   46 warnings generated.
   drivers/media/dvb-frontends/stv090x.c:728:2: warning: Call to function 
'memcpy' is insecure as it does not provide security checks introduced in the 
C11 standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           memcpy(&buf[2], data, count);
           ^~~~~~
   drivers/media/dvb-frontends/stv090x.c:728:2: note: Call to function 'memcpy' 
is insecure as it does not provide security checks introduced in the C11 
standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memcpy_s' in case of C11
           memcpy(&buf[2], data, count);
           ^~~~~~
   drivers/media/dvb-frontends/stv090x.c:2289:23: warning: The result of the 
'/' expression is undefined [clang-analyzer-core.UndefinedBinaryOperatorResult]
           steps_max = (car_max / inc) + 1; /* min steps = 3 */
                                ^
   drivers/media/dvb-frontends/stv090x.c:2405:2: note: Calling 
'stv090x_get_loop_params'
           stv090x_get_loop_params(state, &inc, &timeout_step, &steps_max);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-frontends/stv090x.c:2251:6: note: Assuming 'car_max' is <= 
16384
           if (car_max > 0x4000)
               ^~~~~~~~~~~~~~~~
   drivers/media/dvb-frontends/stv090x.c:2251:2: note: Taking false branch
           if (car_max > 0x4000)
           ^
   drivers/media/dvb-frontends/stv090x.c:2260:2: note: Control jumps to 'case 
STV090x_SEARCH_DVBS2:'  at line 2267
           switch (state->search_mode) {
           ^
   drivers/media/dvb-frontends/stv090x.c:2270:3: note:  Execution continues on 
line 2278
                   break;
                   ^
   drivers/media/dvb-frontends/stv090x.c:2279:7: note: Assuming 'inc' is <= 
'car_max'
           if ((inc > car_max) || (inc < 0))
                ^~~~~~~~~~~~~
   drivers/media/dvb-frontends/stv090x.c:2279:6: note: Left side of '||' is 
false
           if ((inc > car_max) || (inc < 0))
               ^
   drivers/media/dvb-frontends/stv090x.c:2279:26: note: Assuming 'inc' is >= 0
           if ((inc > car_max) || (inc < 0))
                                   ^~~~~~~
   drivers/media/dvb-frontends/stv090x.c:2279:2: note: Taking false branch
           if ((inc > car_max) || (inc < 0))
           ^
   drivers/media/dvb-frontends/stv090x.c:2283:6: note: Assuming 'srate' is <= 0
           if (srate > 0)
               ^~~~~~~~~
   drivers/media/dvb-frontends/stv090x.c:2283:2: note: Taking false branch
           if (srate > 0)
           ^
   drivers/media/dvb-frontends/stv090x.c:2286:7: note: 'timeout' is > 100
           if ((timeout > 100) || (timeout < 0))

vim +396 drivers/usb/typec/altmodes/displayport.c

0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  381  
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  382  static ssize_t 
configuration_show(struct device *dev,
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  383                                 
  struct device_attribute *attr, char *buf)
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  384  {
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  385         struct dp_altmode *dp = 
dev_get_drvdata(dev);
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  386         int len;
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  387         u8 cap;
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  388         u8 cur;
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  389         int i;
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  390  
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  391         mutex_lock(&dp->lock);
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  392  
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  393         cap = 
DP_CAP_CAPABILITY(dp->alt->vdo);
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  394         cur = 
DP_CONF_CURRENTLY(dp->data.conf);
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  395  
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27 @396         len = sprintf(buf, "%s 
", cur ? "USB" : "[USB]");
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  397  
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  398         for (i = 1; i < 
ARRAY_SIZE(configurations); i++) {
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  399                 if (i == cur)
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  400                         len += 
sprintf(buf + len, "[%s] ", configurations[i]);
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  401                 else if ((i == 
DP_CONF_DFP_D && cap & DP_CAP_DFP_D) ||
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  402                          (i == 
DP_CONF_UFP_D && cap & DP_CAP_UFP_D))
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  403                         len += 
sprintf(buf + len, "%s ", configurations[i]);
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  404         }
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  405  
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  406         mutex_unlock(&dp->lock);
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  407  
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  408         buf[len - 1] = '\n';
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  409         return len;
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  410  }
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  411  static 
DEVICE_ATTR_RW(configuration);
0e3bb7d6894d9b6 Heikki Krogerus 2018-06-27  412  

:::::: The code at line 396 was first introduced by commit
:::::: 0e3bb7d6894d9b6e67d6382bb03a46a1dc989588 usb: typec: Add driver for 
DisplayPort alternate mode

:::::: TO: Heikki Krogerus <heikki.kroge...@linux.intel.com>
:::::: CC: Greg Kroah-Hartman <gre...@linuxfoundation.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to