From dd556fbdeddf9048fa43d1b728b0280b3fe43551 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 25 Apr 2013 15:52:48 -0600 Subject: [PATCH] Useless TIOCSERGSTRUCT logic in most serial drivers is not compiled unless CONFIG_DEBUG and CONFIG_SERIAL_TIOCSERGSTRUCT are defined --- arch/arm/src/c5471/c5471_serial.c | 4 +++- arch/arm/src/calypso/calypso_serial.c | 4 +++- arch/arm/src/dm320/dm320_serial.c | 4 +++- arch/arm/src/imx/imx_serial.c | 4 +++- arch/arm/src/kinetis/Kconfig | 8 ++++---- arch/arm/src/lm/lm_serial.c | 4 +++- arch/arm/src/lpc17xx/lpc17_serial.c | 2 ++ arch/arm/src/lpc214x/Kconfig | 2 +- arch/arm/src/lpc214x/lpc214x_serial.c | 4 +++- arch/arm/src/lpc2378/lpc23xx_serial.c | 4 +++- arch/arm/src/lpc31xx/lpc31_serial.c | 4 +++- arch/arm/src/lpc43xx/lpc43_serial.c | 4 +++- arch/arm/src/nuc1xx/nuc_serial.c | 2 ++ arch/arm/src/sam3u/sam3u_serial.c | 4 +++- arch/arm/src/stm32/stm32_serial.c | 2 ++ arch/arm/src/str71x/str71x_serial.c | 4 +++- 16 files changed, 44 insertions(+), 16 deletions(-) diff --git a/arch/arm/src/c5471/c5471_serial.c b/arch/arm/src/c5471/c5471_serial.c index cdc5b6f24c..09018cb282 100644 --- a/arch/arm/src/c5471/c5471_serial.c +++ b/arch/arm/src/c5471/c5471_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ { diff --git a/arch/arm/src/calypso/calypso_serial.c b/arch/arm/src/calypso/calypso_serial.c index 5817b338b7..ddb37201dc 100644 --- a/arch/arm/src/calypso/calypso_serial.c +++ b/arch/arm/src/calypso/calypso_serial.c @@ -5,7 +5,7 @@ * Author: Stefan Richter * * 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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ { diff --git a/arch/arm/src/dm320/dm320_serial.c b/arch/arm/src/dm320/dm320_serial.c index fbeefd8e90..5b944b9b7f 100644 --- a/arch/arm/src/dm320/dm320_serial.c +++ b/arch/arm/src/dm320/dm320_serial.c @@ -2,7 +2,7 @@ * arch/arm/src/dm320/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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ { diff --git a/arch/arm/src/imx/imx_serial.c b/arch/arm/src/imx/imx_serial.c index d7a4c3296c..d7ac1a7325 100644 --- a/arch/arm/src/imx/imx_serial.c +++ b/arch/arm/src/imx/imx_serial.c @@ -2,7 +2,7 @@ * arch/arm/src/imx/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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */ diff --git a/arch/arm/src/kinetis/Kconfig b/arch/arm/src/kinetis/Kconfig index c444c065fb..bdca8c68b2 100644 --- a/arch/arm/src/kinetis/Kconfig +++ b/arch/arm/src/kinetis/Kconfig @@ -395,14 +395,14 @@ config ENET_NRXBUFFERS default 6 ---help--- 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 int "Number of Ethernet Tx buffers" default 2 ---help--- 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 int "PHY address" @@ -451,14 +451,14 @@ config KINETIS_MMCXFR_FREQ config KINETIS_SD1BIT_FREQ int "SD 1-bit transfer frequency" default 20000000 - depends on CONFIG_SDIO_WIDTH_D1_ONLY + depends on SDIO_WIDTH_D1_ONLY ---help--- Frequency to use for transferring data to/from an SD card using on a single data liune. config KINETIS_SD4BIT_FREQ int "SD 4-bit transfer frequency" default 20000000 - depends on !CONFIG_SDIO_WIDTH_D1_ONLY + depends on !SDIO_WIDTH_D1_ONLY ---help--- Frequency to use for transferring data to/from an SD card using all four data lines. diff --git a/arch/arm/src/lm/lm_serial.c b/arch/arm/src/lm/lm_serial.c index 6e772ecd50..f2e9796cfe 100644 --- a/arch/arm/src/lm/lm_serial.c +++ b/arch/arm/src/lm/lm_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif default: ret = -ENOTTY; diff --git a/arch/arm/src/lpc17xx/lpc17_serial.c b/arch/arm/src/lpc17xx/lpc17_serial.c index b2da4839f2..6bf519ac30 100644 --- a/arch/arm/src/lpc17xx/lpc17_serial.c +++ b/arch/arm/src/lpc17xx/lpc17_serial.c @@ -1169,6 +1169,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) switch (cmd) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ { diff --git a/arch/arm/src/lpc214x/Kconfig b/arch/arm/src/lpc214x/Kconfig index 5d52eb0001..25b82bd6b1 100644 --- a/arch/arm/src/lpc214x/Kconfig +++ b/arch/arm/src/lpc214x/Kconfig @@ -117,7 +117,7 @@ config LPC214X_USBDEV_DMA bool "USB Device DMA Support" default n -config CONFIG_LPC214X_USBDEV_NDMADESCRIPTORS +config LPC214X_USBDEV_NDMADESCRIPTORS int "Number of USB DMA Descriptors" default 8 depends on LPC214X_USBDEV_DMA diff --git a/arch/arm/src/lpc214x/lpc214x_serial.c b/arch/arm/src/lpc214x/lpc214x_serial.c index c647e458a8..f27eea9772 100644 --- a/arch/arm/src/lpc214x/lpc214x_serial.c +++ b/arch/arm/src/lpc214x/lpc214x_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ { diff --git a/arch/arm/src/lpc2378/lpc23xx_serial.c b/arch/arm/src/lpc2378/lpc23xx_serial.c index 08fe4ec73e..6fcb503f3b 100644 --- a/arch/arm/src/lpc2378/lpc23xx_serial.c +++ b/arch/arm/src/lpc2378/lpc23xx_serial.c @@ -7,7 +7,7 @@ * * 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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif case TIOCSBRK: /* BSD compatibility: Turn break on, * unconditionally */ diff --git a/arch/arm/src/lpc31xx/lpc31_serial.c b/arch/arm/src/lpc31xx/lpc31_serial.c index c383253138..f5f2c57832 100644 --- a/arch/arm/src/lpc31xx/lpc31_serial.c +++ b/arch/arm/src/lpc31xx/lpc31_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ { diff --git a/arch/arm/src/lpc43xx/lpc43_serial.c b/arch/arm/src/lpc43xx/lpc43_serial.c index adbfb282a7..8736d5db21 100644 --- a/arch/arm/src/lpc43xx/lpc43_serial.c +++ b/arch/arm/src/lpc43xx/lpc43_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif #ifdef CONFIG_SERIAL_TERMIOS case TCGETS: diff --git a/arch/arm/src/nuc1xx/nuc_serial.c b/arch/arm/src/nuc1xx/nuc_serial.c index c07ef1109c..6ecfb11598 100644 --- a/arch/arm/src/nuc1xx/nuc_serial.c +++ b/arch/arm/src/nuc1xx/nuc_serial.c @@ -760,6 +760,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) switch (cmd) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */ case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */ diff --git a/arch/arm/src/sam3u/sam3u_serial.c b/arch/arm/src/sam3u/sam3u_serial.c index a4d79a11b6..ef1345f8e2 100644 --- a/arch/arm/src/sam3u/sam3u_serial.c +++ b/arch/arm/src/sam3u/sam3u_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif default: ret = -ENOTTY; diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index c04bcc9ee9..4594c187e8 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -1621,6 +1621,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg) switch (cmd) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif #ifdef CONFIG_STM32_USART_SINGLEWIRE case TIOCSSINGLEWIRE: diff --git a/arch/arm/src/str71x/str71x_serial.c b/arch/arm/src/str71x/str71x_serial.c index 2098758b1c..2356898bb5 100644 --- a/arch/arm/src/str71x/str71x_serial.c +++ b/arch/arm/src/str71x/str71x_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * 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) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT case TIOCSERGSTRUCT: { 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; +#endif default: ret = -ENOTTY;