diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_appinit.c index 9c131c9f105..ed6a6030816 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_appinit.c @@ -116,18 +116,10 @@ /* Debug ********************************************************************/ -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG_INFO -# define message(...) _info(__VA_ARGS__) -# else -# define message(...) syslog(LOG_INFO, __VA_ARGS__) -# endif +#ifdef CONFIG_DEBUG_INFO +# define message _info #else -# ifdef CONFIG_DEBUG_INFO -# define message _info -# else -# define message _err -# endif +# define message _err #endif /**************************************************************************** @@ -186,7 +178,7 @@ int board_app_initialize(uintptr_t arg) CONFIG_NSH_MMCSDSLOTNO, spi); if (ret < 0) { - message("board_app_initialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", + message("Failed to bind SPI port %d to MMC/SD slot %d: %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); return ret; } diff --git a/drivers/power/bq2425x.c b/drivers/power/bq2425x.c index 17fc77e2c27..47b27e70dd3 100644 --- a/drivers/power/bq2425x.c +++ b/drivers/power/bq2425x.c @@ -82,13 +82,8 @@ # define baterr _err # define batreg _err #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define baterr(x...) -# define batreg(x...) -# else -# define baterr (void) -# define batreg (void) -# endif +# define baterr _none +# define batreg _none #endif /**************************************************************************** @@ -100,7 +95,7 @@ struct bq2425x_dev_s /* The common part of the battery driver visible to the upper-half driver */ FAR const struct battery_charger_operations_s *ops; /* Battery operations */ - sem_t batsem; /* Enforce mutually exclusive access */ + sem_t batsem; /* Enforce mutually exclusive access */ /* Data fields specific to the lower half BQ2425x driver follow */ @@ -636,7 +631,8 @@ static inline int bq2425x_setvolt(FAR struct bq2425x_dev_s *priv, int volts) * ****************************************************************************/ -static inline int bq2425x_setcurr(FAR struct bq2425x_dev_s *priv, int current) +static inline int bq2425x_setcurr(FAR struct bq2425x_dev_s *priv, + int current) { uint8_t regval; int idx; @@ -744,7 +740,7 @@ static int bq2425x_input_current(FAR struct battery_charger_dev_s *dev, ret = bq2425x_powersupply(priv, value); if (ret < 0) { - baterr("ERROR: Failed to set BQ2425x power supply input limit: %d\n", ret); + baterr("ERROR: Failed to set BQ2425x power supply: %d\n", ret); return ret; } @@ -804,7 +800,7 @@ FAR struct battery_charger_dev_s * /* Initialize the BQ2425x device structure */ - priv = (FAR struct bq2425x_dev_s *)kmm_zalloc(sizeof(struct bq2425x_dev_s)); + priv = kmm_zalloc(sizeof(struct bq2425x_dev_s)); if (priv) { /* Initialize the BQ2425x device structure */ @@ -840,7 +836,7 @@ FAR struct battery_charger_dev_s * ret = bq2425x_powersupply(priv, current); if (ret < 0) { - baterr("ERROR: Failed to set BQ2425x power supply input limit: %d\n", ret); + baterr("ERROR: Failed to set BQ2425x power supply: %d\n", ret); kmm_free(priv); return NULL; } diff --git a/drivers/power/bq2429x.c b/drivers/power/bq2429x.c index 1492e5e97e2..5de34e2af2b 100644 --- a/drivers/power/bq2429x.c +++ b/drivers/power/bq2429x.c @@ -103,15 +103,9 @@ # define batdbg _info # define batinfo _info #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define baterr(x...) -# define batdbg(x...) -# define batinfo(x...) -# else -# define baterr (void) -# define batdbg (void) -# define batinfo(void) -# endif +# define baterr _none +# define batdbg _none +# define batinfo _none #endif /**************************************************************************** @@ -123,7 +117,7 @@ struct bq2429x_dev_s /* The common part of the battery driver visible to the upper-half driver */ FAR const struct battery_charger_operations_s *ops; /* Battery operations */ - sem_t batsem; /* Enforce mutually exclusive access */ + sem_t batsem; /* Enforce mutually exclusive access */ /* Data fields specific to the lower half BQ2429X driver follow */ @@ -152,8 +146,7 @@ static int bq2429x_en_stat(FAR struct bq2429x_dev_s *priv, bool state); static int bq2429x_setboost_otg_config(FAR struct bq2429x_dev_s *priv, bool state); static int bq2429x_powersupply(FAR struct bq2429x_dev_s *priv, int current); -static inline int bq2429x_setvolt(FAR struct bq2429x_dev_s *priv, - int volts); +static int bq2429x_setvolt(FAR struct bq2429x_dev_s *priv, int volts); static inline int bq2429x_setcurr(FAR struct bq2429x_dev_s *priv, int req_current); @@ -388,7 +381,7 @@ static int bq2429x_watchdog(FAR struct bq2429x_dev_s *priv, bool enable) /* Hw Default is 40Sec so use that for time being */ regval &= ~(BQ2429XR5_WATCHDOG_MASK); - regval |= BQ2429XR5_WATCHDOG_040Sec; + regval |= BQ2429XR5_WATCHDOG_040SEC; } else { @@ -455,7 +448,7 @@ static int bq2429x_syson(FAR struct bq2429x_dev_s *priv) * * Description: * Enable charger termination. When termination is disabled, there are no - * indications of the charger terminating (i.e. STAT pin or STAT registers). + * indications of the charger terminating (i.e. STAT pin or registers). * ****************************************************************************/ @@ -499,7 +492,8 @@ static int bq2429x_en_term(FAR struct bq2429x_dev_s *priv, bool state) * Name: bq2429x_en_hiz * * Description: - * Enable high-impedance mode. Sets the charger IC into low power standby mode. + * Enable high-impedance mode. Sets the charger IC into low power standby + * mode. * ****************************************************************************/ @@ -848,40 +842,40 @@ static int bq2429x_powersupply(FAR struct bq2429x_dev_s *priv, int current) switch (current) { case 100: - idx = BQ2429XR0_INLIM_0100mA; + idx = BQ2429XR0_INLIM_0100MA; break; case 150: - idx = BQ2429XR0_INLIM_0150mA; + idx = BQ2429XR0_INLIM_0150MA; break; case 500: - idx = BQ2429XR0_INLIM_0500mA; + idx = BQ2429XR0_INLIM_0500MA; break; case 900: - idx = BQ2429XR0_INLIM_0900mA; + idx = BQ2429XR0_INLIM_0900MA; break; case 1000: - idx = BQ2429XR0_INLIM_1000mA; + idx = BQ2429XR0_INLIM_1000MA; break; case 1500: - idx = BQ2429XR0_INLIM_1500mA; + idx = BQ2429XR0_INLIM_1500MA; break; case 2000: - idx = BQ2429XR0_INLIM_2000mA; + idx = BQ2429XR0_INLIM_2000MA; break; case 3000: - idx = BQ2429XR0_INLIM_3000mA; + idx = BQ2429XR0_INLIM_3000MA; break; default: baterr("ERROR: Current not supported, setting default to 100mA.!\n"); - idx = BQ2429XR0_INLIM_0100mA; + idx = BQ2429XR0_INLIM_0100MA; break; } @@ -917,7 +911,7 @@ static int bq2429x_powersupply(FAR struct bq2429x_dev_s *priv, int current) * ****************************************************************************/ -static inline int bq2429x_setvolt(FAR struct bq2429x_dev_s *priv, int req_volts) +static int bq2429x_setvolt(FAR struct bq2429x_dev_s *priv, int req_volts) { uint8_t regval; int idx; @@ -1129,8 +1123,9 @@ static int bq2429x_input_current(FAR struct battery_charger_dev_s *dev, * * Description: * Do miscellaneous battery operation. There are numerous options that are - * configurable on the bq2429x that go beyond what the NuttX battery charger - * API provide access to. This operate() function allows changing some of them. + * configurable on the bq2429x that go beyond what the NuttX battery + * charger API provide access to. This operate() function allows changing + * some of them. * * REG00 EN_HIZ * REG01[1] BOOST_LIM 1A/1.5A Default:1.5A @@ -1168,7 +1163,8 @@ static int bq2429x_operate(FAR struct battery_charger_dev_s *dev, uintptr_t param) { FAR struct bq2429x_dev_s *priv = (FAR struct bq2429x_dev_s *)dev; - FAR struct batio_operate_msg_s *msg = (FAR struct batio_operate_msg_s *)param; + FAR struct batio_operate_msg_s *msg = + (FAR struct batio_operate_msg_s *)param; int op; int value; int ret = OK; @@ -1194,7 +1190,7 @@ static int bq2429x_operate(FAR struct battery_charger_dev_s *dev, case BATIO_OPRTN_HIZ: ret = bq2429x_en_hiz(priv, (bool)value); - /* Also need to set to 100mA USB host and if the battery above Vbatgd? */ + /* Also need to set to 100mA USB host if the battery above Vbatgd? */ break; @@ -1258,7 +1254,7 @@ FAR struct battery_charger_dev_s * /* Initialize the BQ2429x device structure */ - priv = (FAR struct bq2429x_dev_s *)kmm_zalloc(sizeof(struct bq2429x_dev_s)); + priv = kmm_zalloc(sizeof(struct bq2429x_dev_s)); if (priv) { /* Initialize the BQ2429x device structure */ @@ -1294,7 +1290,7 @@ FAR struct battery_charger_dev_s * ret = bq2429x_powersupply(priv, current); if (ret < 0) { - baterr("ERROR: Failed to set BQ2429x power supply input limit: %d\n", ret); + baterr("ERROR: Failed to set BQ2429x power supply: %d\n", ret); kmm_free(priv); return NULL; } diff --git a/drivers/power/bq769x0.c b/drivers/power/bq769x0.c index f3123fde8b3..882f51a8706 100644 --- a/drivers/power/bq769x0.c +++ b/drivers/power/bq769x0.c @@ -83,15 +83,9 @@ # define batreg _err # define batinfo _info #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define baterr(x...) -# define batreg(x...) -# define batinfo(x...) -# else -# define baterr(void) -# define batreg(void) -# define batinfo(void) -# endif +# define baterr _none +# define batreg _none +# define batinfo _none #endif /**************************************************************************** @@ -103,7 +97,7 @@ struct bq769x0_dev_s /* The common part of the battery driver visible to the upper-half driver */ FAR const struct battery_monitor_operations_s *ops; /* Battery operations */ - sem_t batsem; /* Enforce mutually exclusive access */ + sem_t batsem; /* Enforce mutually exclusive access */ /* Data fields specific to the lower half BQ769x0 driver follow */ @@ -255,26 +249,25 @@ static int bq769x0_getnreg16(FAR struct bq769x0_dev_s *priv, uint8_t regaddr, /* Device functions */ -static inline int bq769x0_getreport(FAR struct bq769x0_dev_s *priv, - FAR uint8_t *report); -static inline int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, - FAR int *volts); -static inline int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv, - FAR struct battery_monitor_current_s *current); -static inline int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv, - FAR struct battery_monitor_voltage_s *voltages); -static inline int bq769x0_gettemperature(FAR struct bq769x0_dev_s *priv, - FAR struct battery_monitor_temperature_s *temps); -static inline int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv, - FAR struct battery_monitor_balance_s *bal); -static inline int bq769x0_doshutdown(FAR struct bq769x0_dev_s *priv); -static inline int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv, - FAR struct battery_monitor_limits_s *limits); -static inline int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv, - FAR struct battery_monitor_switches_s *sw); -static inline int bq769x0_clear_chipfaults(FAR struct bq769x0_dev_s *priv, - uint8_t faults); -static inline int bq769x0_updategain(FAR struct bq769x0_dev_s *priv); +static int bq769x0_getreport(FAR struct bq769x0_dev_s *priv, + FAR uint8_t *report); +static int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, FAR int *volts); +static int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_current_s *current); +static int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_voltage_s *voltages); +static int bq769x0_gettemperature(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_temperature_s *temps); +static int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_balance_s *bal); +static int bq769x0_doshutdown(FAR struct bq769x0_dev_s *priv); +static int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_limits_s *limits); +static int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_switches_s *sw); +static int bq769x0_clear_chipfaults(FAR struct bq769x0_dev_s *priv, + uint8_t faults); +static int bq769x0_updategain(FAR struct bq769x0_dev_s *priv); static int bq769x0_chip_cellcount(FAR struct bq769x0_dev_s *priv); /* Battery driver lower half methods */ @@ -368,7 +361,7 @@ static int bq769x0_getreg8(FAR struct bq769x0_dev_s *priv, uint8_t regaddr, return ret; } - /* Our expected data length varies depending on whether or not a CRC is used */ + /* Our expected data length varies depending on whetherCRC is used */ if (priv->crc) { @@ -441,7 +434,7 @@ static int bq769x0_putreg8(FAR struct bq769x0_dev_s *priv, uint8_t regaddr, buffer[0] = regaddr; buffer[1] = regval; - /* Our expected data length varies depending on whether or not a CRC is used */ + /* Our expected data length varies depending on whether CRC is used */ if (priv->crc) { @@ -540,7 +533,7 @@ static int bq769x0_getnreg16(FAR struct bq769x0_dev_s *priv, uint8_t regaddr, byte_count = 2 * count; - /* Our expected I2C data length varies depending on whether or not a CRC is used */ + /* Our expected I2C data length varies depending on whether CRC is used */ if (priv->crc) { @@ -584,7 +577,7 @@ static int bq769x0_getnreg16(FAR struct bq769x0_dev_s *priv, uint8_t regaddr, crc = 0; } - /* Copy 16-bit values to be returned, skipping CRC bytes*/ + /* Copy 16-bit values to be returned, skipping CRC bytes */ for (i = 0; i < datalen; i += 4) { @@ -614,8 +607,8 @@ static int bq769x0_getnreg16(FAR struct bq769x0_dev_s *priv, uint8_t regaddr, * ****************************************************************************/ -static inline int bq769x0_getreport(FAR struct bq769x0_dev_s *priv, - uint8_t *report) +static int bq769x0_getreport(FAR struct bq769x0_dev_s *priv, + FAR uint8_t *report) { uint8_t regval = 0; int ret; @@ -638,7 +631,7 @@ static inline int bq769x0_getreport(FAR struct bq769x0_dev_s *priv, * ****************************************************************************/ -static inline int bq769x0_updategain(FAR struct bq769x0_dev_s *priv) +static int bq769x0_updategain(FAR struct bq769x0_dev_s *priv) { int ret; uint8_t gainreg1; @@ -696,7 +689,7 @@ static inline int bq769x0_updategain(FAR struct bq769x0_dev_s *priv) * ****************************************************************************/ -static inline int bq769x0_doshutdown(FAR struct bq769x0_dev_s *priv) +static int bq769x0_doshutdown(FAR struct bq769x0_dev_s *priv) { int ret; uint8_t regval; @@ -763,8 +756,8 @@ static inline int bq769x0_doshutdown(FAR struct bq769x0_dev_s *priv) * ****************************************************************************/ -static inline int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv, - struct battery_monitor_limits_s *limits) +static int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_limits_s *limits) { int ret; int i; @@ -1203,8 +1196,8 @@ static inline int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv, * ****************************************************************************/ -static inline int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv, - struct battery_monitor_switches_s *sw) +static int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_switches_s *sw) { int ret; uint8_t regval; @@ -1257,8 +1250,8 @@ static inline int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv, * ****************************************************************************/ -static inline int bq769x0_clear_chipfaults(FAR struct bq769x0_dev_s *priv, - uint8_t faults) +static int bq769x0_clear_chipfaults(FAR struct bq769x0_dev_s *priv, + uint8_t faults) { int ret; @@ -1395,7 +1388,7 @@ static int bq769x0_online(struct battery_monitor_dev_s *dev, bool *status) * ****************************************************************************/ -static inline int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, int *volts) +static int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, int *volts) { uint16_t regval; int ret; @@ -1429,8 +1422,8 @@ static inline int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, int *volts) * ****************************************************************************/ -static inline int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv, - struct battery_monitor_voltage_s *voltages) +static int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_voltage_s *voltages) { uint16_t regvals[BQ769X0_MAX_CELLS]; int ret; @@ -1487,8 +1480,8 @@ static inline int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv, * ****************************************************************************/ -static inline int bq769x0_gettemperature(FAR struct bq769x0_dev_s *priv, - struct battery_monitor_temperature_s *temps) +static int bq769x0_gettemperature(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_temperature_s *temps) { int chip_sensors; int ret; @@ -1572,8 +1565,8 @@ static int bq769x0_chip_cellcount(FAR struct bq769x0_dev_s *priv) * ****************************************************************************/ -static inline int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv, - FAR struct battery_monitor_current_s *current) +static int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_current_s *current) { /* The BQ769X0's "coulomb counter" reports average current over a 250ms * period. This can be integrated by the user application to measure @@ -1663,8 +1656,8 @@ static inline int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv, * ****************************************************************************/ -static inline int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv, - struct battery_monitor_balance_s *bal) +static int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv, + FAR struct battery_monitor_balance_s *bal) { int i; int j; @@ -1726,7 +1719,7 @@ static inline int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv, } } - /* Now split the result into 3 groups of 5 and send*/ + /* Now split the result into 3 groups of 5 and send */ for (i = 0; i < BQ769X0_BAL_REG_COUNT; i += 1) { @@ -1922,7 +1915,7 @@ static int bq769x0_shutdown(struct battery_monitor_dev_s *dev, ret = bq769x0_doshutdown(priv); if (ret < 0) { - baterr("ERROR: Error putting BQ769X0 into low-power state! Error = %d\n", + baterr("ERROR: putting BQ769X0 into low-power state! Error = %d\n", ret); return ret; } @@ -2100,7 +2093,7 @@ FAR struct battery_monitor_dev_s * /* Initialize the BQ769x0 device structure */ - priv = (FAR struct bq769x0_dev_s *)kmm_zalloc(sizeof(struct bq769x0_dev_s)); + priv = kmm_zalloc(sizeof(struct bq769x0_dev_s)); if (priv) { /* Initialize the BQ769x0 device structure */ diff --git a/drivers/power/max1704x.c b/drivers/power/max1704x.c index aca4d95259f..ab72878d61e 100644 --- a/drivers/power/max1704x.c +++ b/drivers/power/max1704x.c @@ -34,10 +34,10 @@ * ****************************************************************************/ -/* "The MAX17040/MAX17041 are ultra-compact, low-cost, host-side fuel-gauge - * systems for lithium-ion (Li+) batteries in handheld and portable equipment. - * The MAX17040 is configured to operate with a single lithium cell and the - * MAX17041 is configured for a dual-cell 2S pack. +/* "MAX17040/MAX17041 are ultra-compact, low-cost, host-side fuel-gauge + * systems for lithium-ion (Li+) batteries in handheld and portable + * equipment. MAX17040 is configured to operate with a single lithium cell + * and the MAX17041 is configured for a dual-cell 2S pack. */ /**************************************************************************** @@ -83,14 +83,14 @@ /* MAX1704x Register Definitions ********************************************/ -/* "All host interaction with the MAX17040/MAX17041 is handled by writing to - * and reading from register locations. The MAX17040/MAX17041 have six 16-bit +/* "All host interaction with MAX17040/MAX17041 is handled by writing to + * and reading from register locations. MAX17040/MAX17041 have six 16-bit * registers: SOC, VCELL, MODE, VERSION, RCOMP, and COMMAND. Register reads * and writes are only valid if all 16 bits are transferred..." */ /* "VCELL Register. Battery voltage is measured at the CELL pin input with - * respect to GND over a 0 to 5.00V range for the MAX17040 and 0 to 10.00V + * respect to GND over a 0 to 5.00V range for MAX17040 and 0 to 10.00V * for the MAX17041 with resolutions of 1.25mV and 2.50mV, respectively..." */ @@ -111,8 +111,8 @@ #endif /* "SOC Register. The SOC register is a read-only register that displays the - * state of charge of the cell as calculated by the ModelGauge algorithm. The - * result is displayed as a percentage of the cell’s full capacity... + * state of charge of the cell as calculated by the ModelGauge algorithm. + * The result is displayed as a percentage of the cell’s full capacity... * * "...Units of % can be directly determined by observing only the high byte * of the SOC register. The low byte provides additional resolution in units @@ -137,7 +137,7 @@ #define MAX1407X_MODE_QUICKSTART 0x4000 /* "The VERSION register is a read-only register that contains a value - * indicating the production version of the MAX17040/MAX17041." + * indicating the production version of MAX17040/MAX17041." */ #define MAX1407X_VERSION_ADDR 0x08 /* Bits 0-15: 16-bit VERSION */ @@ -165,11 +165,7 @@ #ifdef CONFIG_DEBUG_MAX1704X # define baterr _err #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define baterr(x...) -# else -# define baterr (void) -# endif +# define baterr _none #endif /**************************************************************************** @@ -181,7 +177,7 @@ struct max1704x_dev_s /* The common part of the battery driver visible to the upper-half driver */ FAR const struct battery_gauge_operations_s *ops; /* Battery operations */ - sem_t batsem; /* Enforce mutually exclusive access */ + sem_t batsem; /* Enforce mutually exclusive access */ /* Data fields specific to the lower half MAX1704x driver follow */ @@ -196,10 +192,10 @@ struct max1704x_dev_s /* I2C support */ -static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, - FAR uint16_t *regval); -static int max1704x_putreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, - uint16_t regval); +static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, + uint8_t regaddr, FAR uint16_t *regval); +static int max1704x_putreg16(FAR struct max1704x_dev_s *priv, + uint8_t regaddr, uint16_t regval); static inline int max1704x_getvcell(FAR struct max1704x_dev_s *priv, b16_t *vcell); @@ -244,8 +240,8 @@ static const struct battery_gauge_operations_s g_max1704xops = * ****************************************************************************/ -static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, - FAR uint16_t *regval) +static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, + uint8_t regaddr, FAR uint16_t *regval) { struct i2c_config_s config; uint8_t buffer[2]; @@ -290,8 +286,8 @@ static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, * ****************************************************************************/ -static int max1704x_putreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, - uint16_t regval) +static int max1704x_putreg16(FAR struct max1704x_dev_s *priv, + uint8_t regaddr, uint16_t regval) { struct i2c_config_s config; uint8_t buffer[3]; @@ -371,7 +367,8 @@ static inline int max1704x_getsoc(FAR struct max1704x_dev_s *priv, static inline int max1704x_setquikstart(FAR struct max1704x_dev_s *priv) { - return max1704x_putreg16(priv, MAX1407X_MODE_ADDR, MAX1407X_MODE_QUICKSTART); + return max1704x_putreg16(priv, MAX1407X_MODE_ADDR, + MAX1407X_MODE_QUICKSTART); } /**************************************************************************** @@ -396,7 +393,8 @@ static inline int max1704x_getversion(FAR struct max1704x_dev_s *priv, * ****************************************************************************/ -static inline int max1704x_setrcomp(FAR struct max1704x_dev_s *priv, uint16_t rcomp) +static inline int max1704x_setrcomp(FAR struct max1704x_dev_s *priv, + uint16_t rcomp) { return max1704x_putreg16(priv, MAX1407X_RCOMP_ADDR, rcomp); } @@ -405,13 +403,14 @@ static inline int max1704x_setrcomp(FAR struct max1704x_dev_s *priv, uint16_t rc * Name: max1704x_reset * * Description: - * Reset the MAX1704x + * Reset MAX1704x * ****************************************************************************/ static inline int max1704x_reset(FAR struct max1704x_dev_s *priv) { - return max1704x_putreg16(priv, MAX1407X_COMMAND_ADDR, MAX1407X_COMMAND_POR); + return max1704x_putreg16(priv, MAX1407X_COMMAND_ADDR, + MAX1407X_COMMAND_POR); } /**************************************************************************** @@ -510,7 +509,7 @@ static int max1704x_capacity(struct battery_gauge_dev_s *dev, b16_t *value) * Name: max1704x_initialize * * Description: - * Initialize the MAX1704x battery driver and return an instance of the + * Initialize MAX1704x battery driver and return an instance of the * lower_half interface that may be used with battery_register(); * * This driver requires: @@ -522,31 +521,31 @@ static int max1704x_capacity(struct battery_gauge_dev_s *dev, b16_t *value) * chip is on the board in order to scale the voltage correctly. * * Input Parameters: - * i2c - An instance of the I2C interface to use to communicate with the MAX1704x - * addr - The I2C address of the MAX1704x (Better be 0x36). + * i2c - An instance of the I2C interface to communicate with MAX1704x + * addr - The I2C address of MAX1704x (Better be 0x36). * frequency - The I2C frequency * * Returned Value: - * A pointer to the initializeed lower-half driver instance. A NULL pointer - * is returned on a failure to initialize the MAX1704x lower half. + * A pointer to the initializeed lower-half driver instance. A NULL pointer + * is returned on a failure to initialize MAX1704x lower half. * ****************************************************************************/ -FAR struct battery_gauge_dev_s *max1704x_initialize(FAR struct i2c_master_s *i2c, - uint8_t addr, - uint32_t frequency) +FAR struct battery_gauge_dev_s * +max1704x_initialize(FAR struct i2c_master_s *i2c, + uint8_t addr, uint32_t frequency) { FAR struct max1704x_dev_s *priv; #if 0 int ret; #endif - /* Initialize the MAX1704x device structure */ + /* Initialize MAX1704x device structure */ - priv = (FAR struct max1704x_dev_s *)kmm_zalloc(sizeof(struct max1704x_dev_s)); + priv = kmm_zalloc(sizeof(struct max1704x_dev_s)); if (priv) { - /* Initialize the MAX1704x device structure */ + /* Initialize MAX1704x device structure */ nxsem_init(&priv->batsem, 0, 1); priv->ops = &g_max1704xops; @@ -554,13 +553,13 @@ FAR struct battery_gauge_dev_s *max1704x_initialize(FAR struct i2c_master_s *i2c priv->addr = addr; priv->frequency = frequency; - /* Reset the MAX1704x (mostly just to make sure that we can talk to it) */ + /* Reset MAX1704x (mostly just to make sure that we can talk to it) */ #if 0 ret = max1704x_reset(priv); if (ret < 0) { - baterr("Failed to reset the MAX1704x: %d\n", ret); + baterr("Failed to reset MAX1704x: %d\n", ret); kmm_free(priv); return NULL; } diff --git a/drivers/power/mcp73871.c b/drivers/power/mcp73871.c index 4da5fa517b0..66b87c17dfa 100644 --- a/drivers/power/mcp73871.c +++ b/drivers/power/mcp73871.c @@ -78,13 +78,8 @@ # define baterr _err # define batreg _err #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define baterr(x...) -# define batreg(x...) -# else -# define baterr (void) -# define batreg (void) -# endif +# define baterr _none +# define batreg _none #endif /**************************************************************************** diff --git a/drivers/timers/cs2100-cp.c b/drivers/timers/cs2100-cp.c index d4791082bc9..a60694abe8d 100644 --- a/drivers/timers/cs2100-cp.c +++ b/drivers/timers/cs2100-cp.c @@ -68,32 +68,16 @@ #undef cserr #ifdef CONFIG_CS2100CP_DEBUG -# ifdef CONFIG_CPP_HAVE_VARARGS -# define cserr(format, ...) _err(format, ##__VA_ARGS__) -# else -# define cserr _err -# endif +# define cserr _err #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define cserr(x...) -# else -# define cserr (void) -# endif +# define cserr _none #endif #undef reginfo #ifdef CONFIG_CS2100CP_REGDEBUG -# ifdef CONFIG_CPP_HAVE_VARARGS -# define reginfo(format, ...) _err(format, ##__VA_ARGS__) -# else -# define reginfo _err -# endif +# define reginfo _err #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define reginfo(x...) -# else -# define reginfo (void) -# endif +# define reginfo _none #endif /**************************************************************************** @@ -539,12 +523,12 @@ static int cs2100_ratio(FAR const struct cs2100_config_s *config) } else if (rudb24 >= (1ull << (32 + 8))) { - rud = (uint32_t)rudb24 >> 9; /* RUD = 8*RUDb12 */ + rud = (uint32_t)rudb24 >> 9; /* RUD = 8*RUDb12 */ rmod = 6; /* Reff = RUD / 8 */ } else /* if (rudb24 >= (1ull << (32 + 7))) */ { - rud = (uint32_t)rudb24 >> 8; /* RUD = 16*RUDb12 */ + rud = (uint32_t)rudb24 >> 8; /* RUD = 16*RUDb12 */ rmod = 7; /* Reff = RUD / 16 */ } } diff --git a/fs/spiffs/src/spiffs_cache.h b/fs/spiffs/src/spiffs_cache.h index e3652aed4b9..b0599367397 100644 --- a/fs/spiffs/src/spiffs_cache.h +++ b/fs/spiffs/src/spiffs_cache.h @@ -1,5 +1,5 @@ /**************************************************************************** - * fs/spiffs.h/spiffs_cache.h + * fs/spiffs/src/spiffs_cache.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -77,17 +77,9 @@ extern "C" /* Debug */ #ifdef CONFIG_SPIFFS_CACHEDBG -# ifdef CONFIG_CPP_HAVE_VARARGS -# define spiffs_cacheinfo(format, ...) _info(format, ##__VA_ARGS__) -# else -# define spiffs_cacheinfo _info -# endif +# define spiffs_cacheinfo _info #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define spiffs_cacheinfo(format, ...) -# else -# define spiffs_cacheinfo (void) -# endif +# define spiffs_cacheinfo _none #endif /**************************************************************************** diff --git a/fs/spiffs/src/spiffs_check.h b/fs/spiffs/src/spiffs_check.h index 716dabb6ea0..be628651dbf 100644 --- a/fs/spiffs/src/spiffs_check.h +++ b/fs/spiffs/src/spiffs_check.h @@ -1,5 +1,5 @@ /**************************************************************************** - * fs/spiffs.h/spiffs_check.h + * fs/spiffs/src/spiffs_check.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -55,19 +55,13 @@ extern "C" /* Consistency check output */ -#ifdef CONFIG_SPIFFS_CHECK_OUTPUT -# ifdef CONFIG_CPP_HAVE_VARARGS -# define spiffs_checkinfo(format, ...) \ - syslog(LOG_NOTICE, "SPIFFS: " format, ##__VA_ARGS__) -# else -# define spiffs_checkinfo _info -# endif +#if !defined(CONFIG_SPIFFS_CHECK_OUTPUT) +# define spiffs_checkinfo _none +#elif defined(CONFIG_CPP_HAVE_VARARGS) +# define spiffs_checkinfo(format, ...) \ + syslog(LOG_NOTICE, "SPIFFS: " format, ##__VA_ARGS__) #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define spiffs_checkinfo(format, ...) -# else -# define spiffs_checkinfo (void) -# endif +# define spiffs_checkinfo _info #endif /**************************************************************************** @@ -114,7 +108,8 @@ int spiffs_check_luconsistency(FAR struct spiffs_s *fs); * - x011 used, referenced only once, not index * - x101 used, unreferenced, index * - * The working memory might not fit all pages so several scans might be needed + * The working memory might not fit all pages so several scans might be + * needed * * Input Parameters: * fs - A reference to the SPIFFS volume object instance @@ -147,7 +142,6 @@ int spiffs_check_pgconsistency(FAR struct spiffs_s *fs); int spiffs_check_objidconsistency(FAR struct spiffs_s *fs); - /**************************************************************************** * Name: spiffs_dump * diff --git a/fs/spiffs/src/spiffs_gc.h b/fs/spiffs/src/spiffs_gc.h index 8531a3d7b0d..4cad40c6b2f 100644 --- a/fs/spiffs/src/spiffs_gc.h +++ b/fs/spiffs/src/spiffs_gc.h @@ -1,5 +1,5 @@ /**************************************************************************** - * fs/spiffs.h/spiffs_gc.h + * fs/spiffs/src/spiffs_gc.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -56,17 +56,9 @@ extern "C" /* Debug */ #ifdef CONFIG_SPIFFS_GCDBG -# ifdef CONFIG_CPP_HAVE_VARARGS -# define spiffs_gcinfo(format, ...) _info(format, ##__VA_ARGS__) -# else -# define spiffs_gcinfo _info -# endif +# define spiffs_gcinfo _info #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define spiffs_gcinfo(format, ...) -# else -# define spiffs_gcinfo (void) -# endif +# define spiffs_gcinfo _none #endif /**************************************************************************** @@ -111,8 +103,8 @@ int spiffs_gc_quick(FAR struct spiffs_s *fs, uint16_t max_free_pages); * this method in order to determine what amount of bytes to give. * * NB: the garbage collector is automatically called when spiffs needs free - * pages. The reason for this function is to give possibility to do background - * tidying when user knows the system is idle. + * pages. The reason for this function is to give possibility to do + * background tidying when user knows the system is idle. * * Input Parameters: * fs the file system struct diff --git a/fs/spiffs/src/spiffs_mtd.h b/fs/spiffs/src/spiffs_mtd.h index 09360cc6f15..08db7f8e468 100644 --- a/fs/spiffs/src/spiffs_mtd.h +++ b/fs/spiffs/src/spiffs_mtd.h @@ -1,5 +1,5 @@ /**************************************************************************** - * fs/spiffs.h/spiffs_mtd.h + * fs/spiffs/src/spiffs_mtd.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -69,17 +69,9 @@ extern "C" /* Debug */ #ifdef CONFIG_SPIFFS_MTDDBG -# ifdef CONFIG_CPP_HAVE_VARARGS -# define spiffs_mtdinfo(format, ...) _info(format, ##__VA_ARGS__) -# else -# define spiffs_mtdinfo _info -# endif +# define spiffs_mtdinfo _info #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define spiffs_mtdinfo(format, ...) -# else -# define spiffs_mtdinfo (void) -# endif +# define spiffs_mtdinfo _none #endif /* Commonly used Macros */ diff --git a/graphics/vnc/server/vnc_server.h b/graphics/vnc/server/vnc_server.h index db02adc79eb..d341066f345 100644 --- a/graphics/vnc/server/vnc_server.h +++ b/graphics/vnc/server/vnc_server.h @@ -181,25 +181,13 @@ /* Debug */ #ifdef CONFIG_VNCSERVER_UPDATE_DEBUG -# ifdef CONFIG_CPP_HAVE_VARARGS -# define upderr(format, ...) _err(format, ##__VA_ARGS__) -# define updinfo(format, ...) _info(format, ##__VA_ARGS__) -# define updinfo(format, ...) _info(format, ##__VA_ARGS__) -# else -# define upderr _err -# define updwarn _warn -# define updinfo _info -# endif +# define upderr _err +# define updwarn _warn +# define updinfo _info #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define upderr(x...) -# define updwarn(x...) -# define updinfo(x...) -# else -# define upderr (void) -# define updwarn (void) -# define updinfo (void) -# endif +# define upderr _none +# define updwarn _none +# define updinfo _none #endif /**************************************************************************** @@ -583,7 +571,8 @@ uint32_t vnc_convert_rgb32_888(lfb_color_t rgb); * ****************************************************************************/ -int vnc_colors(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect, +int vnc_colors(FAR struct vnc_session_s *session, + FAR struct nxgl_rect_s *rect, unsigned int maxcolors, FAR lfb_color_t *colors); #undef EXTERN diff --git a/include/debug.h b/include/debug.h index 16dcaa9d67e..f4bc4d3027d 100644 --- a/include/debug.h +++ b/include/debug.h @@ -70,10 +70,10 @@ * for the network, CONFIG_DEBUG_FS for the file system, etc). * * In general, error messages and output of importance use [a-z]err(). - * [a-z]err() is implementation dependent but usually uses file descriptors. - * (that is a problem only because the interrupt task may have re- - * directed stdout). Therefore [a-z]err() should not be used in interrupt - * handlers. + * [a-z]err() is implementation dependent but usually uses file + * descriptors. (that is a problem only because the interrupt task may + * have redirected stdout). Therefore [a-z]err() should not be used in + * interrupt handlers. * * [a-z]warn() -- Identical to [a-z]info() except that it also requires that * CONFIG_DEBUG_WARN be defined. This is intended for important exception @@ -81,12 +81,12 @@ * fatal consequences). * * [a-z]err() -- Identical to [a-z]info() except that it also requires that - * CONFIG_DEBUG_ERROR be defined. This is intended for important error-related - * information that you probably not want to suppress during normal debug - * general debugging. + * CONFIG_DEBUG_ERROR be defined. This is intended for important + * error-related information that you probably not want to suppress during + * normal debug general debugging. * - * _alert() - is a special, high-priority, unconditional version that is really - * intended only for crash error reporting. + * _alert() - is a special, high-priority, unconditional version that is + * really intended only for crash error reporting. */ #ifdef CONFIG_HAVE_FUNCTIONNAME @@ -102,8 +102,10 @@ */ #ifdef CONFIG_CPP_HAVE_VARARGS - -/* C-99 style variadic macros are supported */ +# define _none(x...) +#else +# define _none (void) +#endif /* The actual logger function may be overridden in arch/debug.h if needed. * (Currently only if the pre-processor supports variadic macros) @@ -113,630 +115,32 @@ # define __arch_syslog syslog #endif -#ifdef CONFIG_DEBUG_ALERT +#if !defined(CONFIG_DEBUG_ALERT) +# define _alert _none +#elif defined(CONFIG_CPP_HAVE_VARARGS) # define _alert(format, ...) \ __arch_syslog(LOG_EMERG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) -#else /* CONFIG_DEBUG_ERROR */ -# define _alert(x...) #endif -#ifdef CONFIG_DEBUG_ERROR +#if !defined(CONFIG_DEBUG_ERROR) +# define _err _none +#elif defined(CONFIG_CPP_HAVE_VARARGS) # define _err(format, ...) \ __arch_syslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) -#else -# define _err(x...) #endif -#ifdef CONFIG_DEBUG_WARN +#if !defined(CONFIG_DEBUG_WARN) +# define _warn _none +#elif defined(CONFIG_CPP_HAVE_VARARGS) # define _warn(format, ...) \ __arch_syslog(LOG_WARNING, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) -#else -# define _warn(x...) #endif -#ifdef CONFIG_DEBUG_INFO +#if !defined(CONFIG_DEBUG_INFO) +# define _info _none +#elif defined(CONFIG_CPP_HAVE_VARARGS) # define _info(format, ...) \ __arch_syslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) -#else -# define _info(x...) -#endif - -/* Subsystem specific debug */ - -#ifdef CONFIG_DEBUG_MM_ERROR -# define merr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define merr(x...) -#endif - -#ifdef CONFIG_DEBUG_MM_WARN -# define mwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define mwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_MM_INFO -# define minfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define minfo(x...) -#endif - -#ifdef CONFIG_DEBUG_SCHED_ERROR -# define serr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define serr(x...) -#endif - -#ifdef CONFIG_DEBUG_SCHED_WARN -# define swarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define swarn(x...) -#endif - -#ifdef CONFIG_DEBUG_SCHED_INFO -# define sinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define sinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_SYSCALL_ERROR -# define svcerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define svcerr(x...) -#endif - -#ifdef CONFIG_DEBUG_SYSCALL_WARN -# define svcwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define svcwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_SYSCALL_INFO -# define svcinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define svcinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_PAGING_ERROR -# define pgerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define pgerr(x...) -#endif - -#ifdef CONFIG_DEBUG_PAGING_WARN -# define pgwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define pgwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_PAGING_INFO -# define pginfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define pginfo(x...) -#endif - -#ifdef CONFIG_DEBUG_NET_ERROR -# define nerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define nerr(x...) -#endif - -#ifdef CONFIG_DEBUG_NET_WARN -# define nwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define nwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_NET_INFO -# define ninfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define ninfo(x...) -#endif - -#ifdef CONFIG_DEBUG_POWER_ERROR -# define pwrerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define pwrerr(x...) -#endif - -#ifdef CONFIG_DEBUG_POWER_WARN -# define pwrwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define pwrwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_POWER_INFO -# define pwrinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define pwrinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_WIRELESS_ERROR -# define wlerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define wlerr(x...) -#endif - -#ifdef CONFIG_DEBUG_WIRELESS_WARN -# define wlwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define wlwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_WIRELESS_INFO -# define wlinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define wlinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_FS_ERROR -# define ferr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define ferr(x...) -#endif - -#ifdef CONFIG_DEBUG_FS_WARN -# define fwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define fwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_FS_INFO -# define finfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define finfo(x...) -#endif - -#ifdef CONFIG_DEBUG_CONTACTLESS_ERROR -# define ctlserr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define ctlserr(x...) -#endif - -#ifdef CONFIG_DEBUG_CONTACTLESS_WARN -# define ctlswarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define ctlswarn(x...) -#endif - -#ifdef CONFIG_DEBUG_CONTACTLESS_INFO -# define ctlsinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define ctlsinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_CRYPTO_ERROR -# define crypterr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define crypterr(x...) -#endif - -#ifdef CONFIG_DEBUG_CRYPTO_WARN -# define cryptwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define cryptwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_CRYPTO_INFO -# define cryptinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define cryptinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_INPUT_ERROR -# define ierr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define ierr(x...) -#endif - -#ifdef CONFIG_DEBUG_INPUT_WARN -# define iwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define iwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_INPUT_INFO -# define iinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define iinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_ANALOG_ERROR -# define aerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define aerr(x...) -#endif - -#ifdef CONFIG_DEBUG_ANALOG_WARN -# define awarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define awarn(x...) -#endif - -#ifdef CONFIG_DEBUG_ANALOG_INFO -# define ainfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define ainfo(x...) -#endif - -#ifdef CONFIG_DEBUG_CAN_ERROR -# define canerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define canerr(x...) -#endif - -#ifdef CONFIG_DEBUG_CAN_WARN -# define canwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define canwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_CAN_INFO -# define caninfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define caninfo(x...) -#endif - -#ifdef CONFIG_DEBUG_GRAPHICS_ERROR -# define gerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define gerr(x...) -#endif - -#ifdef CONFIG_DEBUG_GRAPHICS_WARN -# define gwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define gwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_GRAPHICS_INFO -# define ginfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define ginfo(x...) -#endif - -#ifdef CONFIG_DEBUG_BINFMT_ERROR -# define berr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define berr(x...) -#endif - -#ifdef CONFIG_DEBUG_BINFMT_WARN -# define bwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define bwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_BINFMT_INFO -# define binfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define binfo(x...) -#endif - -#ifdef CONFIG_DEBUG_LIB_ERROR -# define lerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define lerr(x...) -#endif - -#ifdef CONFIG_DEBUG_LIB_WARN -# define lwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define lwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_LIB_INFO -# define linfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define linfo(x...) -#endif - -#ifdef CONFIG_DEBUG_AUDIO_ERROR -# define auderr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define auderr(x...) -#endif - -#ifdef CONFIG_DEBUG_AUDIO_WARN -# define audwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define audwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_AUDIO_INFO -# define audinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define audinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_DMA_ERROR -# define dmaerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define dmaerr(x...) -#endif - -#ifdef CONFIG_DEBUG_DMA_WARN -# define dmawarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define dmawarn(x...) -#endif - -#ifdef CONFIG_DEBUG_DMA_INFO -# define dmainfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define dmainfo(x...) -#endif - -#ifdef CONFIG_DEBUG_IRQ_ERROR -# define irqerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define irqerr(x...) -#endif - -#ifdef CONFIG_DEBUG_IRQ_WARN -# define irqwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define irqwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_IRQ_INFO -# define irqinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define irqinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_LCD_ERROR -# define lcderr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -#endif - -#ifdef CONFIG_DEBUG_LCD_WARN -# define lcdwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define lcdwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_LCD_INFO -# define lcdinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define lcdinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_LEDS_ERROR -# define lederr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define lederr(x...) -#endif - -#ifdef CONFIG_DEBUG_LEDS_WARN -# define ledwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define ledwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_LEDS_INFO -# define ledinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define ledinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_GPIO_ERROR -# define gpioerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define gpioerr(x...) -#endif - -#ifdef CONFIG_DEBUG_GPIO_WARN -# define gpiowarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define gpiowarn(x...) -#endif - -#ifdef CONFIG_DEBUG_GPIO_INFO -# define gpioinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define gpioinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_I2C_ERROR -# define i2cerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define i2cerr(x...) -#endif - -#ifdef CONFIG_DEBUG_I2C_WARN -# define i2cwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define i2cwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_I2C_INFO -# define i2cinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define i2cinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_I2S_ERROR -# define i2serr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define i2serr(x...) -#endif - -#ifdef CONFIG_DEBUG_I2S_WARN -# define i2swarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define i2swarn(x...) -#endif - -#ifdef CONFIG_DEBUG_I2S_INFO -# define i2sinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define i2sinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_PWM_ERROR -# define pwmerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define pwmerr(x...) -#endif - -#ifdef CONFIG_DEBUG_PWM_WARN -# define pwmwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define pwmwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_PWM_INFO -# define pwminfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define pwminfo(x...) -#endif - -#ifdef CONFIG_DEBUG_RTC_ERROR -# define rtcerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define rtcerr(x...) -#endif - -#ifdef CONFIG_DEBUG_RTC_WARN -# define rtcwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define rtcwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_RTC_INFO -# define rtcinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define rtcinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_MEMCARD_ERROR -# define mcerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define mcerr(x...) -#endif - -#ifdef CONFIG_DEBUG_MEMCARD_WARN -# define mcwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define mcwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_MEMCARD_INFO -# define mcinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define mcinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_SENSORS_ERROR -# define snerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define snerr(x...) -#endif - -#ifdef CONFIG_DEBUG_SENSORS_WARN -# define snwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define snwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_SENSORS_INFO -# define sninfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define sninfo(x...) -#endif - -#ifdef CONFIG_DEBUG_SPI_ERROR -# define spierr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define spierr(x...) -#endif - -#ifdef CONFIG_DEBUG_SPI_WARN -# define spiwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define spiwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_SPI_INFO -# define spiinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define spiinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_TIMER_ERROR -# define tmrerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define tmrerr(x...) -#endif - -#ifdef CONFIG_DEBUG_TIMER_WARN -# define tmrwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define tmrwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_TIMER_INFO -# define tmrinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define tmrinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_USB_ERROR -# define uerr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define uerr(x...) -#endif - -#ifdef CONFIG_DEBUG_USB_WARN -# define uwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define uwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_USB_INFO -# define uinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define uinfo(x...) -#endif - -#ifdef CONFIG_DEBUG_WATCHDOG_ERROR -# define wderr(format, ...) _err(format, ##__VA_ARGS__) -#else -# define wderr(x...) -#endif - -#ifdef CONFIG_DEBUG_WATCHDOG_WARN -# define wdwarn(format, ...) _warn(format, ##__VA_ARGS__) -#else -# define wdwarn(x...) -#endif - -#ifdef CONFIG_DEBUG_WATCHDOG_INFO -# define wdinfo(format, ...) _info(format, ##__VA_ARGS__) -#else -# define wdinfo(x...) -#endif - -#else /* CONFIG_CPP_HAVE_VARARGS */ - -/* Variadic macros NOT supported */ - -#ifndef CONFIG_DEBUG_ALERT -# define _alert (void) -# endif - -#ifndef CONFIG_DEBUG_ERROR -# define _err (void) -#endif - -#ifndef CONFIG_DEBUG_WARN -# define _warn (void) -#endif - -#ifndef CONFIG_DEBUG_INFO -# define _info (void) #endif /* Subsystem specific debug */ @@ -744,581 +148,579 @@ #ifdef CONFIG_DEBUG_MM_ERROR # define merr _err #else -# define merr (void) +# define merr _none #endif #ifdef CONFIG_DEBUG_MM_WARN # define mwarn _warn #else -# define mwarn (void) +# define mwarn _none #endif #ifdef CONFIG_DEBUG_MM_INFO # define minfo _info #else -# define minfo (void) +# define minfo _none #endif #ifdef CONFIG_DEBUG_SCHED_ERROR # define serr _err #else -# define serr (void) +# define serr _none #endif #ifdef CONFIG_DEBUG_SCHED_WARN # define swarn _warn #else -# define swarn (void) +# define swarn _none #endif #ifdef CONFIG_DEBUG_SCHED_INFO # define sinfo _info #else -# define sinfo (void) +# define sinfo _none #endif #ifdef CONFIG_DEBUG_SYSCALL_ERROR # define svcerr _err #else -# define svcerr (void) +# define svcerr _none #endif #ifdef CONFIG_DEBUG_SYSCALL_WARN # define svcwarn _warn #else -# define svcwarn (void) +# define svcwarn _none #endif #ifdef CONFIG_DEBUG_SYSCALL_INFO # define svcinfo _info #else -# define svcinfo (void) +# define svcinfo _none #endif #ifdef CONFIG_DEBUG_PAGING_ERROR # define pgerr _err #else -# define pgerr (void) +# define pgerr _none #endif #ifdef CONFIG_DEBUG_PAGING_WARN # define pgwarn _warn #else -# define pgwarn (void) +# define pgwarn _none #endif #ifdef CONFIG_DEBUG_PAGING_INFO # define pginfo _info #else -# define pginfo (void) +# define pginfo _none #endif #ifdef CONFIG_DEBUG_NET_ERROR # define nerr _err #else -# define nerr (void) +# define nerr _none #endif #ifdef CONFIG_DEBUG_NET_WARN # define nwarn _warn #else -# define nwarn (void) +# define nwarn _none #endif #ifdef CONFIG_DEBUG_NET_INFO # define ninfo _info #else -# define ninfo (void) +# define ninfo _none #endif #ifdef CONFIG_DEBUG_POWER_ERROR # define pwrerr _err #else -# define pwrerr (void) +# define pwrerr _none #endif #ifdef CONFIG_DEBUG_POWER_WARN # define pwrwarn _warn #else -# define pwrwarn (void) +# define pwrwarn _none #endif #ifdef CONFIG_DEBUG_POWER_INFO # define pwrinfo _info #else -# define pwrinfo (void) +# define pwrinfo _none #endif #ifdef CONFIG_DEBUG_WIRELESS_ERROR # define wlerr _err #else -# define wlerr (void) +# define wlerr _none #endif #ifdef CONFIG_DEBUG_WIRELESS_WARN # define wlwarn _warn #else -# define wlwarn (void) +# define wlwarn _none #endif #ifdef CONFIG_DEBUG_WIRELESS_INFO # define wlinfo _info #else -# define wlinfo (void) +# define wlinfo _none #endif #ifdef CONFIG_DEBUG_FS_ERROR # define ferr _err #else -# define ferr (void) +# define ferr _none #endif #ifdef CONFIG_DEBUG_FS_WARN # define fwarn _warn #else -# define fwarn (void) +# define fwarn _none #endif #ifdef CONFIG_DEBUG_FS_INFO # define finfo _info #else -# define finfo (void) +# define finfo _none #endif #ifdef CONFIG_DEBUG_CONTACTLESS_ERROR # define ctlserr _err #else -# define ctlserr (void) +# define ctlserr _none #endif #ifdef CONFIG_DEBUG_CONTACTLESS_WARN # define ctlswarn _warn #else -# define ctlswarn (void) +# define ctlswarn _none #endif #ifdef CONFIG_DEBUG_CONTACTLESS_INFO # define ctlsinfo _info #else -# define ctlsinfo (void) +# define ctlsinfo _none #endif #ifdef CONFIG_DEBUG_CRYPTO_ERROR # define crypterr _err #else -# define crypterr (void) +# define crypterr _none #endif #ifdef CONFIG_DEBUG_CRYPTO_WARN # define cryptwarn _warn #else -# define cryptwarn (void) +# define cryptwarn _none #endif #ifdef CONFIG_DEBUG_CRYPTO_INFO # define cryptinfo _info #else -# define cryptinfo (void) +# define cryptinfo _none #endif #ifdef CONFIG_DEBUG_INPUT_ERROR # define ierr _err #else -# define ierr (void) +# define ierr _none #endif #ifdef CONFIG_DEBUG_INPUT_WARN # define iwarn _warn #else -# define iwarn (void) +# define iwarn _none #endif #ifdef CONFIG_DEBUG_INPUT_INFO # define iinfo _info #else -# define iinfo (void) +# define iinfo _none #endif #ifdef CONFIG_DEBUG_ANALOG_ERROR # define aerr _err #else -# define aerr (void) +# define aerr _none #endif #ifdef CONFIG_DEBUG_ANALOG_WARN # define awarn _warn #else -# define awarn (void) +# define awarn _none #endif #ifdef CONFIG_DEBUG_ANALOG_INFO # define ainfo _info #else -# define ainfo (void) +# define ainfo _none #endif #ifdef CONFIG_DEBUG_CAN_ERROR # define canerr _err #else -# define canerr (void) +# define canerr _none #endif #ifdef CONFIG_DEBUG_CAN_WARN # define canwarn _warn #else -# define canwarn (void) +# define canwarn _none #endif #ifdef CONFIG_DEBUG_CAN_INFO # define caninfo _info #else -# define caninfo (void) +# define caninfo _none #endif #ifdef CONFIG_DEBUG_GRAPHICS_ERROR # define gerr _err #else -# define gerr (void) +# define gerr _none #endif #ifdef CONFIG_DEBUG_GRAPHICS_WARN # define gwarn _warn #else -# define gwarn (void) +# define gwarn _none #endif #ifdef CONFIG_DEBUG_GRAPHICS_INFO # define ginfo _info #else -# define ginfo (void) +# define ginfo _none #endif #ifdef CONFIG_DEBUG_BINFMT_ERROR # define berr _err #else -# define berr (void) +# define berr _none #endif #ifdef CONFIG_DEBUG_BINFMT_WARN # define bwarn _warn #else -# define bwarn (void) +# define bwarn _none #endif #ifdef CONFIG_DEBUG_BINFMT_INFO # define binfo _info #else -# define binfo (void) +# define binfo _none #endif #ifdef CONFIG_DEBUG_LIB_ERROR # define lerr _err #else -# define lerr (void) +# define lerr _none #endif #ifdef CONFIG_DEBUG_LIB_WARN # define lwarn _warn #else -# define lwarn (void) +# define lwarn _none #endif #ifdef CONFIG_DEBUG_LIB_INFO # define linfo _info #else -# define linfo (void) +# define linfo _none #endif #ifdef CONFIG_DEBUG_AUDIO_ERROR # define auderr _err #else -# define auderr (void) +# define auderr _none #endif #ifdef CONFIG_DEBUG_AUDIO_WARN # define audwarn _warn #else -# define audwarn (void) +# define audwarn _none #endif #ifdef CONFIG_DEBUG_AUDIO_INFO # define audinfo _info #else -# define audinfo (void) +# define audinfo _none #endif #ifdef CONFIG_DEBUG_DMA_ERROR # define dmaerr _err #else -# define dmaerr (void) +# define dmaerr _none #endif #ifdef CONFIG_DEBUG_DMA_WARN # define dmawarn _warn #else -# define dmawarn (void) +# define dmawarn _none #endif #ifdef CONFIG_DEBUG_DMA_INFO # define dmainfo _info #else -# define dmainfo (void) +# define dmainfo _none #endif #ifdef CONFIG_DEBUG_IRQ_ERROR # define irqerr _err #else -# define irqerr (void) +# define irqerr _none #endif #ifdef CONFIG_DEBUG_IRQ_WARN # define irqwarn _warn #else -# define irqwarn (void) +# define irqwarn _none #endif #ifdef CONFIG_DEBUG_IRQ_INFO # define irqinfo _info #else -# define irqinfo (void) +# define irqinfo _none #endif #ifdef CONFIG_DEBUG_LCD_ERROR # define lcderr _err #else -# define lcderr (void) +# define lcderr _none #endif #ifdef CONFIG_DEBUG_LCD_WARN # define lcdwarn _warn #else -# define lcdwarn (void) +# define lcdwarn _none #endif #ifdef CONFIG_DEBUG_LCD_INFO # define lcdinfo _info #else -# define lcdinfo (void) +# define lcdinfo _none #endif #ifdef CONFIG_DEBUG_LEDS_ERROR # define lederr _err #else -# define lederr (void) +# define lederr _none #endif #ifdef CONFIG_DEBUG_LEDS_WARN # define ledwarn _warn #else -# define ledwarn (void) +# define ledwarn _none #endif #ifdef CONFIG_DEBUG_LEDS_INFO # define ledinfo _info #else -# define ledinfo (void) +# define ledinfo _none #endif #ifdef CONFIG_DEBUG_GPIO_ERROR # define gpioerr _err #else -# define gpioerr (void) +# define gpioerr _none #endif #ifdef CONFIG_DEBUG_GPIO_WARN # define gpiowarn _warn #else -# define gpiowarn (void) +# define gpiowarn _none #endif #ifdef CONFIG_DEBUG_GPIO_INFO # define gpioinfo _info #else -# define gpioinfo (void) +# define gpioinfo _none #endif #ifdef CONFIG_DEBUG_I2C_ERROR # define i2cerr _err #else -# define i2cerr (void) +# define i2cerr _none #endif #ifdef CONFIG_DEBUG_I2C_WARN # define i2cwarn _warn #else -# define i2cwarn (void) +# define i2cwarn _none #endif #ifdef CONFIG_DEBUG_I2C_INFO # define i2cinfo _info #else -# define i2cinfo (void) +# define i2cinfo _none #endif #ifdef CONFIG_DEBUG_I2S_ERROR # define i2serr _err #else -# define i2serr (void) +# define i2serr _none #endif #ifdef CONFIG_DEBUG_I2S_WARN # define i2swarn _warn #else -# define i2swarn (void) +# define i2swarn _none #endif #ifdef CONFIG_DEBUG_I2S_INFO # define i2sinfo _info #else -# define i2sinfo (void) +# define i2sinfo _none #endif #ifdef CONFIG_DEBUG_PWM_ERROR # define pwmerr _err #else -# define pwmerr (void) +# define pwmerr _none #endif #ifdef CONFIG_DEBUG_PWM_WARN # define pwmwarn _warn #else -# define pwmwarn (void) +# define pwmwarn _none #endif #ifdef CONFIG_DEBUG_PWM_INFO # define pwminfo _info #else -# define pwminfo (void) +# define pwminfo _none #endif #ifdef CONFIG_DEBUG_RTC_ERROR # define rtcerr _err #else -# define rtcerr (void) +# define rtcerr _none #endif #ifdef CONFIG_DEBUG_RTC_WARN # define rtcwarn _warn #else -# define rtcwarn (void) +# define rtcwarn _none #endif #ifdef CONFIG_DEBUG_RTC_INFO # define rtcinfo _info #else -# define rtcinfo (void) +# define rtcinfo _none #endif #ifdef CONFIG_DEBUG_MEMCARD_ERROR # define mcerr _err #else -# define mcerr (void) +# define mcerr _none #endif #ifdef CONFIG_DEBUG_MEMCARD_WARN # define mcwarn _warn #else -# define mcwarn (void) +# define mcwarn _none #endif #ifdef CONFIG_DEBUG_MEMCARD_INFO # define mcinfo _info #else -# define mcinfo (void) +# define mcinfo _none #endif #ifdef CONFIG_DEBUG_SENSORS_ERROR # define snerr _err #else -# define snerr (void) +# define snerr _none #endif #ifdef CONFIG_DEBUG_SENSORS_WARN # define snwarn _warn #else -# define snwarn (void) +# define snwarn _none #endif #ifdef CONFIG_DEBUG_SENSORS_INFO # define sninfo _info #else -# define sninfo (void) +# define sninfo _none #endif #ifdef CONFIG_DEBUG_SPI_ERROR # define spierr _err #else -# define spierr (void) +# define spierr _none #endif #ifdef CONFIG_DEBUG_SPI_WARN # define spiwarn _warn #else -# define spiwarn (void) +# define spiwarn _none #endif #ifdef CONFIG_DEBUG_SPI_INFO # define spiinfo _info #else -# define spiinfo (void) +# define spiinfo _none #endif #ifdef CONFIG_DEBUG_TIMER_ERROR # define tmrerr _err #else -# define tmrerr (void) +# define tmrerr _none #endif #ifdef CONFIG_DEBUG_TIMER_WARN # define tmrwarn _warn #else -# define tmrwarn (void) +# define tmrwarn _none #endif #ifdef CONFIG_DEBUG_TIMER_INFO # define tmrinfo _info #else -# define tmrinfo (void) +# define tmrinfo _none #endif #ifdef CONFIG_DEBUG_USB_ERROR # define uerr _err #else -# define uerr (void) +# define uerr _none #endif #ifdef CONFIG_DEBUG_USB_WARN # define uwarn _warn #else -# define uwarn (void) +# define uwarn _none #endif #ifdef CONFIG_DEBUG_USB_INFO # define uinfo _info #else -# define uinfo (void) +# define uinfo _none #endif #ifdef CONFIG_DEBUG_WATCHDOG_ERROR # define wderr _err #else -# define wderr (void) +# define wderr _none #endif #ifdef CONFIG_DEBUG_WATCHDOG_WARN # define wdwarn _warn #else -# define wdwarn (void) +# define wdwarn _none #endif #ifdef CONFIG_DEBUG_WATCHDOG_INFO # define wdinfo _info #else -# define wdinfo (void) +# define wdinfo _none #endif -#endif /* CONFIG_CPP_HAVE_VARARGS */ - /* Buffer dumping macros do not depend on varargs */ #ifdef CONFIG_DEBUG_ERROR @@ -1583,14 +985,6 @@ # define wdinfodumpbuffer(m,b,n) #endif -/**************************************************************************** - * Public Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Public Function Prototypes ****************************************************************************/ diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h index 04bdd19dff2..b59319a6dc8 100644 --- a/include/nuttx/fs/fs.h +++ b/include/nuttx/fs/fs.h @@ -72,11 +72,7 @@ */ #if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) -# ifdef CONFIG_CPP_HAVE_VARARGS -# define _NX_OPEN(p,f,...) nx_open(p,f,##__VA_ARGS__) -# else -# define _NX_OPEN nx_open -# endif +# define _NX_OPEN nx_open # define _NX_CLOSE(f) nx_close(f) # define _NX_READ(f,b,s) nx_read(f,b,s) # define _NX_WRITE(f,b,s) nx_write(f,b,s) @@ -87,11 +83,7 @@ # define _NX_SETERRNO(r) set_errno(-(r)) # define _NX_GETERRVAL(r) (r) #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define _NX_OPEN(p,f,...) open(p,f,##__VA_ARGS__) -# else -# define _NX_OPEN open -# endif +# define _NX_OPEN open # define _NX_CLOSE(f) close(f) # define _NX_READ(f,b,s) read(f,b,s) # define _NX_WRITE(f,b,s) write(f,b,s) diff --git a/include/nuttx/mm/shm.h b/include/nuttx/mm/shm.h index f4b2641f71b..2af7d8cf14a 100644 --- a/include/nuttx/mm/shm.h +++ b/include/nuttx/mm/shm.h @@ -51,6 +51,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_ARCH_ADDRENV @@ -71,22 +72,12 @@ /* Debug */ -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG_SHM -# define shmerr(format, ...) _err(format, ##__VA_ARGS__) -# define shminfo(format, ...) _info(format, ##__VA_ARGS__) -# else -# define shmerr(format, ...) merr(format, ##__VA_ARGS__) -# define shminfo(format, ...) minfo(format, ##__VA_ARGS__) -# endif +#ifdef CONFIG_DEBUG_SHM +# define shmerr _err +# define shminfo _info #else -# ifdef CONFIG_DEBUG_SHM -# define shmerr _err -# define shminfo _info -# else -# define shmerr (void) -# define shminfo (void) -# endif +# define shmerr merr +# define shminfo minfo #endif /**************************************************************************** diff --git a/include/nuttx/power/bq2429x.h b/include/nuttx/power/bq2429x.h index 4a9cd64d248..405a0cc9d37 100644 --- a/include/nuttx/power/bq2429x.h +++ b/include/nuttx/power/bq2429x.h @@ -51,7 +51,7 @@ #define BQ2429X_CURRCHG_MIN 512 #define BQ2429X_CURRCHG_MAX 3008 -/* BQ2429X Register Definitions ********************************************/ +/* BQ2429X Register Definitions *********************************************/ #define BQ2429X_REG00 0x00 #define BQ2429X_REG01 0x01 #define BQ2429X_REG02 0x02 @@ -66,12 +66,13 @@ /* REG00 Input Source Control Register */ -/* For enabling Device Shutdown for shipping - EN_HIZ=1 until QON pressed*/ +/* For enabling Device Shutdown for shipping - EN_HIZ=1 until QON pressed */ #define BQ2429XR1_EN_HIZ (1 << 7) /* 0 Disable (default) 1 Enable HighZ on battery, powerdown */ /* Dynamic Power Management - Indicated in StatusReg DPM_STAT REG08[3] - VINDPM - Input Voltage threshold (a drop below 5V) that triggers DPM - INLIM - Input current threshold that triggers DPM */ + * VINDPM - Input Voltage threshold (a drop below 5V) that triggers DPM + * INLIM - Input current threshold that triggers DPM + */ #define BQ2429XR0_VINDPM_SHIFT 3 /* VIN DPM Offset 5V? Range*/ #define BQ2429XR0_VINDPM_MASK (0xf << BQ2429XR0_VINDPM_SHIFT) @@ -81,14 +82,14 @@ # define BQ2429XR0_VINDPM0_640mV (8 << BQ2429XR0_VINDPM_SHIFT) #define BQ2429XR0_INLIM_SHIFT 0 /* Input Current Limit - lower of I2C & ILIM */ #define BQ2429XR0_INLIM_MASK (0x7 << BQ2429XR0_INLIM_SHIFT) -# define BQ2429XR0_INLIM_0100mA (0x0 << BQ2429XR0_INLIM_SHIFT) -# define BQ2429XR0_INLIM_0150mA (0x1 << BQ2429XR0_INLIM_SHIFT) -# define BQ2429XR0_INLIM_0500mA (0x2 << BQ2429XR0_INLIM_SHIFT) -# define BQ2429XR0_INLIM_0900mA (0x3 << BQ2429XR0_INLIM_SHIFT) -# define BQ2429XR0_INLIM_1000mA (0x4 << BQ2429XR0_INLIM_SHIFT) -# define BQ2429XR0_INLIM_1500mA (0x5 << BQ2429XR0_INLIM_SHIFT) -# define BQ2429XR0_INLIM_2000mA (0x6 << BQ2429XR0_INLIM_SHIFT) -# define BQ2429XR0_INLIM_3000mA (0x7 << BQ2429XR0_INLIM_SHIFT) +# define BQ2429XR0_INLIM_0100MA (0x0 << BQ2429XR0_INLIM_SHIFT) +# define BQ2429XR0_INLIM_0150MA (0x1 << BQ2429XR0_INLIM_SHIFT) +# define BQ2429XR0_INLIM_0500MA (0x2 << BQ2429XR0_INLIM_SHIFT) +# define BQ2429XR0_INLIM_0900MA (0x3 << BQ2429XR0_INLIM_SHIFT) +# define BQ2429XR0_INLIM_1000MA (0x4 << BQ2429XR0_INLIM_SHIFT) +# define BQ2429XR0_INLIM_1500MA (0x5 << BQ2429XR0_INLIM_SHIFT) +# define BQ2429XR0_INLIM_2000MA (0x6 << BQ2429XR0_INLIM_SHIFT) +# define BQ2429XR0_INLIM_3000MA (0x7 << BQ2429XR0_INLIM_SHIFT) /* REG01 Power-On Configuration Register */ @@ -96,7 +97,7 @@ #define BQ2429XR1_DOG_RESET (1 << 6) /* Write 1 for watchdog timer reset */ #define BQ2429XR1_OTG_CONFIG (1 << 5) /* =0 Disable (default) =1 Enable See description */ #define BQ2429XR1_CHG_CONFIG (1 << 4) /* =0 Disable =1 Enable (default) See description */ -#define BQ2429XR1_SYS_MINV_SHIFT 1 /* Min Sys Voltage Limit. Offset 3.0V Range 3-3.7V */ +#define BQ2429XR1_SYS_MINV_SHIFT 1 /* Min Sys Voltage Limit. Offset 3.0V Range 3-3.7V */ #define BQ2429XR1_SYS_MINV_MASK (7 << BQ2429XR1_SYS_MINV_SHIFT) #define BQ2429XR1_SYS_MINV0_0_1V (1 << BQ2429XR1_SYS_MINV_SHIFT) #define BQ2429XR1_SYS_MINV0_0_2V (2 << BQ2429XR1_SYS_MINV_SHIFT) @@ -116,29 +117,29 @@ #define BQ2429XR3_IPRECHG_SHIFT 4 /* Precharge I Limit. Offset 128mA Range 128-2048 mA */ #define BQ2429XR3_IPRECHG_MASK (0xf << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_0128mA (0x00 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_0128mA (0x01 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_0256mA (0x02 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_0384mA (0x03 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_0512mA (0x04 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_0768mA (0x05 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_0896mA (0x06 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_1024mA (0x07 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_1152mA (0x10 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_1280mA (0x11 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_1408mA (0x12 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_1536mA (0x13 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_1664mA (0x14 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_1792mA (0x15 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_1920mA (0x16 << BQ2429XR3_IPRECHG_SHIFT) -#define BQ2429XR3_IPRECHG_2048mA (0x17 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_0128MA (0x00 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_0128MA (0x01 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_0256MA (0x02 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_0384MA (0x03 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_0512MA (0x04 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_0768MA (0x05 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_0896MA (0x06 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_1024MA (0x07 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_1152MA (0x10 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_1280MA (0x11 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_1408MA (0x12 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_1536MA (0x13 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_1664MA (0x14 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_1792MA (0x15 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_1920MA (0x16 << BQ2429XR3_IPRECHG_SHIFT) +#define BQ2429XR3_IPRECHG_2048MA (0x17 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_ITERM_SHIFT 0 /* Offset 128mA Range 128-2048 mA (128-1024 mA in BQ24296M )*/ #define BQ2429XR3_ITERM_MASK (0xf << BQ2429XR3_ITERM_SHIFT) -#define BQ2429XR3_ITERM0_128mA (1 << BQ2429XR3_ITERM_SHIFT) -#define BQ2429XR3_ITERM0_256mA (2 << BQ2429XR3_ITERM_SHIFT) -#define BQ2429XR3_ITERM0_512mA (4 << BQ2429XR3_ITERM_SHIFT) -#define BQ2429XR3_ITERM0_1024mA (8 << BQ2429XR3_ITERM_SHIFT) /* Reserved in BQ24296M */ +#define BQ2429XR3_ITERM0_128MA (1 << BQ2429XR3_ITERM_SHIFT) +#define BQ2429XR3_ITERM0_256MA (2 << BQ2429XR3_ITERM_SHIFT) +#define BQ2429XR3_ITERM0_512MA (4 << BQ2429XR3_ITERM_SHIFT) +#define BQ2429XR3_ITERM0_1024MA (8 << BQ2429XR3_ITERM_SHIFT) /* Reserved in BQ24296M */ /* REG04 Charge Voltage Control Register */ #define BQ2429XR4_VREG_SHIFT 2 /* Offset 3.504V Range 3.504-4.400V Default 4.208V */ @@ -154,12 +155,12 @@ #define BQ2429XR5_WATCHDOG_SHIFT 4 /* Watchdog Timer Settings */ #define BQ2429XR5_WATCHDOG_MASK (3 << BQ2429XR5_WATCHDOG_SHIFT) # define BQ2429XR5_WATCHDOG_DIS (0 << BQ2429XR5_WATCHDOG_SHIFT) -# define BQ2429XR5_WATCHDOG_040Sec (1 << BQ2429XR5_WATCHDOG_SHIFT) -# define BQ2429XR5_WATCHDOG_080Sec (2 << BQ2429XR5_WATCHDOG_SHIFT) -# define BQ2429XR5_WATCHDOG_160Sec (3 << BQ2429XR5_WATCHDOG_SHIFT) +# define BQ2429XR5_WATCHDOG_040SEC (1 << BQ2429XR5_WATCHDOG_SHIFT) +# define BQ2429XR5_WATCHDOG_080SEC (2 << BQ2429XR5_WATCHDOG_SHIFT) +# define BQ2429XR5_WATCHDOG_160SEC (3 << BQ2429XR5_WATCHDOG_SHIFT) #define BQ2429XR5_EN_TIMER (1 << 3) /* 0=Disable 1=Enable(default) */ -/* Fast Charge Timer Settings */ + /* Fast Charge Timer Settings */ #define BQ2429XR5_CHG_TIMER_SHIFT 1 #define BQ2429XR5_CHG_TIMER_MASK (3 << BQ2429XR5_CHG_TIMER_SHIFT) # define BQ2429XR5_CHG_TIMER_05hrs (0 << BQ2429XR5_CHG_TIMER_SHIFT) @@ -223,7 +224,7 @@ #define BQ2429XR9_WATCHDOG_FAULT (1 << 7) /* 1=Watchdog Timer expired */ #define BQ2429XR9_OTG_FAULT (1 << 6) /* 1=Bus overloaded in OTG, or VBUS OVP or battery low */ -#define BQ2429XR9_CHRG_FAULT_SHIFT 4 /* Charging Status */ +#define BQ2429XR9_CHRG_FAULT_SHIFT 4 /* Charging Status */ #define BQ2429XR9_CHRG_FAULT_MASK (3 << BQ2429XR9_CHRG_FAULT_SHIFT) # define BQ2429XR9_CHRG_FAULT_NORMAL (0 << BQ2429XR9_CHRG_FAULT_SHIFT) # define BQ2429XR9_CHRG_FAULT_INPUT (1 << BQ2429XR9_CHRG_FAULT_SHIFT) diff --git a/libs/libc/libc.csv b/libs/libc/libc.csv index d20d28c0e16..91d0ea36213 100644 --- a/libs/libc/libc.csv +++ b/libs/libc/libc.csv @@ -1,4 +1,8 @@ "__errno","errno.h","defined(CONFIG_BUILD_FLAT)","FAR int *" +"_alert","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR)","int","FAR const char *","..." +"_err","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR)","int","FAR const char *","..." +"_info","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_INFO)","int","FAR const char *","..." +"_warn","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_WARN)","int","FAR const char *","..." "abort","stdlib.h","","void" "abs","stdlib.h","","int","int" "aio_error","aio.h","defined(CONFIG_FS_AIO)","int","FAR struct aiocb *" @@ -28,7 +32,6 @@ "dq_rem","queue.h","","void","FAR dq_entry_t *","dq_queue_t *" "dq_remfirst","queue.h","","FAR dq_entry_t","dq_queue_t *" "dq_remlast","queue.h","","FAR dq_entry_t","dq_queue_t *" -"_err","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR)","int","FAR const char *","..." "ether_ntoa","netinet/ether.h","","FAR char","FAR const struct ether_addr *" "fclose","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *" "fdopen","stdio.h","CONFIG_NFILE_STREAMS > 0","FAR FILE","int","FAR const char *" @@ -204,7 +207,6 @@ "ub16sqr","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t" "ungetc","stdio.h","CONFIG_NFILE_STREAMS > 0","int","int","FAR FILE *" "usleep","unistd.h","","int","int","FAR FILE *" -"_info","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_INFO)","int","FAR const char *","..." "vfprintf","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR const char *","va_list" "vprintf","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR const char *","va_list" "vsnprintf","stdio.h","","int","FAR char *","size_t","FAR const char *","va_list" @@ -234,4 +236,3 @@ "wmemmove","wchar.h","defined(CONFIG_LIBC_WCHAR)","wchat_t *","wchar_t *","wchar_t *","size_t" "wmemset","wchar.h","defined(CONFIG_LIBC_WCHAR)","wchat_t *","wchar_t *","wchar_t","size_t" "writev","sys/uio.h","","ssize_t","int","FAR const struct iovec *","int" -"_warn","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_WARN)","int","FAR const char *","..." diff --git a/mm/iob/iob.h b/mm/iob/iob.h index dbbfec49e40..8b6e4703bbb 100644 --- a/mm/iob/iob.h +++ b/mm/iob/iob.h @@ -54,33 +54,13 @@ ****************************************************************************/ #if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_IOB_DEBUG) -#ifdef CONFIG_CPP_HAVE_VARARGS - -# define ioberr(format, ...) _err(format, ##__VA_ARGS__) -# define iobwarn(format, ...) _warn(format, ##__VA_ARGS__) -# define iobinfo(format, ...) _info(format, ##__VA_ARGS__) - -#else - # define ioberr _err # define iobwarn _warn # define iobinfo _info - -#endif #else -#ifdef CONFIG_CPP_HAVE_VARARGS - -# define ioberr(format, ...) -# define iobwarn(format, ...) -# define iobinfo(format, ...) - -#else - -# define ioberr (void) -# define iobwarn (void) -# define iobinfo (void) - -#endif +# define ioberr _none +# define iobwarn _none +# define iobinfo _none #endif /* CONFIG_DEBUG_FEATURES && CONFIG_IOB_DEBUG */ /**************************************************************************** diff --git a/mm/mm_gran/mm_gran.h b/mm/mm_gran/mm_gran.h index 8937a25e40a..8e99dafb034 100644 --- a/mm/mm_gran/mm_gran.h +++ b/mm/mm_gran/mm_gran.h @@ -61,26 +61,14 @@ /* Debug */ -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG_GRAM -# define granerr(format, ...) _err(format, ##__VA_ARGS__) -# define granwarn(format, ...) _warn(format, ##__VA_ARGS__) -# define graninfo(format, ...) _info(format, ##__VA_ARGS__) -# else -# define granerr(format, ...) merr(format, ##__VA_ARGS__) -# define granwarn(format, ...) mwarn(format, ##__VA_ARGS__) -# define graninfo(format, ...) minfo(format, ##__VA_ARGS__) -# endif +#ifdef CONFIG_DEBUG_GRAM +# define granerr _err +# define granwarn _warn +# define graninfo _info #else -# ifdef CONFIG_DEBUG_GRAM -# define granerr _err -# define granwarn _warn -# define graninfo _info -# else -# define granerr merr -# define granwarn mwarn -# define graninfo minfo -# endif +# define granerr merr +# define granwarn mwarn +# define graninfo minfo #endif /**************************************************************************** diff --git a/mm/mm_gran/mm_pgalloc.c b/mm/mm_gran/mm_pgalloc.c index bb60c37a77a..bcc5545b6ff 100644 --- a/mm/mm_gran/mm_pgalloc.c +++ b/mm/mm_gran/mm_pgalloc.c @@ -66,26 +66,14 @@ /* Debug */ -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG_PGALLOC -# define pgaerr(format, ...) _err(format, ##__VA_ARGS__) -# define pgawarn(format, ...) _warn(format, ##__VA_ARGS__) -# define pgainfo(format, ...) _info(format, ##__VA_ARGS__) -# else -# define pgaerr(format, ...) merr(format, ##__VA_ARGS__) -# define pgawarn(format, ...) mwarn(format, ##__VA_ARGS__) -# define pgainfo(format, ...) minfo(format, ##__VA_ARGS__) -# endif +#ifdef CONFIG_DEBUG_PGALLOC +# define pgaerr _err +# define pgawarn _warn +# define pgainfo _info #else -# ifdef CONFIG_DEBUG_PGALLOC -# define pgaerr _err -# define pgawarn _warn -# define pgainfo _info -# else -# define pgaerr merr -# define pgawarn mwarn -# define pgainfo minfo -# endif +# define pgaerr merr +# define pgawarn mwarn +# define pgainfo minfo #endif /**************************************************************************** diff --git a/mm/mm_heap/mm_sem.c b/mm/mm_heap/mm_sem.c index 94e6665f480..10f249669f1 100644 --- a/mm/mm_heap/mm_sem.c +++ b/mm/mm_heap/mm_sem.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -51,10 +52,6 @@ # include #endif -#ifdef MONITOR_MM_SEMAPHORE -# include -#endif - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -94,15 +91,9 @@ # define msemwarn _warn # define mseminfo _info #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define msemerr(x...) -# define msemwarn(x...) -# define mseminfo(x...) -# else -# define msemerr (void) -# define msemwarn (void) -# define mseminfo (void) -# endif +# define msemerr _none +# define msemwarn _none +# define mseminfo _none #endif /**************************************************************************** diff --git a/net/igmp/igmp_group.c b/net/igmp/igmp_group.c index df840baeb6d..18dfe4bb18e 100644 --- a/net/igmp/igmp_group.c +++ b/net/igmp/igmp_group.c @@ -78,22 +78,12 @@ # undef IGMP_GRPDEBUG #endif -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef IGMP_GRPDEBUG -# define grperr(format, ...) nerr(format, ##__VA_ARGS__) -# define grpinfo(format, ...) ninfo(format, ##__VA_ARGS__) -# else -# define grperr(x...) -# define grpinfo(x...) -# endif +#ifdef IGMP_GRPDEBUG +# define grperr nerr +# define grpinfo ninfo #else -# ifdef IGMP_GRPDEBUG -# define grperr nerr -# define grpinfo ninfo -# else -# define grperr (void) -# define grpinfo (void) -# endif +# define grperr _none +# define grpinfo _none #endif /**************************************************************************** diff --git a/net/igmp/igmp_timer.c b/net/igmp/igmp_timer.c index b400d7b5a0f..c9a5da757a6 100644 --- a/net/igmp/igmp_timer.c +++ b/net/igmp/igmp_timer.c @@ -19,21 +19,21 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * 3. Neither the name of CITEL Technologies Ltd nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ @@ -73,22 +73,12 @@ # undef IGMP_GTMRDEBUG #endif -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef IGMP_GTMRDEBUG -# define gtmrerr(format, ...) nerr(format, ##__VA_ARGS__) -# define gtmrinfo(format, ...) ninfo(format, ##__VA_ARGS__) -# else -# define gtmrerr(x...) -# define gtmrinfo(x...) -# endif +#ifdef IGMP_GTMRDEBUG +# define gtmrerr nerr +# define gtmrinfo ninfo #else -# ifdef IGMP_GTMRDEBUG -# define gtmrerr nerr -# define gtmrinfo ninfo -# else -# define gtmrerr (void) -# define gtmrinfo (void) -# endif +# define gtmrerr _none +# define gtmrinfo _none #endif /**************************************************************************** @@ -117,9 +107,9 @@ static void igmp_timeout_work(FAR void *arg) DEBUGASSERT(group != NULL); /* If the group exists and is no an IDLE MEMBER, then it must be a DELAYING - * member. Race conditions are avoided because (1) the timer is not started + * member. Race conditions are avoided because (1) the timer is not started * until after the first IGMPv2_MEMBERSHIP_REPORT during the join, and (2) - * the timer is cancelled before sending the IGMP_LEAVE_GROUP during a leave. + * the timer is cancelled before sending the IGMP_LEAVE_GROUP during leave. */ net_lock(); diff --git a/net/mld/mld.h b/net/mld/mld.h index 36ec3930f15..e4a73b18418 100644 --- a/net/mld/mld.h +++ b/net/mld/mld.h @@ -169,26 +169,14 @@ /* Debug ********************************************************************/ -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_NET_MLD_DEBUG -# define mlderr(format, ...) _err(format, ##__VA_ARGS__) -# define mldwarn(format, ...) _warn(format, ##__VA_ARGS__) -# define mldinfo(format, ...) _info(format, ##__VA_ARGS__) -# else -# define mlderr(format, ...) nerr(format, ##__VA_ARGS__) -# define mldwarn(format, ...) nwarn(format, ##__VA_ARGS__) -# define mldinfo(format, ...) ninfo(format, ##__VA_ARGS__) -# endif +#ifdef CONFIG_NET_MLD_DEBUG +# define mlderr _err +# define mldwarn _warn +# define mldinfo _info #else -# ifdef CONFIG_NET_MLD_DEBUG -# define mlderr _err -# define mldwarn _warn -# define mldinfo _info -# else -# define mlderr nerr -# define mldwarn nwarn -# define mldinfo ninfo -# endif +# define mlderr nerr +# define mldwarn nwarn +# define mldinfo ninfo #endif /****************************************************************************