Fix errors introduced into Kinetis serial when I unsuccessfully tried to correct coding standard violations. Folks, things will be better for everyone if you just follow that standard.

This commit is contained in:
Gregory Nutt 2017-05-05 14:47:11 -06:00
parent 0e49db7626
commit 1cd3b3f590
2 changed files with 12 additions and 4 deletions

View File

@ -615,12 +615,12 @@ static int kinetis_ioctl(struct file *filep, int cmd, unsigned long arg)
{ {
#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_SERIAL_TIOCSERGSTRUCT) || \ #if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_SERIAL_TIOCSERGSTRUCT) || \
defined(CONFIG_KINETIS_SERIALBRK_BSDCOMPAT) defined(CONFIG_KINETIS_SERIALBRK_BSDCOMPAT)
struct inode *inode = filep->f_inode; struct inode *inode;
struct uart_dev_s *dev = inode->i_private; struct uart_dev_s *dev;
uint8_t regval; uint8_t regval;
#endif #endif
#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_KINETIS_SERIALBRK_BSDCOMPAT) #if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_KINETIS_SERIALBRK_BSDCOMPAT)
struct kinetis_dev_s *priv = (struct kinetis_dev_s *)dev->priv; struct kinetis_dev_s *priv;
bool iflow = false; bool iflow = false;
bool oflow = false; bool oflow = false;
#endif #endif
@ -634,6 +634,10 @@ static int kinetis_ioctl(struct file *filep, int cmd, unsigned long arg)
DEBUGASSERT(dev != NULL && dev->priv != NULL); DEBUGASSERT(dev != NULL && dev->priv != NULL);
#endif #endif
#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_KINETIS_SERIALBRK_BSDCOMPAT)
priv = (struct kinetis_dev_s *)dev->priv;
#endif
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT

View File

@ -980,7 +980,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
uint8_t regval; uint8_t regval;
#endif #endif
#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_KINETIS_SERIALBRK_BSDCOMPAT) #if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_KINETIS_SERIALBRK_BSDCOMPAT)
struct up_dev_s *priv = (struct up_dev_s *)dev->priv; struct up_dev_s *priv;
bool iflow = false; bool iflow = false;
bool oflow = false; bool oflow = false;
#endif #endif
@ -994,6 +994,10 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
DEBUGASSERT(dev != NULL && dev->priv != NULL); DEBUGASSERT(dev != NULL && dev->priv != NULL);
#endif #endif
#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_KINETIS_SERIALBRK_BSDCOMPAT)
priv = (struct up_dev_s *)dev->priv;
#endif
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT #ifdef CONFIG_SERIAL_TIOCSERGSTRUCT