Re: [PATCH libcacard] nss: remove unused module_has_removable_hw_slots() check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Aug 03, 2018 at 12:44:30PM +0200, marcandre.lureau@xxxxxxxxxx wrote:
> From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> 
> The check result is unused, the following loop over module list
> doesn't need it anyway.

Seems that this code you are removing became obsolete at

 | commit 8f159d0833a37cbe09376dd2f398c6595ad02dc9
 | Author: Marc-André Lureau <mlureau@xxxxxxxxxx>
 | Date:   Wed Mar 20 14:07:49 2013 +0100
 |
 | libcacard: remove default libcoolkey loading
 |
 | Use only the modules defined in the NSS database.
 |
 | Signed-off-by: Marc-André Lureau <mlureau@xxxxxxxxxx>
 | Reviewed-by: Alon Levy <alevy@xxxxxxxxxx>

You could add that reference to commit log

> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

Acked-by: Victor Toso <victortoso@xxxxxxxxxx>

> ---
>  src/vcard_emul_nss.c | 32 --------------------------------
>  1 file changed, 32 deletions(-)
> 
> diff --git a/src/vcard_emul_nss.c b/src/vcard_emul_nss.c
> index d106436..8a56343 100644
> --- a/src/vcard_emul_nss.c
> +++ b/src/vcard_emul_nss.c
> @@ -878,30 +878,6 @@ vcard_emul_force_card_insert(VReader *vreader)
>      return VCARD_EMUL_OK;
>  }
>  
> -
> -static PRBool
> -module_has_removable_hw_slots(SECMODModule *mod)
> -{
> -    int i;
> -    PRBool ret = PR_FALSE;
> -    SECMODListLock *moduleLock = SECMOD_GetDefaultModuleListLock();
> -
> -    if (!moduleLock) {
> -        PORT_SetError(SEC_ERROR_NOT_INITIALIZED);
> -        return ret;
> -    }
> -    SECMOD_GetReadLock(moduleLock);
> -    for (i = 0; i < mod->slotCount; i++) {
> -        PK11SlotInfo *slot = mod->slots[i];
> -        if (PK11_IsRemovable(slot) && PK11_IsHW(slot)) {
> -            ret = PR_TRUE;
> -            break;
> -        }
> -    }
> -    SECMOD_ReleaseReadLock(moduleLock);
> -    return ret;
> -}
> -
>  /* Previously we returned FAIL if no readers found. This makes
>   * no sense when using hardware, since there may be no readers connected
>   * at the time vcard_emul_init is called, but they will be properly
> @@ -1041,14 +1017,6 @@ vcard_emul_init(const VCardEmulOptions *options)
>      /* make sure we have some PKCS #11 module loaded */
>      module_lock = SECMOD_GetDefaultModuleListLock();
>      module_list = SECMOD_GetDefaultModuleList();
> -    SECMOD_GetReadLock(module_lock);
> -    for (mlp = module_list; mlp; mlp = mlp->next) {
> -        SECMODModule *module = mlp->module;
> -        if (module_has_removable_hw_slots(module)) {
> -            break;
> -        }
> -    }
> -    SECMOD_ReleaseReadLock(module_lock);
>  
>      /* now examine all the slots, finding which should be readers */
>      /* We should control this with options. For now we mirror out any
> -- 
> 2.18.0.321.gffc6fa0e39
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]