summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorTudor-Dan Ambarus <tudor.ambarus@microchip.com>2017-07-20 16:35:49 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2017-08-03 08:47:23 +0300
commit6d2bce6a15753710836f99054826d5ae638dd04a (patch)
treede24259bdbfaef700e51e3aa0373b67cc2a307e4 /drivers/crypto
parent952035baedb15d956d5f25b34287d728c751cac9 (diff)
downloadlinux-6d2bce6a15753710836f99054826d5ae638dd04a.tar.xz
crypto: atmel-ecc - fix signed integer to u8 assignment
static checker warning: drivers/crypto/atmel-ecc.c:281 atmel_ecdh_done() warn: assigning (-22) to unsigned variable 'status' Similar warning can be raised in atmel_ecc_work_handler() when atmel_ecc_send_receive() returns an error. Fix this too. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/atmel-ecc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/crypto/atmel-ecc.c b/drivers/crypto/atmel-ecc.c
index c6e8de2b28dd..e66f18a0ddd0 100644
--- a/drivers/crypto/atmel-ecc.c
+++ b/drivers/crypto/atmel-ecc.c
@@ -99,7 +99,7 @@ struct atmel_ecdh_ctx {
* @work_data: data structure representing the work
* @areq : optional pointer to an argument passed with the original
* request.
- * @status : status returned from the device.
+ * @status : status returned from the i2c client device or i2c error.
* @areq: optional pointer to a user argument for use at callback time.
* @work: describes the task to be executed.
* @cmd : structure used for communicating with the device.
@@ -107,7 +107,7 @@ struct atmel_ecdh_ctx {
struct atmel_ecc_work_data {
struct atmel_ecdh_ctx *ctx;
void (*cbk)(struct atmel_ecc_work_data *work_data, void *areq,
- u8 status);
+ int status);
void *areq;
struct work_struct work;
struct atmel_ecc_cmd cmd;
@@ -263,7 +263,7 @@ static int atmel_ecc_sleep(struct i2c_client *client)
}
static void atmel_ecdh_done(struct atmel_ecc_work_data *work_data, void *areq,
- u8 status)
+ int status)
{
struct kpp_request *req = areq;
struct atmel_ecdh_ctx *ctx = work_data->ctx;
@@ -344,7 +344,7 @@ static void atmel_ecc_work_handler(struct work_struct *work)
container_of(work, struct atmel_ecc_work_data, work);
struct atmel_ecc_cmd *cmd = &work_data->cmd;
struct i2c_client *client = work_data->ctx->client;
- u8 status;
+ int status;
status = atmel_ecc_send_receive(client, cmd);
work_data->cbk(work_data, work_data->areq, status);
@@ -352,7 +352,7 @@ static void atmel_ecc_work_handler(struct work_struct *work)
static void atmel_ecc_enqueue(struct atmel_ecc_work_data *work_data,
void (*cbk)(struct atmel_ecc_work_data *work_data,
- void *areq, u8 status),
+ void *areq, int status),
void *areq)
{
work_data->cbk = (void *)cbk;