lkml.org 
[lkml]   [2015]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] doc: mei: fix handling return value of mei_recv_msg
Date
> The function can return negative values, so its result should
> be assigned to signed variable.
>
> The problem has been detected using proposed semantic patch
> scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
> Documentation/misc-devices/mei/mei-amt-version.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/misc-devices/mei/mei-amt-version.c
> b/Documentation/misc-devices/mei/mei-amt-version.c
> index 57d0d87..33e67bd 100644
> --- a/Documentation/misc-devices/mei/mei-amt-version.c
> +++ b/Documentation/misc-devices/mei/mei-amt-version.c
> @@ -370,7 +370,7 @@ static uint32_t amt_host_if_call(struct amt_host_if
> *acmd,
> unsigned int expected_sz)
> {
> uint32_t in_buf_sz;
If are you at that then it will be desired to change the type to ssize_t also for in_buf_sz as mei_recv_msg takes ssize_t argument.
> - uint32_t out_buf_sz;
> + ssize_t out_buf_sz;
> ssize_t written;
> uint32_t status;
> struct amt_host_if_resp_header *msg_hdr;

Thanks
Tomas



\
 
 \ /
  Last update: 2015-12-14 13:21    [W:0.189 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site