X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Fdrivers%2Fstaging%2Fgdm724x%2Fgdm_tty.c;fp=kernel%2Fdrivers%2Fstaging%2Fgdm724x%2Fgdm_tty.c;h=e2c0f228f36937b87390c01672862e9935f785f6;hb=e09b41010ba33a20a87472ee821fa407a5b8da36;hp=001348ccacf95cacd3cca7829681089314a36e1c;hpb=f93b97fd65072de626c074dbe099a1fff05ce060;p=kvmfornfv.git diff --git a/kernel/drivers/staging/gdm724x/gdm_tty.c b/kernel/drivers/staging/gdm724x/gdm_tty.c index 001348cca..e2c0f228f 100644 --- a/kernel/drivers/staging/gdm724x/gdm_tty.c +++ b/kernel/drivers/staging/gdm724x/gdm_tty.c @@ -88,7 +88,7 @@ static int gdm_tty_install(struct tty_driver *driver, struct tty_struct *tty) mutex_lock(&gdm_table_lock); gdm = gdm_table[i][j]; - if (gdm == NULL) { + if (!gdm) { mutex_unlock(&gdm_table_lock); return -ENODEV; } @@ -167,7 +167,7 @@ static int gdm_tty_recv_complete(void *data, static void gdm_tty_send_complete(void *arg) { - struct gdm *gdm = (struct gdm *)arg; + struct gdm *gdm = arg; if (!GDM_TTY_READY(gdm)) return; @@ -193,7 +193,7 @@ static int gdm_tty_write(struct tty_struct *tty, const unsigned char *buf, sending_len = remain > MUX_TX_MAX_SIZE ? MUX_TX_MAX_SIZE : remain; gdm_tty_send(gdm, - (void *)(buf+sent_len), + (void *)(buf + sent_len), sending_len, gdm->index, gdm_tty_send_complete, @@ -226,7 +226,7 @@ int register_lte_tty_device(struct tty_dev *tty_dev, struct device *device) for (i = 0; i < TTY_MAX_COUNT; i++) { - gdm = kmalloc(sizeof(struct gdm), GFP_KERNEL); + gdm = kmalloc(sizeof(*gdm), GFP_KERNEL); if (!gdm) return -ENOMEM;