aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2021-07-05 09:33:24 +0100
committerSean Young <sean@mess.org>2021-07-05 09:33:33 +0100
commit6ffc5248dede6285d76c5ec5680c316f68ff98ca (patch)
tree66c67ae73cfb2f551432ce7ebb31355165636b77
parenteb47c00736586329a2043512dacb10fcf95aa58a (diff)
ir-ctl: Revert "ir-ctl: print correct transmitter count"
This change was totally wrong. All the existing drivers (except rc-loopback) return the number of transmitters, not what would be a valid mask. The documentation also says so. This reverts commit eb47c00736586329a2043512dacb10fcf95aa58a. Signed-off-by: Sean Young <sean@mess.org>
-rw-r--r--utils/ir-ctl/ir-ctl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index 66a257a7..3c3bcca1 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -933,7 +933,7 @@ static int lirc_options(struct arguments *args, int fd, unsigned features)
if (features & LIRC_CAN_SET_TRANSMITTER_MASK) {
rc = ioctl(fd, LIRC_SET_TRANSMITTER_MASK, &args->emitters);
if (rc > 0)
- fprintf(stderr, _("warning: %s: failed to set send transmitters: only %d available\n"), dev, ffs(~rc) - 1);
+ fprintf(stderr, _("warning: %s: failed to set send transmitters: only %d available\n"), dev, rc);
else if (rc < 0)
fprintf(stderr, _("warning: %s: failed to set send transmitters: %m\n"), dev);
} else
@@ -1026,11 +1026,8 @@ static void lirc_features(struct arguments *args, int fd, unsigned features)
fprintf(stderr, _("warning: %s: device supports setting transmitter mask but returns 0 as number of transmitters\n"), dev);
else if (rc < 0)
fprintf(stderr, _("warning: %s: device supports setting transmitter mask but returns: %m\n"), dev);
- else {
- unsigned count = ffs(~rc) - 1;
-
- printf(_(" - Set transmitter (%d available)\n"), count);
- }
+ else
+ printf(_(" - Set transmitter (%d available)\n"), rc);
}
} else if (features & LIRC_CAN_SEND_LIRCCODE) {
printf(_(" - Device can send using device dependent LIRCCODE mode (not supported)\n"));

Privacy Policy