diff --git a/backend/hp.c b/backend/hp.c index 558a36d83..ec4340259 100644 --- a/backend/hp.c +++ b/backend/hp.c @@ -581,13 +581,9 @@ hp_get_dev (const char *devname, HpDevice* devp) DBG(3, "hp_get_dev: New device %s, connect-%s, scsi-request=%lu\n", devname, connect, (unsigned long)info->config.use_scsi_request); - if (!ptr) - { - status = sanei_hp_device_new (&new, devname); - - if ( status != SANE_STATUS_GOOD ) - return status; - } + status = sanei_hp_device_new (&new, devname); + if (status != SANE_STATUS_GOOD) + return status; if (devp) *devp = new; diff --git a/backend/hp3900_config.c b/backend/hp3900_config.c index c48cb513b..c40920f00 100644 --- a/backend/hp3900_config.c +++ b/backend/hp3900_config.c @@ -1523,19 +1523,16 @@ static SANE_Int hp3800_checkstable(SANE_Int lamp, struct st_checkstable *check) SANE_Int rst = ERROR; - if (reg != NULL) - { - SANE_Int a; - SANE_Int count = sizeof(reg) / sizeof(struct st_reg); + SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < count; a++) + for (a = 0; a < count; a++) + { + if (reg[a].lamp == lamp) { - if (reg[a].lamp == lamp) - { - memcpy(check, ®[a].values, sizeof(struct st_checkstable)); - rst = OK; - break; - } + memcpy(check, ®[a].values, sizeof(struct st_checkstable)); + rst = OK; + break; } } @@ -1560,19 +1557,16 @@ static SANE_Int hp3970_checkstable(SANE_Int lamp, struct st_checkstable *check) SANE_Int rst = ERROR; - if (reg != NULL) - { - SANE_Int a; - SANE_Int count = sizeof(reg) / sizeof(struct st_reg); + SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < count; a++) + for (a = 0; a < count; a++) + { + if (reg[a].lamp == lamp) { - if (reg[a].lamp == lamp) - { - memcpy(check, ®[a].values, sizeof(struct st_checkstable)); - rst = OK; - break; - } + memcpy(check, ®[a].values, sizeof(struct st_checkstable)); + rst = OK; + break; } } @@ -1597,19 +1591,16 @@ static SANE_Int hp4370_checkstable(SANE_Int lamp, struct st_checkstable *check) SANE_Int rst = ERROR; - if (reg != NULL) - { - SANE_Int a; - SANE_Int count = sizeof(reg) / sizeof(struct st_reg); + SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < count; a++) + for (a = 0; a < count; a++) + { + if (reg[a].lamp == lamp) { - if (reg[a].lamp == lamp) - { - memcpy(check, ®[a].values, sizeof(struct st_checkstable)); - rst = OK; - break; - } + memcpy(check, ®[a].values, sizeof(struct st_checkstable)); + rst = OK; + break; } } @@ -1634,19 +1625,16 @@ static SANE_Int ua4900_checkstable(SANE_Int lamp, struct st_checkstable *check) SANE_Int rst = ERROR; - if (reg != NULL) - { - SANE_Int a; - SANE_Int count = sizeof(reg) / sizeof(struct st_reg); + SANE_Int a; + SANE_Int count = sizeof(reg) / sizeof(struct st_reg); - for (a = 0; a < count; a++) + for (a = 0; a < count; a++) + { + if (reg[a].lamp == lamp) { - if (reg[a].lamp == lamp) - { - memcpy(check, ®[a].values, sizeof(struct st_checkstable)); - rst = OK; - break; - } + memcpy(check, ®[a].values, sizeof(struct st_checkstable)); + rst = OK; + break; } }