summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/input/c/bugs.c
blob: d75a4782554443c8a77bc0ecee577a3a7d9245c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
typedef struct {
   int a;
   char b;
} foo_t;

s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *values)
{
	union i2c_smbus_data data;
	int i;
	if (i2c_smbus_xfer(client->adapter,client->addr,client->flags,
	                      I2C_SMBUS_READ,command,
	                      I2C_SMBUS_I2C_BLOCK_DATA,&data))
		return -1;
	else {
		for (i=1;i<=data.block[0];i ++)
			values[i-1] = data.block[i];
		return data.block[0];
	}
}

void foo(void)
{
   adap->nr=  id &  MAX_ID_MASK;

   list_for_each(item,&drivers) {
      driver=list_entry(item, struct i2c_driver, list);
      if (driver->detach_adapter)
         if ((res = driver->detach_adapter(adap)))
         {
            dev_err(&adap->dev, "detach_adapter failed "
                    "for driver [%s]\n", driver->name);
            goto out_unlock;
         }
   }
}