Useless TIOCSERGSTRUCT logic in most serial drivers is not compiled unless CONFIG_DEBUG and CONFIG_SERIAL_TIOCSERGSTRUCT are defined

This commit is contained in:
Gregory Nutt 2013-04-25 15:52:48 -06:00
parent 8c4e03bba9
commit dd556fbded
16 changed files with 44 additions and 16 deletions

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* c5471/c5471_serial.c * c5471/c5471_serial.c
* *
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -620,6 +620,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -633,6 +634,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{ {

View File

@ -5,7 +5,7 @@
* Author: Stefan Richter <ichgeh@l--putt.de> * Author: Stefan Richter <ichgeh@l--putt.de>
* *
* based on c5471/c5471_serial.c * based on c5471/c5471_serial.c
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -707,6 +707,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -720,6 +721,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{ {

View File

@ -2,7 +2,7 @@
* arch/arm/src/dm320/dm320_serial.c * arch/arm/src/dm320/dm320_serial.c
* arch/arm/src/chip/dm320_serial.c * arch/arm/src/chip/dm320_serial.c
* *
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -546,6 +546,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -559,6 +560,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{ {

View File

@ -2,7 +2,7 @@
* arch/arm/src/imx/imx_serial.c * arch/arm/src/imx/imx_serial.c
* arch/arm/src/chip/imx_serial.c * arch/arm/src/chip/imx_serial.c
* *
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -885,6 +885,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -898,6 +899,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */ case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */

View File

@ -395,14 +395,14 @@ config ENET_NRXBUFFERS
default 6 default 6
---help--- ---help---
Number of Ethernet Rx buffers to use. The size of one buffer is Number of Ethernet Rx buffers to use. The size of one buffer is
determined by CONFIG_NET_BUFSIZE determined by NET_BUFSIZE
config ENET_NTXBUFFERS config ENET_NTXBUFFERS
int "Number of Ethernet Tx buffers" int "Number of Ethernet Tx buffers"
default 2 default 2
---help--- ---help---
Number of Ethernet Tx buffers to use. The size of one buffer is Number of Ethernet Tx buffers to use. The size of one buffer is
determined by CONFIG_NET_BUFSIZE determined by NET_BUFSIZE
config ENET_PHYADDR config ENET_PHYADDR
int "PHY address" int "PHY address"
@ -451,14 +451,14 @@ config KINETIS_MMCXFR_FREQ
config KINETIS_SD1BIT_FREQ config KINETIS_SD1BIT_FREQ
int "SD 1-bit transfer frequency" int "SD 1-bit transfer frequency"
default 20000000 default 20000000
depends on CONFIG_SDIO_WIDTH_D1_ONLY depends on SDIO_WIDTH_D1_ONLY
---help--- ---help---
Frequency to use for transferring data to/from an SD card using on a single data liune. Frequency to use for transferring data to/from an SD card using on a single data liune.
config KINETIS_SD4BIT_FREQ config KINETIS_SD4BIT_FREQ
int "SD 4-bit transfer frequency" int "SD 4-bit transfer frequency"
default 20000000 default 20000000
depends on !CONFIG_SDIO_WIDTH_D1_ONLY depends on !SDIO_WIDTH_D1_ONLY
---help--- ---help---
Frequency to use for transferring data to/from an SD card using all four data lines. Frequency to use for transferring data to/from an SD card using all four data lines.

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/lm/lm_serial.c * arch/arm/src/lm/lm_serial.c
* *
* Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2009-2010, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -1019,6 +1019,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -1032,6 +1033,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
default: default:
ret = -ENOTTY; ret = -ENOTTY;

View File

@ -1169,6 +1169,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -1182,6 +1183,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{ {

View File

@ -117,7 +117,7 @@ config LPC214X_USBDEV_DMA
bool "USB Device DMA Support" bool "USB Device DMA Support"
default n default n
config CONFIG_LPC214X_USBDEV_NDMADESCRIPTORS config LPC214X_USBDEV_NDMADESCRIPTORS
int "Number of USB DMA Descriptors" int "Number of USB DMA Descriptors"
default 8 default 8
depends on LPC214X_USBDEV_DMA depends on LPC214X_USBDEV_DMA

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/lpc214x/lpc214x_serial.c * arch/arm/src/lpc214x/lpc214x_serial.c
* *
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -569,6 +569,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -582,6 +583,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{ {

View File

@ -7,7 +7,7 @@
* *
* This file is part of the NuttX RTOS and based on the lpc2148 port: * This file is part of the NuttX RTOS and based on the lpc2148 port:
* *
* Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2010, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -692,6 +692,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s *)arg; struct up_dev_s *user = (struct up_dev_s *)arg;
@ -705,6 +706,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
case TIOCSBRK: /* BSD compatibility: Turn break on, case TIOCSBRK: /* BSD compatibility: Turn break on,
* unconditionally */ * unconditionally */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/lpc31xx/lpc31_serial.c * arch/arm/src/lpc31xx/lpc31_serial.c
* *
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -582,6 +582,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -595,6 +596,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{ {

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/lpc43xx/lpc43_serial.c * arch/arm/src/lpc43xx/lpc43_serial.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -1080,6 +1080,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -1093,6 +1094,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
#ifdef CONFIG_SERIAL_TERMIOS #ifdef CONFIG_SERIAL_TERMIOS
case TCGETS: case TCGETS:

View File

@ -760,6 +760,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct nuc_dev_s *user = (struct nuc_dev_s*)arg; struct nuc_dev_s *user = (struct nuc_dev_s*)arg;
@ -773,6 +774,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */ case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/sam3u/sam3u_serial.c * arch/arm/src/sam3u/sam3u_serial.c
* *
* Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2010, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -1138,6 +1138,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -1151,6 +1152,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
default: default:
ret = -ENOTTY; ret = -ENOTTY;

View File

@ -1621,6 +1621,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -1634,6 +1635,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
#ifdef CONFIG_STM32_USART_SINGLEWIRE #ifdef CONFIG_STM32_USART_SINGLEWIRE
case TIOCSSINGLEWIRE: case TIOCSSINGLEWIRE:

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/str71x/str71x_serial.c * arch/arm/src/str71x/str71x_serial.c
* *
* Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -759,6 +759,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
switch (cmd) switch (cmd)
{ {
#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
{ {
struct up_dev_s *user = (struct up_dev_s*)arg; struct up_dev_s *user = (struct up_dev_s*)arg;
@ -772,6 +773,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
default: default:
ret = -ENOTTY; ret = -ENOTTY;