summaryrefslogtreecommitdiff
path: root/drivers.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-15 05:49:52 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-15 05:49:52 -0400
commitffc1f85ef14ee4b54d4e7f7cfcf75b28a9f044de (patch)
tree9871a109802e603a6a68bb5f04f2a4e3870f246a /drivers.c
parent4afa4ed0c9928fad659bac2c34e287bda83c379c (diff)
downloadgpsd-ffc1f85ef14ee4b54d4e7f7cfcf75b28a9f044de.tar.gz
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.
Diffstat (limited to 'drivers.c')
-rw-r--r--drivers.c18
1 files changed, 6 insertions, 12 deletions
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;
}
}