code style: trying to get used to this syntax

This commit is contained in:
rusefi 2020-01-22 00:45:09 -05:00
parent 9d0c5540d8
commit 8a88c90f3b
6 changed files with 11 additions and 7 deletions

View File

@ -328,8 +328,9 @@ AccelEnrichment::AccelEnrichment() {
#if ! EFI_UNIT_TEST
static void accelInfo() {
if (logger == NULL)
if (!logger) {
return;
}
// scheduleMsg(logger, "EL accel length=%d", mapInstance.cb.getSize());
scheduleMsg(logger, "EL accel th=%.2f/mult=%.2f", engineConfiguration->engineLoadAccelEnrichmentThreshold, engineConfiguration->engineLoadAccelEnrichmentMultiplier);
scheduleMsg(logger, "EL decel th=%.2f/mult=%.2f", engineConfiguration->engineLoadDecelEnleanmentThreshold, engineConfiguration->engineLoadDecelEnleanmentMultiplier);

View File

@ -284,8 +284,9 @@ int nmea_valid_checksum(const char *message) {
char p;
int sum = 0;
char *starPtr = strrchr(message, '*');
if (starPtr == NULL)
if (!starPtr) {
return NMEA_CHECKSUM_ERR;
}
char *int_message = starPtr + 1;
long checksum = hex2int(int_message, 2);

View File

@ -386,7 +386,7 @@ static void setPinState(const char * msg, OutputPin *pin, LEElement *element DEC
}
#endif /* EFI_PROD_CODE */
if (element == NULL) {
if (!element) {
warning(CUSTOM_FSIO_INVALID_EXPRESSION, "invalid expression for %s", msg);
} else {
int value = (int)calc.getValue2(pin->getLogicValue(), element PASS_ENGINE_PARAMETER_SUFFIX);

View File

@ -35,7 +35,7 @@ void MenuTree::back(void) {
}
void MenuTree::nextItem(void) {
if (current->next == NULL) {
if (!current->next) {
current = topVisible = current->topOfTheList;
return;
}
@ -79,7 +79,7 @@ void MenuItem::baseConstructor(MenuItem * parent, lcd_line_e lcdLine, const char
// root element has NULL parent
if (parent != NULL) {
if (parent->firstChild == NULL) {
if (!parent->firstChild) {
topOfTheList = this;
parent->firstChild = this;
}

View File

@ -153,8 +153,9 @@ int gpiochip_register(const char *name, struct gpiochip_ops *ops, size_t size, v
}
/* no free chips left */
if (chip == NULL)
if (!chip) {
return -1;
}
/* register chip */
chip->name = name;

View File

@ -342,8 +342,9 @@ int mc33972_add(unsigned int index, const struct mc33972_config *cfg)
/* check for valid cs.
* DOTO: remove this check? CS can be driven by SPI */
if (cfg->spi_config.ssport == NULL)
if (!cfg->spi_config.ssport) {
return -1;
}
chip = &chips[index];