* [s390:features 73/81] drivers/s390/crypto/ap_queue.c:201:18: warning: format specifies type 'unsigned char' but the argument has type 'int'
@ 2020-10-07 23:41 kernel test robot
2020-10-08 7:00 ` Harald Freudenberger
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2020-10-07 23:41 UTC (permalink / raw)
To: Harald Freudenberger
Cc: kbuild-all, clang-built-linux, linux-s390, Vasily Gorbik
[-- Attachment #1: Type: text/plain, Size: 6302 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
head: eefc69a09ca5b441ee136f9fb68ab5970cfc2d51
commit: 2ea2a6099ae3d1708f90f43c81a98cba3d4bb74c [73/81] s390/ap: add error response code field for ap queue devices
config: s390-randconfig-r016-20201008 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 4d1d8ae7100ec3c7e1709addb7b3ec6f9ad0b44f)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git/commit/?id=2ea2a6099ae3d1708f90f43c81a98cba3d4bb74c
git remote add s390 https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git
git fetch --no-tags s390 features
git checkout 2ea2a6099ae3d1708f90f43c81a98cba3d4bb74c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
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/s390/crypto/ap_queue.c:201:18: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
__func__, status.response_code,
^~~~~~~~~~~~~~~~~~~~
drivers/s390/crypto/ap_debug.h:26:47: note: expanded from macro 'AP_DBF_WARN'
debug_sprintf_event(ap_dbf_info, DBF_WARN, ##__VA_ARGS__)
^~~~~~~~~~~
arch/s390/include/asm/debug.h:256:21: note: expanded from macro 'debug_sprintf_event'
_fmt, ## __VA_ARGS__); \
~~~~ ^~~~~~~~~~~
drivers/s390/crypto/ap_queue.c:255:18: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
__func__, status.response_code,
^~~~~~~~~~~~~~~~~~~~
drivers/s390/crypto/ap_debug.h:26:47: note: expanded from macro 'AP_DBF_WARN'
debug_sprintf_event(ap_dbf_info, DBF_WARN, ##__VA_ARGS__)
^~~~~~~~~~~
arch/s390/include/asm/debug.h:256:21: note: expanded from macro 'debug_sprintf_event'
_fmt, ## __VA_ARGS__); \
~~~~ ^~~~~~~~~~~
drivers/s390/crypto/ap_queue.c:298:18: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
__func__, status.response_code,
^~~~~~~~~~~~~~~~~~~~
drivers/s390/crypto/ap_debug.h:26:47: note: expanded from macro 'AP_DBF_WARN'
debug_sprintf_event(ap_dbf_info, DBF_WARN, ##__VA_ARGS__)
^~~~~~~~~~~
arch/s390/include/asm/debug.h:256:21: note: expanded from macro 'debug_sprintf_event'
_fmt, ## __VA_ARGS__); \
~~~~ ^~~~~~~~~~~
drivers/s390/crypto/ap_queue.c:341:18: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
__func__, status.response_code,
^~~~~~~~~~~~~~~~~~~~
drivers/s390/crypto/ap_debug.h:26:47: note: expanded from macro 'AP_DBF_WARN'
debug_sprintf_event(ap_dbf_info, DBF_WARN, ##__VA_ARGS__)
^~~~~~~~~~~
arch/s390/include/asm/debug.h:256:21: note: expanded from macro 'debug_sprintf_event'
_fmt, ## __VA_ARGS__); \
~~~~ ^~~~~~~~~~~
drivers/s390/crypto/ap_queue.c:382:18: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
__func__, status.response_code,
^~~~~~~~~~~~~~~~~~~~
drivers/s390/crypto/ap_debug.h:26:47: note: expanded from macro 'AP_DBF_WARN'
debug_sprintf_event(ap_dbf_info, DBF_WARN, ##__VA_ARGS__)
^~~~~~~~~~~
arch/s390/include/asm/debug.h:256:21: note: expanded from macro 'debug_sprintf_event'
_fmt, ## __VA_ARGS__); \
~~~~ ^~~~~~~~~~~
5 warnings generated.
vim +201 drivers/s390/crypto/ap_queue.c
170
171 /**
172 * ap_sm_read(): Receive pending reply messages from an AP queue.
173 * @aq: pointer to the AP queue
174 *
175 * Returns AP_SM_WAIT_NONE, AP_SM_WAIT_AGAIN, or AP_SM_WAIT_INTERRUPT
176 */
177 static enum ap_sm_wait ap_sm_read(struct ap_queue *aq)
178 {
179 struct ap_queue_status status;
180
181 if (!aq->reply)
182 return AP_SM_WAIT_NONE;
183 status = ap_sm_recv(aq);
184 switch (status.response_code) {
185 case AP_RESPONSE_NORMAL:
186 if (aq->queue_count > 0) {
187 aq->sm_state = AP_SM_STATE_WORKING;
188 return AP_SM_WAIT_AGAIN;
189 }
190 aq->sm_state = AP_SM_STATE_IDLE;
191 return AP_SM_WAIT_NONE;
192 case AP_RESPONSE_NO_PENDING_REPLY:
193 if (aq->queue_count > 0)
194 return AP_SM_WAIT_INTERRUPT;
195 aq->sm_state = AP_SM_STATE_IDLE;
196 return AP_SM_WAIT_NONE;
197 default:
198 aq->dev_state = AP_DEV_STATE_ERROR;
199 aq->last_err_rc = status.response_code;
200 AP_DBF_WARN("%s RC 0x%02hhx on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n",
> 201 __func__, status.response_code,
202 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid));
203 return AP_SM_WAIT_NONE;
204 }
205 }
206
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 22352 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [s390:features 73/81] drivers/s390/crypto/ap_queue.c:201:18: warning: format specifies type 'unsigned char' but the argument has type 'int'
2020-10-07 23:41 [s390:features 73/81] drivers/s390/crypto/ap_queue.c:201:18: warning: format specifies type 'unsigned char' but the argument has type 'int' kernel test robot
@ 2020-10-08 7:00 ` Harald Freudenberger
2020-10-08 8:34 ` Vasily Gorbik
0 siblings, 1 reply; 3+ messages in thread
From: Harald Freudenberger @ 2020-10-08 7:00 UTC (permalink / raw)
To: linux-s390, Vasily Gorbik
On 08.10.20 01:41, kernel test robot wrote:
> 2ea2a6099ae3d1708f90f43c81a98cba3d4bb74c [73/81] s390/ap: add error response code field for ap queue devices
Fixed ... but why do these warnings not appear with normal build or with C=1 build ?
Maybe there is some pragma needed somewhere at where the debug feature printfs expand to ?
drivers/s390/crypto/ap_debug.h:26:47: note: expanded from macro 'AP_DBF_WARN'
debug_sprintf_event(ap_dbf_info, DBF_WARN, ##__VA_ARGS__)
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [s390:features 73/81] drivers/s390/crypto/ap_queue.c:201:18: warning: format specifies type 'unsigned char' but the argument has type 'int'
2020-10-08 7:00 ` Harald Freudenberger
@ 2020-10-08 8:34 ` Vasily Gorbik
0 siblings, 0 replies; 3+ messages in thread
From: Vasily Gorbik @ 2020-10-08 8:34 UTC (permalink / raw)
To: Harald Freudenberger; +Cc: linux-s390
On Thu, Oct 08, 2020 at 09:00:00AM +0200, Harald Freudenberger wrote:
>
> On 08.10.20 01:41, kernel test robot wrote:
> > 2ea2a6099ae3d1708f90f43c81a98cba3d4bb74c [73/81] s390/ap: add error response code field for ap queue devices
>
> Fixed ... but why do these warnings not appear with normal build or with C=1 build ?
>
> Maybe there is some pragma needed somewhere at where the debug feature printfs expand to ?
>
> drivers/s390/crypto/ap_debug.h:26:47: note: expanded from macro 'AP_DBF_WARN'
> debug_sprintf_event(ap_dbf_info, DBF_WARN, ##__VA_ARGS__)
It seems to be the same for printk as well.
Variable function arguments which are passed via ... and of smaller
sizes then int are promoted to ints. It's called "default argument
promotion". So, its not like your code would crash or print garbage
if you use "%hhu" format and pass int or use "%d" and pass unsigned
char. It looks like gcc simply does not complain about such things,
while clang does.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-08 8:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-07 23:41 [s390:features 73/81] drivers/s390/crypto/ap_queue.c:201:18: warning: format specifies type 'unsigned char' but the argument has type 'int' kernel test robot
2020-10-08 7:00 ` Harald Freudenberger
2020-10-08 8:34 ` Vasily Gorbik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox