2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 05:34:00 +08:00

staging: slicoss: Move NULL test closer to assignment

Move the test to check if a variable is NULL, to right after it is being
assigned, rather than some statements later.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Rehas Sachdeva 2016-09-22 00:06:51 +05:30 committed by Greg Kroah-Hartman
parent 7d359a847c
commit 7725066f1b

View File

@ -2617,15 +2617,15 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
sizeof(struct slic_eeprom), sizeof(struct slic_eeprom),
&phys_config); &phys_config);
phys_configl = SLIC_GET_ADDR_LOW(phys_config);
phys_configh = SLIC_GET_ADDR_HIGH(phys_config);
if (!peeprom) { if (!peeprom) {
dev_err(&adapter->pcidev->dev, dev_err(&adapter->pcidev->dev,
"Failed to allocate DMA memory for EEPROM.\n"); "Failed to allocate DMA memory for EEPROM.\n");
return -ENOMEM; return -ENOMEM;
} }
phys_configl = SLIC_GET_ADDR_LOW(phys_config);
phys_configh = SLIC_GET_ADDR_HIGH(phys_config);
memset(peeprom, 0, sizeof(struct slic_eeprom)); memset(peeprom, 0, sizeof(struct slic_eeprom));
slic_write32(adapter, SLIC_REG_ICR, ICR_INT_OFF); slic_write32(adapter, SLIC_REG_ICR, ICR_INT_OFF);