[arch/linux] GCC diagnostic pragma outside of i2c_submit function

gives errors with codesourcery 2009q1 203 build toolchain:
error: #pragma GCC diagnostic not allowed inside functions
This commit is contained in:
Felix Ruess
2015-01-05 18:16:02 +01:00
parent 3acd9e1934
commit 7424f5044d
+4 -5
View File
@@ -46,6 +46,8 @@ bool_t i2c_idle(struct i2c_periph *p __attribute__((unused)))
return TRUE;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
bool_t i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
{
int file = (int)p->reg_addr;
@@ -53,9 +55,6 @@ bool_t i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
// Set the slave address
ioctl(file, I2C_SLAVE, t->slave_addr);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
// Switch the different transaction types
switch (t->type) {
// Just transmitting
@@ -84,12 +83,12 @@ bool_t i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
break;
}
#pragma GCC diagnostic pop
// Successfull transfer
t->status = I2CTransSuccess;
return TRUE;
}
#pragma GCC diagnostic pop
#if USE_I2C0
struct i2c_errors i2c0_errors;