From ffc1f85ef14ee4b54d4e7f7cfcf75b28a9f044de Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 15 Oct 2013 05:49:52 -0400 Subject: Eliminate a swich_driver() call that is never used. All regression tests pass. This fallthrough became obsolete when we started dispatch primarily on packet type. --- drivers.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'drivers.c') diff --git a/drivers.c b/drivers.c index 671175c3..c2d8df35 100644 --- a/drivers.c +++ b/drivers.c @@ -29,7 +29,9 @@ gps_mask_t generic_parse_input(struct gps_device_t *session) { const struct gps_type_t **dp; - if (session->packet.type == COMMENT_PACKET) { + if (session->packet.type == BAD_PACKET) + return 0; + else if (session->packet.type == COMMENT_PACKET) { gpsd_set_century(session); return 0; #ifdef NMEA_ENABLE @@ -65,17 +67,9 @@ gps_mask_t generic_parse_input(struct gps_device_t *session) return st; #endif /* NMEA_ENABLE */ } else { - /* - * Fallback case, we shouldn't actually ever get here. If - * we do, it means the driver-switching logic in gpsd_poll() - * is leaky. - */ - for (dp = gpsd_drivers; *dp; dp++) { - if (session->packet.type == (*dp)->packet_type) { - (void)gpsd_switch_driver(session, (*dp)->type_name); - return (*dp)->parse_packet(session); - } - } + gpsd_report(session->context->debug, LOG_SHOUT, + "packet type %d fell through (should never happen): %s.\n", + session->packet.type, gpsd_prettydump(session)); return 0; } } -- cgit v1.2.1