mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[IRDA]: *irttp cleanup
* Remove useless comment. * Remove useless assertions. * Remove useless comparison. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
15166fadb0
commit
8689c07e47
1 changed files with 4 additions and 11 deletions
|
@ -38,7 +38,7 @@
|
||||||
#include <net/irda/parameters.h>
|
#include <net/irda/parameters.h>
|
||||||
#include <net/irda/irttp.h>
|
#include <net/irda/irttp.h>
|
||||||
|
|
||||||
static struct irttp_cb *irttp = NULL;
|
static struct irttp_cb *irttp;
|
||||||
|
|
||||||
static void __irttp_close_tsap(struct tsap_cb *self);
|
static void __irttp_close_tsap(struct tsap_cb *self);
|
||||||
|
|
||||||
|
@ -86,12 +86,9 @@ static pi_param_info_t param_info = { pi_major_call_table, 1, 0x0f, 4 };
|
||||||
*/
|
*/
|
||||||
int __init irttp_init(void)
|
int __init irttp_init(void)
|
||||||
{
|
{
|
||||||
/* Initialize the irttp structure. */
|
|
||||||
if (irttp == NULL) {
|
|
||||||
irttp = kmalloc(sizeof(struct irttp_cb), GFP_KERNEL);
|
irttp = kmalloc(sizeof(struct irttp_cb), GFP_KERNEL);
|
||||||
if (irttp == NULL)
|
if (irttp == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
memset(irttp, 0, sizeof(struct irttp_cb));
|
memset(irttp, 0, sizeof(struct irttp_cb));
|
||||||
|
|
||||||
irttp->magic = TTP_MAGIC;
|
irttp->magic = TTP_MAGIC;
|
||||||
|
@ -116,7 +113,6 @@ int __init irttp_init(void)
|
||||||
void __exit irttp_cleanup(void)
|
void __exit irttp_cleanup(void)
|
||||||
{
|
{
|
||||||
/* Check for main structure */
|
/* Check for main structure */
|
||||||
IRDA_ASSERT(irttp != NULL, return;);
|
|
||||||
IRDA_ASSERT(irttp->magic == TTP_MAGIC, return;);
|
IRDA_ASSERT(irttp->magic == TTP_MAGIC, return;);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -383,7 +379,6 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify)
|
||||||
struct lsap_cb *lsap;
|
struct lsap_cb *lsap;
|
||||||
notify_t ttp_notify;
|
notify_t ttp_notify;
|
||||||
|
|
||||||
IRDA_ASSERT(irttp != NULL, return NULL;);
|
|
||||||
IRDA_ASSERT(irttp->magic == TTP_MAGIC, return NULL;);
|
IRDA_ASSERT(irttp->magic == TTP_MAGIC, return NULL;);
|
||||||
|
|
||||||
/* The IrLMP spec (IrLMP 1.1 p10) says that we have the right to
|
/* The IrLMP spec (IrLMP 1.1 p10) says that we have the right to
|
||||||
|
@ -1882,8 +1877,6 @@ static int irttp_seq_open(struct inode *inode, struct file *file)
|
||||||
int rc = -ENOMEM;
|
int rc = -ENOMEM;
|
||||||
struct irttp_iter_state *s;
|
struct irttp_iter_state *s;
|
||||||
|
|
||||||
IRDA_ASSERT(irttp != NULL, return -EINVAL;);
|
|
||||||
|
|
||||||
s = kmalloc(sizeof(*s), GFP_KERNEL);
|
s = kmalloc(sizeof(*s), GFP_KERNEL);
|
||||||
if (!s)
|
if (!s)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue