OP-TEE: fix clang warning

security/optee_linuxdriver/core/tee_session.c:683:22: error: address of array 'cmd_io->op->params' will always evaluate to 'true'
      [-Werror,-Wpointer-bool-conversion]
        BUG_ON(!cmd_io->op->params);
               ~~~~~~~~~~~~~^~~~~~
/security/optee_linuxdriver/core/tee_kernel_api.c:85:18: error: address of array 'context->devname' will always evaluate to 'true'
      [-Werror,-Wpointer-bool-conversion]
                                 && context->devname) ? context->devname : "");
                                 ~~ ~~~~~~~~~^~~~~~~

Change-Id: I6fa7e26fa620b48a0a255393b4279ff1cf1700c3
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang 2019-08-16 17:41:30 +08:00
parent 9a9b5bb34a
commit fbbb55cb30
2 changed files with 1 additions and 3 deletions

View File

@ -81,8 +81,7 @@ void TEEC_FinalizeContext(TEEC_Context *context)
{
if (!context || !context->fd) {
pr_err("%s - can't release context %p:[%s]\n", __func__,
context, (context
&& context->devname) ? context->devname : "");
context, context ? context->devname : "");
return;
}
/* TODO fixme will not work on 64-bit platform */

View File

@ -680,7 +680,6 @@ static void _update_client_tee_cmd(struct tee_session *sess,
BUG_ON(!cmd_io);
BUG_ON(!cmd_io->op);
BUG_ON(!cmd_io->op->params);
BUG_ON(!cmd);
BUG_ON(!sess->ctx);
ctx = sess->ctx;