Commit 6cf20211 authored by Srinivasan Shanmugam's avatar Srinivasan Shanmugam Committed by Alex Deucher
Browse files

drm/amdgpu: Fix unnecessary else after return in 'amdgpu_eeprom_xfer'



Fixes the following:

WARNING: else is not generally useful after a break or return
+               return -EINVAL;
+       } else {

Cc: Guchun Chen <guchun.chen@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: default avatarGuchun Chen <guchun.chen@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 82f33504
Loading
Loading
Loading
Loading
+19 −20
Original line number Diff line number Diff line
@@ -183,6 +183,8 @@ static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,
{
	const struct i2c_adapter_quirks *quirks = i2c_adap->quirks;
	u16 limit;
	u16 ps; /* Partial size */
	int res = 0, r;

	if (!quirks)
		limit = 0;
@@ -200,9 +202,7 @@ static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,
				    eeprom_addr, buf_size,
				    read ? "read" : "write", EEPROM_OFFSET_SIZE);
		return -EINVAL;
	} else {
		u16 ps; /* Partial size */
		int res = 0, r;
	}

	/* The "limit" includes all data bytes sent/received,
	 * which would include the EEPROM_OFFSET_SIZE bytes.
@@ -222,7 +222,6 @@ static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,

	return res;
}
}

int amdgpu_eeprom_read(struct i2c_adapter *i2c_adap,
		       u32 eeprom_addr, u8 *eeprom_buf,