diff --git a/backend/genesys_gl841.cc b/backend/genesys_gl841.cc index dc78bebcc..7569fb00d 100644 --- a/backend/genesys_gl841.cc +++ b/backend/genesys_gl841.cc @@ -3020,20 +3020,13 @@ gl841_detect_document_end (Genesys_Device * dev) * amount of data to scan form the hardware settings */ try { - status = sanei_genesys_read_scancnt(dev, &scancnt); + sanei_genesys_read_scancnt(dev, &scancnt); } catch (...) { dev->total_bytes_to_read = dev->total_bytes_read; dev->read_bytes_left = 0; throw; } - if(status!=SANE_STATUS_GOOD) - { - dev->total_bytes_to_read = dev->total_bytes_read; - dev->read_bytes_left = 0; - DBG(DBG_proc, "%s: finished\n", __func__); - return SANE_STATUS_GOOD; - } if (dev->settings.scan_mode == ScanColorMode::COLOR_SINGLE_PASS && dev->model->is_cis) { scancnt/=3; diff --git a/backend/genesys_gl843.cc b/backend/genesys_gl843.cc index 1cab0af7e..ffde5533b 100644 --- a/backend/genesys_gl843.cc +++ b/backend/genesys_gl843.cc @@ -1947,18 +1947,13 @@ gl843_detect_document_end (Genesys_Device * dev) read_bytes_left = (int) dev->read_bytes_left; DBG(DBG_io, "%s: read_bytes_left=%d\n", __func__, read_bytes_left); - /* get lines read */ + // get lines read try { - status = sanei_genesys_read_scancnt(dev, &scancnt); + sanei_genesys_read_scancnt(dev, &scancnt); } catch (...) { flines = 0; } - if (status != SANE_STATUS_GOOD) - { - flines = 0; - } - else - { + /* compute number of line read */ tmp = (int) dev->total_bytes_read; if (depth == 1 || dev->settings.scan_mode == ScanColorMode::LINEART) @@ -1970,7 +1965,6 @@ gl843_detect_document_end (Genesys_Device * dev) flines = scancnt - flines; DBG(DBG_io, "%s: %d scanned but not read lines\n", __func__, flines); - } /* adjust number of bytes to read * we need to read the final bytes which are word per line * number of last lines diff --git a/backend/genesys_low.cc b/backend/genesys_low.cc index 4323036ee..24edb8b6e 100644 --- a/backend/genesys_low.cc +++ b/backend/genesys_low.cc @@ -770,8 +770,7 @@ sanei_genesys_read_valid_words (Genesys_Device * dev, unsigned int *words) /** read the number of lines scanned * ie registers 4b-4c-4d */ -SANE_Status -sanei_genesys_read_scancnt (Genesys_Device * dev, unsigned int *words) +void sanei_genesys_read_scancnt(Genesys_Device* dev, unsigned int* words) { DBG_HELPER(dbg); uint8_t value; @@ -799,7 +798,6 @@ sanei_genesys_read_scancnt (Genesys_Device * dev, unsigned int *words) } DBG(DBG_proc, "%s: %d lines\n", __func__, *words); - return SANE_STATUS_GOOD; } /** @brief Check if the scanner's internal data buffer is empty diff --git a/backend/genesys_low.h b/backend/genesys_low.h index 7f038a2a4..f7829be11 100644 --- a/backend/genesys_low.h +++ b/backend/genesys_low.h @@ -1756,8 +1756,7 @@ sanei_genesys_init_shading_data (Genesys_Device * dev, const Genesys_Sensor& sen extern SANE_Status sanei_genesys_read_valid_words (Genesys_Device * dev, unsigned int *steps); -extern SANE_Status sanei_genesys_read_scancnt (Genesys_Device * dev, - unsigned int *steps); +extern void sanei_genesys_read_scancnt(Genesys_Device* dev, unsigned int* steps); extern SANE_Status sanei_genesys_read_feed_steps (Genesys_Device * dev, unsigned int *steps);