rdtech-dps: User ternary operator.

This commit is contained in:
Uwe Hermann 2018-03-29 08:45:25 +02:00
parent 69b0558395
commit 66d2cc3a27
1 changed files with 1 additions and 4 deletions

View File

@ -197,10 +197,7 @@ static int config_get(uint32_t key, GVariant **data,
case SR_CONF_REGULATION:
if ((ret = rdtech_dps_get_reg(modbus, REG_CV_CC, &ivalue)) != SR_OK)
break;
if (ivalue == MODE_CC)
*data = g_variant_new_string("CC");
else
*data = g_variant_new_string("CV");
*data = g_variant_new_string((ivalue == MODE_CC) ? "CC" : "CV");
break;
case SR_CONF_VOLTAGE:
if ((ret = rdtech_dps_get_reg(modbus, REG_UOUT, &ivalue)) == SR_OK)