Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac67229d authored by Yao Jiang's avatar Yao Jiang
Browse files

soc: qcom: hab: unify variable type to avoid implicit conversion



correcting the type of sizebytes and total_size to size_t,it can avoid
implicit conversion which maybe cause some unknown issue.

Change-Id: I1c1cc9e92ca2920cc49685edef0d928dd67454c7
Signed-off-by: default avatarYao Jiang <yaojia@codeaurora.org>
parent 6c549bb4
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -39,7 +39,7 @@ int physical_channel_send(struct physical_channel *pchan,
		struct hab_header *header,
		struct hab_header *header,
		void *payload)
		void *payload)
{
{
	int sizebytes = HAB_HEADER_GET_SIZE(*header);
	size_t sizebytes = HAB_HEADER_GET_SIZE(*header);
	struct ghs_vdev *dev  = (struct ghs_vdev *)pchan->hyp_data;
	struct ghs_vdev *dev  = (struct ghs_vdev *)pchan->hyp_data;
	GIPC_Result result;
	GIPC_Result result;
	uint8_t *msg;
	uint8_t *msg;
+3 −3
Original line number Original line Diff line number Diff line
/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -42,9 +42,9 @@ int physical_channel_send(struct physical_channel *pchan,
		struct hab_header *header,
		struct hab_header *header,
		void *payload)
		void *payload)
{
{
	int sizebytes = HAB_HEADER_GET_SIZE(*header);
	size_t sizebytes = HAB_HEADER_GET_SIZE(*header);
	struct qvm_channel *dev  = (struct qvm_channel *)pchan->hyp_data;
	struct qvm_channel *dev  = (struct qvm_channel *)pchan->hyp_data;
	int total_size = sizeof(*header) + sizebytes;
	size_t total_size = sizeof(*header) + sizebytes;


	if (total_size > dev->pipe_ep->tx_info.sh_buf->size)
	if (total_size > dev->pipe_ep->tx_info.sh_buf->size)
		return -EINVAL; /* too much data for ring */
		return -EINVAL; /* too much data for ring */