drivers/raw/skeleton: fix typecasting in skeleton_rawdev_enqueue_bufs()

Message ID 20220706063255.255325-1-usman.tanveer@emumba.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series drivers/raw/skeleton: fix typecasting in skeleton_rawdev_enqueue_bufs() |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

Usman Tanveer July 6, 2022, 6:32 a.m. UTC
  In function "skeleton_rawdev_enqueue_bugs", variable "context" is being
typecasted to (int*), and then assigned to a "uint16_t" type variable
"q_id". As the value is a "uint16_t", (int*) is replaced by (uint16_t*).

Signed-off-by: Usman Tanveer <usman.tanveer@emumba.com>
---
 drivers/raw/skeleton/skeleton_rawdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Usman Tanveer Sept. 2, 2022, 4:57 a.m. UTC | #1
Hi Thomas,
Can you please have a look and update the status?



On Wed, Jul 6, 2022 at 11:33 AM Usman Tanveer <usman.tanveer@emumba.com>
wrote:

> In function "skeleton_rawdev_enqueue_bugs", variable "context" is being
> typecasted to (int*), and then assigned to a "uint16_t" type variable
> "q_id". As the value is a "uint16_t", (int*) is replaced by (uint16_t*).
>
> Signed-off-by: Usman Tanveer <usman.tanveer@emumba.com>
> ---
>  drivers/raw/skeleton/skeleton_rawdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/raw/skeleton/skeleton_rawdev.c
> b/drivers/raw/skeleton/skeleton_rawdev.c
> index 16ecae3d92..3f4da88747 100644
> --- a/drivers/raw/skeleton/skeleton_rawdev.c
> +++ b/drivers/raw/skeleton/skeleton_rawdev.c
> @@ -421,7 +421,7 @@ static int skeleton_rawdev_enqueue_bufs(struct
> rte_rawdev *dev,
>          * help in complex implementation which require more information
> than
>          * just an integer - for example, a queue-pair.
>          */
> -       q_id = *((int *)context);
> +       q_id = *((uint16_t *)context);
>
>         for (i = 0; i < count; i++)
>                 queue_buf[q_id].bufs[i] = buffers[i]->buf_addr;
> --
> 2.25.1
>
>
  

Patch

diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index 16ecae3d92..3f4da88747 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -421,7 +421,7 @@  static int skeleton_rawdev_enqueue_bufs(struct rte_rawdev *dev,
 	 * help in complex implementation which require more information than
 	 * just an integer - for example, a queue-pair.
 	 */
-	q_id = *((int *)context);
+	q_id = *((uint16_t *)context);
 
 	for (i = 0; i < count; i++)
 		queue_buf[q_id].bufs[i] = buffers[i]->buf_addr;