Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c38dc89 authored by Laurent Navet's avatar Laurent Navet Committed by Wolfram Sang
Browse files

i2c: nforce2: fix coding style issues



avoid these checkpatch.pl issues :
- ERROR: "foo * bar" should be "foo *bar"
- ERROR: switch and case should be at the same indent
- ERROR: "(foo*)" should be "(foo *)"
- ERROR: do not use assignment in if condition
- ERROR: space required before the open parenthesis '('
- WARNING: suspect code indent for conditional statements
- WARNING: quoted string split across lines
- WARNING: space prohibited between function name and open parenthesis '('
- WARNING: line over 80 characters
also add spaces around some "+", "=", "*"

Signed-off-by: default avatarLaurent Navet <laurent.navet@gmail.com>
Reviewed-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
parent 81e34f91
Loading
Loading
Loading
Loading
+76 −76
Original line number Diff line number Diff line
@@ -202,7 +202,6 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
	pec = (flags & I2C_CLIENT_PEC) ? NVIDIA_SMB_PRTCL_PEC : 0;

	switch (size) {

	case I2C_SMBUS_QUICK:
		protocol |= NVIDIA_SMB_PRTCL_QUICK;
		read_write = I2C_SMBUS_WRITE;
@@ -236,8 +235,7 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
			len = data->block[0];
			if ((len == 0) || (len > I2C_SMBUS_BLOCK_MAX)) {
				dev_err(&adap->dev,
						"Transaction failed "
						"(requested block size: %d)\n",
					"Transaction failed (requested block size: %d)\n",
					len);
				return -EINVAL;
			}
@@ -265,21 +263,21 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
		return 0;

	switch (size) {

	case I2C_SMBUS_BYTE:
	case I2C_SMBUS_BYTE_DATA:
		data->byte = inb_p(NVIDIA_SMB_DATA);
		break;

	case I2C_SMBUS_WORD_DATA:
			data->word = inb_p(NVIDIA_SMB_DATA) | (inb_p(NVIDIA_SMB_DATA+1) << 8);
		data->word = inb_p(NVIDIA_SMB_DATA) |
			     (inb_p(NVIDIA_SMB_DATA + 1) << 8);
		break;

	case I2C_SMBUS_BLOCK_DATA:
		len = inb_p(NVIDIA_SMB_BCNT);
		if ((len <= 0) || (len > I2C_SMBUS_BLOCK_MAX)) {
				dev_err(&adap->dev, "Transaction failed "
					"(received block size: 0x%02x)\n",
			dev_err(&adap->dev,
				"Transaction failed (received block size: 0x%02x)\n",
				len);
			return -EPROTO;
		}
@@ -377,7 +375,8 @@ static int nforce2_probe_smb(struct pci_dev *dev, int bar, int alt_reg,
		release_region(smbus->base, smbus->size);
		return error;
	}
	dev_info(&smbus->adapter.dev, "nForce2 SMBus adapter at %#x\n", smbus->base);
	dev_info(&smbus->adapter.dev, "nForce2 SMBus adapter at %#x\n",
		smbus->base);
	return 0;
}

@@ -388,7 +387,8 @@ static int nforce2_probe(struct pci_dev *dev, const struct pci_device_id *id)
	int res1, res2;

	/* we support 2 SMBus adapters */
	if (!(smbuses = kzalloc(2*sizeof(struct nforce2_smbus), GFP_KERNEL)))
	smbuses = kzalloc(2 * sizeof(struct nforce2_smbus), GFP_KERNEL);
	if (!smbuses)
		return -ENOMEM;
	pci_set_drvdata(dev, smbuses);