]> sigrok.org Git - libsigrok.git/commitdiff
rdtech-dps: User ternary operator.
authorUwe Hermann <redacted>
Thu, 29 Mar 2018 06:45:25 +0000 (08:45 +0200)
committerUwe Hermann <redacted>
Thu, 29 Mar 2018 13:45:52 +0000 (15:45 +0200)
src/hardware/rdtech-dps/api.c

index f719e6c74d483a9d2f906e3e8e1f34a9a441a761..e321ce360bdba2cfbe1a5ccc535a1a07c3c04fa2 100644 (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)