mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
fix(io): compare function pointers with NULL
The ops->read and ops->write existence was checked with 0, change it to NULL. This corrects sparse issues: drivers/io/io_block.c:272:9: warning: Using plain integer as NULL pointer drivers/io/io_block.c:384:9: warning: Using plain integer as NULL pointer drivers/io/io_block.c:384:9: warning: Using plain integer as NULL pointer Signed-off-by: Yann Gautier <yann.gautier@st.com> Change-Id: I039050a645107523d8263ddf820e539c260d956c
This commit is contained in:
parent
e0c56fd71f
commit
06d223cb4f
1 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2016-2023, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -271,7 +271,7 @@ static int block_read(io_entity_t *entity, uintptr_t buffer, size_t length,
|
|||
block_size = cur->dev_spec->block_size;
|
||||
assert((length <= cur->size) &&
|
||||
(length > 0U) &&
|
||||
(ops->read != 0));
|
||||
(ops->read != NULL));
|
||||
|
||||
/*
|
||||
* We don't know the number of bytes that we are going
|
||||
|
@ -383,8 +383,8 @@ static int block_write(io_entity_t *entity, const uintptr_t buffer,
|
|||
block_size = cur->dev_spec->block_size;
|
||||
assert((length <= cur->size) &&
|
||||
(length > 0U) &&
|
||||
(ops->read != 0) &&
|
||||
(ops->write != 0));
|
||||
(ops->read != NULL) &&
|
||||
(ops->write != NULL));
|
||||
|
||||
/*
|
||||
* We don't know the number of bytes that we are going
|
||||
|
|
Loading…
Add table
Reference in a new issue