[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/xenbus: fix return type in xenbus_file_read()


  • To: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
  • From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>
  • Date: Fri, 5 Aug 2022 09:31:26 +0000
  • Accept-language: en-US, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3ygLQKAIvWL8iDybhhhVj0qW2imS7PtuXrZ8GGK6ufo=; b=G0KdHVDfXu2hFOaQYKx1aZbQCgTjzgxso3Ekp65Ps3/ucel1FYk9/n+BHI+mz3pdW61NMTzj/eC5q2YKZOMKviAxOb7S7m+6MmffJZERp9nBV+2/oA7jovAVxZ9AzYStHauffA3IoXjrIw/o1nt4wVhO0hA9ywcegvCOM7LZs7eFSU4bW2Jqg4zhvJPCMhneAR8Se6yZkziB8f6vJ7Ae+JHzxjmfMgNU1y6YWijojq4b1tPEOtxpvqcX98Fz0AIPKu8P6tbVg9B71pegknE6ctPgfTnmpHXZuufcQyLLwhaxlpUvobed2ldU4KTe6MLjv6fVGqW//azPz2Os7BXeSw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LIDqF0CLwWzsccpCq9WVw2pyYiVNEtImuKfLlq06Z30vkHTLGq5GN/edzPeFJfIKP0fGfxtips1JNe4SoP7Qt726/Rg56hVAmlUL/eYUagxWEm3dz25wL7izWFokgRZ/RFHo7wZ4X0IbaObylUKNJP3yAFH0MoNZcVmGsLRwFSnYlJmL6knWJ8fqMGgoDd4F+VW8rUsRtO1jXd7jDFslUvSuPf/VEl1I2AOUsmEaICLlU2UL5E25UIE5+BQkxJ2d4OWpjDgSHr5Jz4Bzn7NVbHAYB0Aqce6MxxpGtqUFxhr8NYkXAufxZHUXj1Z9RG1OlFZx/O+gLQveDYSVaMGf0g==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Ian Campbell <ian.campbell@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "kernel-janitors@xxxxxxxxxxxxxxx" <kernel-janitors@xxxxxxxxxxxxxxx>, Bastian Blank <waldi@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 05 Aug 2022 09:32:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYp9GEZ0chDohme0ithoOevS/GFq2gDJUA
  • Thread-topic: [PATCH] xen/xenbus: fix return type in xenbus_file_read()

On 04.08.22 10:11, Dan Carpenter wrote:


Hello Dan

> This code tries to store -EFAULT in an unsigned int.  The
> xenbus_file_read() function returns type ssize_t so the negative value
> is returned as a positive value to the user.
>
> This change forces another change to the min() macro.  Originally, the
> min() macro used "unsigned" type which checkpatch complains about.  Also
> unsigned type would break if "len" were not capped at MAX_RW_COUNT.  Use
> size_t for the min().  (No effect on runtime for the min_t() change).
>
> Fixes: 2fb3683e7b16 ("xen: Add xenbus device driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>


I think that patch does correct changes, so

Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>


[snip]


-- 
Regards,

Oleksandr Tyshchenko

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.