smartcard: Avoid useless cast

We just created the object, we know is a RedCharDeviceSmartcard,
avoid to cast the pointer using RED_CHAR_DEVICE_SMARTCARD.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Frediano Ziglio 2020-03-09 21:19:05 +00:00
parent a59cfc0cc3
commit fff6e7da69

View File

@ -255,16 +255,16 @@ SpiceCharDeviceInstance *smartcard_readers_get_unattached(void)
static RedCharDeviceSmartcard *smartcard_device_new(RedsState *reds, SpiceCharDeviceInstance *sin)
{
RedCharDevice *char_dev;
RedCharDeviceSmartcard *dev;
char_dev = g_object_new(RED_TYPE_CHAR_DEVICE_SMARTCARD,
"sin", sin,
"spice-server", reds,
"client-tokens-interval", 0ULL,
"self-tokens", ~0ULL,
NULL);
dev = g_object_new(RED_TYPE_CHAR_DEVICE_SMARTCARD,
"sin", sin,
"spice-server", reds,
"client-tokens-interval", 0ULL,
"self-tokens", ~0ULL,
NULL);
return RED_CHAR_DEVICE_SMARTCARD(char_dev);
return dev;
}
void smartcard_device_disconnect(SpiceCharDeviceInstance *char_device)