projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: ti: cpsw: Move cpsw_phy_sel() to _probe()
[oweals/u-boot.git]
/
drivers
/
tpm
/
tpm_tis_infineon.c
diff --git
a/drivers/tpm/tpm_tis_infineon.c
b/drivers/tpm/tpm_tis_infineon.c
index e3e20d899689af107bf1abc9b10b538bb467146a..b5fe43ee50f7f68b95bb4b32232b919382000589 100644
(file)
--- a/
drivers/tpm/tpm_tis_infineon.c
+++ b/
drivers/tpm/tpm_tis_infineon.c
@@
-1,3
+1,4
@@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2011 Infineon Technologies
*
/*
* Copyright (C) 2011 Infineon Technologies
*
@@
-16,15
+17,13
@@
* Dorn, Dave Safford, Reiner Sailer, and Kyleen Hall.
*
* Version: 2.1.1
* Dorn, Dave Safford, Reiner Sailer, and Kyleen Hall.
*
* Version: 2.1.1
- *
- * SPDX-License-Identifier: GPL-2.0
*/
#include <common.h>
#include <dm.h>
#include <fdtdec.h>
#include <i2c.h>
*/
#include <common.h>
#include <dm.h>
#include <fdtdec.h>
#include <i2c.h>
-#include <tpm.h>
+#include <tpm
-v1
.h>
#include <linux/errno.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/compiler.h>
#include <linux/types.h>
@@
-33,8
+32,6
@@
#include "tpm_tis.h"
#include "tpm_internal.h"
#include "tpm_tis.h"
#include "tpm_internal.h"
-DECLARE_GLOBAL_DATA_PTR;
-
enum i2c_chip_type {
SLB9635,
SLB9645,
enum i2c_chip_type {
SLB9635,
SLB9645,
@@
-374,7
+371,8
@@
static int tpm_tis_i2c_recv(struct udevice *dev, u8 *buf, size_t count)
{
struct tpm_chip *chip = dev_get_priv(dev);
int size = 0;
{
struct tpm_chip *chip = dev_get_priv(dev);
int size = 0;
- int expected, status;
+ int status;
+ unsigned int expected;
int rc;
status = tpm_tis_i2c_status(dev);
int rc;
status = tpm_tis_i2c_status(dev);
@@
-394,7
+392,7
@@
static int tpm_tis_i2c_recv(struct udevice *dev, u8 *buf, size_t count)
}
expected = get_unaligned_be32(buf + TPM_RSP_SIZE_BYTE);
}
expected = get_unaligned_be32(buf + TPM_RSP_SIZE_BYTE);
- if ((size_t)expected > count) {
+ if ((size_t)expected > count
|| (size_t)expected < TPM_HEADER_SIZE
) {
debug("Error size=%x, expected=%x, count=%x\n", size, expected,
count);
return -ENOSPC;
debug("Error size=%x, expected=%x, count=%x\n", size, expected,
count);
return -ENOSPC;