Commit e55fea0c authored by Dan Carpenter's avatar Dan Carpenter Committed by Wolfram Sang

i2c: scmi: remove some bogus NULL checks

"obj" can't be NULL here.

We already know that "pkg->package.elements" gives us a valid pointer
so the next pointer after that is also non-NULL.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 5edb1062
...@@ -223,7 +223,7 @@ acpi_smbus_cmi_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, ...@@ -223,7 +223,7 @@ acpi_smbus_cmi_access(struct i2c_adapter *adap, u16 addr, unsigned short flags,
goto out; goto out;
obj = pkg->package.elements + 1; obj = pkg->package.elements + 1;
if (obj == NULL || obj->type != ACPI_TYPE_INTEGER) { if (obj->type != ACPI_TYPE_INTEGER) {
ACPI_ERROR((AE_INFO, "Invalid argument type")); ACPI_ERROR((AE_INFO, "Invalid argument type"));
result = -EIO; result = -EIO;
goto out; goto out;
...@@ -235,7 +235,7 @@ acpi_smbus_cmi_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, ...@@ -235,7 +235,7 @@ acpi_smbus_cmi_access(struct i2c_adapter *adap, u16 addr, unsigned short flags,
case I2C_SMBUS_BYTE: case I2C_SMBUS_BYTE:
case I2C_SMBUS_BYTE_DATA: case I2C_SMBUS_BYTE_DATA:
case I2C_SMBUS_WORD_DATA: case I2C_SMBUS_WORD_DATA:
if (obj == NULL || obj->type != ACPI_TYPE_INTEGER) { if (obj->type != ACPI_TYPE_INTEGER) {
ACPI_ERROR((AE_INFO, "Invalid argument type")); ACPI_ERROR((AE_INFO, "Invalid argument type"));
result = -EIO; result = -EIO;
goto out; goto out;
...@@ -246,7 +246,7 @@ acpi_smbus_cmi_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, ...@@ -246,7 +246,7 @@ acpi_smbus_cmi_access(struct i2c_adapter *adap, u16 addr, unsigned short flags,
data->byte = obj->integer.value; data->byte = obj->integer.value;
break; break;
case I2C_SMBUS_BLOCK_DATA: case I2C_SMBUS_BLOCK_DATA:
if (obj == NULL || obj->type != ACPI_TYPE_BUFFER) { if (obj->type != ACPI_TYPE_BUFFER) {
ACPI_ERROR((AE_INFO, "Invalid argument type")); ACPI_ERROR((AE_INFO, "Invalid argument type"));
result = -EIO; result = -EIO;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment