| 1 |
/* PR ipa/96482 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-std=gnu17 -O2" } */ |
| 4 |
|
| 5 |
int i2c_transfer(); |
| 6 |
void _dev_err(); |
| 7 |
|
| 8 |
struct i2c_msg { |
| 9 |
char bufaddr; |
| 10 |
int adapterdev; |
| 11 |
} wdt87xx_i2c_xfer_client; |
| 12 |
|
| 13 |
int wdt87xx_i2c_xfer_client_0, wdt87xx_i2c_xfer_rxdata, wdt87xx_get_string_str_idx; |
| 14 |
|
| 15 |
void |
| 16 |
static wdt87xx_i2c_xfer(void *txdata, unsigned rxlen) { |
| 17 |
struct i2c_msg msgs[] = {wdt87xx_i2c_xfer_client_0, rxlen, |
| 18 |
wdt87xx_i2c_xfer_rxdata}; |
| 19 |
int error = i2c_transfer(wdt87xx_i2c_xfer_client, msgs); |
| 20 |
_dev_err("", __func__, error); |
| 21 |
} |
| 22 |
static void wdt87xx_get_string(unsigned len) { |
| 23 |
char tx_buf[] = {wdt87xx_get_string_str_idx, 3}; |
| 24 |
int rx_len = len + 2; |
| 25 |
wdt87xx_i2c_xfer(tx_buf, rx_len); |
| 26 |
} |
| 27 |
|
| 28 |
void |
| 29 |
wdt87xx_ts_probe_tx_buf() { |
| 30 |
wdt87xx_get_string(34); |
| 31 |
wdt87xx_get_string(8); |
| 32 |
wdt87xx_i2c_xfer(wdt87xx_ts_probe_tx_buf, 2); |
| 33 |
} |