diff options
author | Dave Jones <davej@redhat.com> | 2006-12-12 17:41:41 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-12-12 17:41:41 -0500 |
commit | c4366889dda8110247be59ca41fddb82951a8c26 (patch) | |
tree | 705c1a996bed8fd48ce94ff33ec9fd00f9b94875 /net/irda | |
parent | db2fb9db5735cc532fd4fc55e94b9a3c3750378e (diff) | |
parent | e1036502e5263851259d147771226161e5ccc85a (diff) |
Merge ../linus
Conflicts:
drivers/cpufreq/cpufreq.c
Diffstat (limited to 'net/irda')
-rw-r--r-- | net/irda/discovery.c | 1 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 11 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_tty_ioctl.c | 2 | ||||
-rw-r--r-- | net/irda/iriap.c | 12 | ||||
-rw-r--r-- | net/irda/irias_object.c | 4 | ||||
-rw-r--r-- | net/irda/irlan/irlan_common.c | 2 | ||||
-rw-r--r-- | net/irda/irlmp.c | 7 | ||||
-rw-r--r-- | net/irda/irqueue.c | 3 | ||||
-rw-r--r-- | net/irda/irttp.c | 9 |
9 files changed, 25 insertions, 26 deletions
diff --git a/net/irda/discovery.c b/net/irda/discovery.c index 3fefc822c1..89fd2a2cbc 100644 --- a/net/irda/discovery.c +++ b/net/irda/discovery.c | |||
@@ -32,6 +32,7 @@ | |||
32 | 32 | ||
33 | #include <linux/string.h> | 33 | #include <linux/string.h> |
34 | #include <linux/socket.h> | 34 | #include <linux/socket.h> |
35 | #include <linux/fs.h> | ||
35 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
36 | 37 | ||
37 | #include <net/irda/irda.h> | 38 | #include <net/irda/irda.h> |
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index d50a02030a..262bda808d 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
@@ -61,7 +61,7 @@ static void ircomm_tty_flush_buffer(struct tty_struct *tty); | |||
61 | static void ircomm_tty_send_xchar(struct tty_struct *tty, char ch); | 61 | static void ircomm_tty_send_xchar(struct tty_struct *tty, char ch); |
62 | static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout); | 62 | static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout); |
63 | static void ircomm_tty_hangup(struct tty_struct *tty); | 63 | static void ircomm_tty_hangup(struct tty_struct *tty); |
64 | static void ircomm_tty_do_softint(void *private_); | 64 | static void ircomm_tty_do_softint(struct work_struct *work); |
65 | static void ircomm_tty_shutdown(struct ircomm_tty_cb *self); | 65 | static void ircomm_tty_shutdown(struct ircomm_tty_cb *self); |
66 | static void ircomm_tty_stop(struct tty_struct *tty); | 66 | static void ircomm_tty_stop(struct tty_struct *tty); |
67 | 67 | ||
@@ -389,7 +389,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
389 | self->flow = FLOW_STOP; | 389 | self->flow = FLOW_STOP; |
390 | 390 | ||
391 | self->line = line; | 391 | self->line = line; |
392 | INIT_WORK(&self->tqueue, ircomm_tty_do_softint, self); | 392 | INIT_WORK(&self->tqueue, ircomm_tty_do_softint); |
393 | self->max_header_size = IRCOMM_TTY_HDR_UNINITIALISED; | 393 | self->max_header_size = IRCOMM_TTY_HDR_UNINITIALISED; |
394 | self->max_data_size = IRCOMM_TTY_DATA_UNINITIALISED; | 394 | self->max_data_size = IRCOMM_TTY_DATA_UNINITIALISED; |
395 | self->close_delay = 5*HZ/10; | 395 | self->close_delay = 5*HZ/10; |
@@ -594,15 +594,16 @@ static void ircomm_tty_flush_buffer(struct tty_struct *tty) | |||
594 | } | 594 | } |
595 | 595 | ||
596 | /* | 596 | /* |
597 | * Function ircomm_tty_do_softint (private_) | 597 | * Function ircomm_tty_do_softint (work) |
598 | * | 598 | * |
599 | * We use this routine to give the write wakeup to the user at at a | 599 | * We use this routine to give the write wakeup to the user at at a |
600 | * safe time (as fast as possible after write have completed). This | 600 | * safe time (as fast as possible after write have completed). This |
601 | * can be compared to the Tx interrupt. | 601 | * can be compared to the Tx interrupt. |
602 | */ | 602 | */ |
603 | static void ircomm_tty_do_softint(void *private_) | 603 | static void ircomm_tty_do_softint(struct work_struct *work) |
604 | { | 604 | { |
605 | struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) private_; | 605 | struct ircomm_tty_cb *self = |
606 | container_of(work, struct ircomm_tty_cb, tqueue); | ||
606 | struct tty_struct *tty; | 607 | struct tty_struct *tty; |
607 | unsigned long flags; | 608 | unsigned long flags; |
608 | struct sk_buff *skb, *ctrl_skb; | 609 | struct sk_buff *skb, *ctrl_skb; |
diff --git a/net/irda/ircomm/ircomm_tty_ioctl.c b/net/irda/ircomm/ircomm_tty_ioctl.c index 197e3e7ed7..75e39ea599 100644 --- a/net/irda/ircomm/ircomm_tty_ioctl.c +++ b/net/irda/ircomm/ircomm_tty_ioctl.c | |||
@@ -146,7 +146,7 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self) | |||
146 | * do something rational. | 146 | * do something rational. |
147 | */ | 147 | */ |
148 | void ircomm_tty_set_termios(struct tty_struct *tty, | 148 | void ircomm_tty_set_termios(struct tty_struct *tty, |
149 | struct termios *old_termios) | 149 | struct ktermios *old_termios) |
150 | { | 150 | { |
151 | struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; | 151 | struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; |
152 | unsigned int cflag = tty->termios->c_cflag; | 152 | unsigned int cflag = tty->termios->c_cflag; |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 415cf4eec2..8f1c6d65b2 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
29 | #include <linux/skbuff.h> | 29 | #include <linux/skbuff.h> |
30 | #include <linux/fs.h> | ||
30 | #include <linux/string.h> | 31 | #include <linux/string.h> |
31 | #include <linux/init.h> | 32 | #include <linux/init.h> |
32 | #include <linux/seq_file.h> | 33 | #include <linux/seq_file.h> |
@@ -172,7 +173,7 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv, | |||
172 | 173 | ||
173 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 174 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); |
174 | 175 | ||
175 | self = kmalloc(sizeof(struct iriap_cb), GFP_ATOMIC); | 176 | self = kzalloc(sizeof(*self), GFP_ATOMIC); |
176 | if (!self) { | 177 | if (!self) { |
177 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); | 178 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); |
178 | return NULL; | 179 | return NULL; |
@@ -181,7 +182,6 @@ struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv, | |||
181 | /* | 182 | /* |
182 | * Initialize instance | 183 | * Initialize instance |
183 | */ | 184 | */ |
184 | memset(self, 0, sizeof(struct iriap_cb)); | ||
185 | 185 | ||
186 | self->magic = IAS_MAGIC; | 186 | self->magic = IAS_MAGIC; |
187 | self->mode = mode; | 187 | self->mode = mode; |
@@ -451,12 +451,12 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self, | |||
451 | n = 2; | 451 | n = 2; |
452 | 452 | ||
453 | /* Get length, MSB first */ | 453 | /* Get length, MSB first */ |
454 | len = be16_to_cpu(get_unaligned((__u16 *)(fp+n))); n += 2; | 454 | len = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); n += 2; |
455 | 455 | ||
456 | IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len); | 456 | IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len); |
457 | 457 | ||
458 | /* Get object ID, MSB first */ | 458 | /* Get object ID, MSB first */ |
459 | obj_id = be16_to_cpu(get_unaligned((__u16 *)(fp+n))); n += 2; | 459 | obj_id = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); n += 2; |
460 | 460 | ||
461 | type = fp[n++]; | 461 | type = fp[n++]; |
462 | IRDA_DEBUG(4, "%s(), Value type = %d\n", __FUNCTION__, type); | 462 | IRDA_DEBUG(4, "%s(), Value type = %d\n", __FUNCTION__, type); |
@@ -506,7 +506,7 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self, | |||
506 | value = irias_new_string_value(fp+n); | 506 | value = irias_new_string_value(fp+n); |
507 | break; | 507 | break; |
508 | case IAS_OCT_SEQ: | 508 | case IAS_OCT_SEQ: |
509 | value_len = be16_to_cpu(get_unaligned((__u16 *)(fp+n))); | 509 | value_len = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); |
510 | n += 2; | 510 | n += 2; |
511 | 511 | ||
512 | /* Will truncate to IAS_MAX_OCTET_STRING bytes */ | 512 | /* Will truncate to IAS_MAX_OCTET_STRING bytes */ |
@@ -544,7 +544,7 @@ static void iriap_getvaluebyclass_response(struct iriap_cb *self, | |||
544 | { | 544 | { |
545 | struct sk_buff *tx_skb; | 545 | struct sk_buff *tx_skb; |
546 | int n; | 546 | int n; |
547 | __u32 tmp_be32; | 547 | __be32 tmp_be32; |
548 | __be16 tmp_be16; | 548 | __be16 tmp_be16; |
549 | __u8 *fp; | 549 | __u8 *fp; |
550 | 550 | ||
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index 56292ab7d6..b1ee99a59c 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c | |||
@@ -501,13 +501,12 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len) | |||
501 | len = IAS_MAX_OCTET_STRING; | 501 | len = IAS_MAX_OCTET_STRING; |
502 | value->len = len; | 502 | value->len = len; |
503 | 503 | ||
504 | value->t.oct_seq = kmalloc(len, GFP_ATOMIC); | 504 | value->t.oct_seq = kmemdup(octseq, len, GFP_ATOMIC); |
505 | if (value->t.oct_seq == NULL){ | 505 | if (value->t.oct_seq == NULL){ |
506 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); | 506 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); |
507 | kfree(value); | 507 | kfree(value); |
508 | return NULL; | 508 | return NULL; |
509 | } | 509 | } |
510 | memcpy(value->t.oct_seq, octseq , len); | ||
511 | return value; | 510 | return value; |
512 | } | 511 | } |
513 | 512 | ||
@@ -522,7 +521,6 @@ struct ias_value *irias_new_missing_value(void) | |||
522 | } | 521 | } |
523 | 522 | ||
524 | value->type = IAS_MISSING; | 523 | value->type = IAS_MISSING; |
525 | value->len = 0; | ||
526 | 524 | ||
527 | return value; | 525 | return value; |
528 | } | 526 | } |
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index 9b962f2477..2bb04ac093 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c | |||
@@ -995,7 +995,7 @@ static int __irlan_insert_param(struct sk_buff *skb, char *param, int type, | |||
995 | { | 995 | { |
996 | __u8 *frame; | 996 | __u8 *frame; |
997 | __u8 param_len; | 997 | __u8 param_len; |
998 | __u16 tmp_le; /* Temporary value in little endian format */ | 998 | __le16 tmp_le; /* Temporary value in little endian format */ |
999 | int n=0; | 999 | int n=0; |
1000 | 1000 | ||
1001 | if (skb == NULL) { | 1001 | if (skb == NULL) { |
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index 5073261b9d..7e5d12ab3b 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c | |||
@@ -641,15 +641,13 @@ struct lsap_cb *irlmp_dup(struct lsap_cb *orig, void *instance) | |||
641 | } | 641 | } |
642 | 642 | ||
643 | /* Allocate a new instance */ | 643 | /* Allocate a new instance */ |
644 | new = kmalloc(sizeof(struct lsap_cb), GFP_ATOMIC); | 644 | new = kmemdup(orig, sizeof(*new), GFP_ATOMIC); |
645 | if (!new) { | 645 | if (!new) { |
646 | IRDA_DEBUG(0, "%s(), unable to kmalloc\n", __FUNCTION__); | 646 | IRDA_DEBUG(0, "%s(), unable to kmalloc\n", __FUNCTION__); |
647 | spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, | 647 | spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, |
648 | flags); | 648 | flags); |
649 | return NULL; | 649 | return NULL; |
650 | } | 650 | } |
651 | /* Dup */ | ||
652 | memcpy(new, orig, sizeof(struct lsap_cb)); | ||
653 | /* new->lap = orig->lap; => done in the memcpy() */ | 651 | /* new->lap = orig->lap; => done in the memcpy() */ |
654 | /* new->slsap_sel = orig->slsap_sel; => done in the memcpy() */ | 652 | /* new->slsap_sel = orig->slsap_sel; => done in the memcpy() */ |
655 | new->conn_skb = NULL; | 653 | new->conn_skb = NULL; |
@@ -1678,7 +1676,8 @@ static int irlmp_slsap_inuse(__u8 slsap_sel) | |||
1678 | * every IrLAP connection and check every LSAP associated with each | 1676 | * every IrLAP connection and check every LSAP associated with each |
1679 | * the connection. | 1677 | * the connection. |
1680 | */ | 1678 | */ |
1681 | spin_lock_irqsave(&irlmp->links->hb_spinlock, flags); | 1679 | spin_lock_irqsave_nested(&irlmp->links->hb_spinlock, flags, |
1680 | SINGLE_DEPTH_NESTING); | ||
1682 | lap = (struct lap_cb *) hashbin_get_first(irlmp->links); | 1681 | lap = (struct lap_cb *) hashbin_get_first(irlmp->links); |
1683 | while (lap != NULL) { | 1682 | while (lap != NULL) { |
1684 | IRDA_ASSERT(lap->magic == LMP_LAP_MAGIC, goto errlap;); | 1683 | IRDA_ASSERT(lap->magic == LMP_LAP_MAGIC, goto errlap;); |
diff --git a/net/irda/irqueue.c b/net/irda/irqueue.c index 1ba8c71066..1d26cd33ea 100644 --- a/net/irda/irqueue.c +++ b/net/irda/irqueue.c | |||
@@ -356,14 +356,13 @@ hashbin_t *hashbin_new(int type) | |||
356 | /* | 356 | /* |
357 | * Allocate new hashbin | 357 | * Allocate new hashbin |
358 | */ | 358 | */ |
359 | hashbin = kmalloc( sizeof(hashbin_t), GFP_ATOMIC); | 359 | hashbin = kzalloc(sizeof(*hashbin), GFP_ATOMIC); |
360 | if (!hashbin) | 360 | if (!hashbin) |
361 | return NULL; | 361 | return NULL; |
362 | 362 | ||
363 | /* | 363 | /* |
364 | * Initialize structure | 364 | * Initialize structure |
365 | */ | 365 | */ |
366 | memset(hashbin, 0, sizeof(hashbin_t)); | ||
367 | hashbin->hb_type = type; | 366 | hashbin->hb_type = type; |
368 | hashbin->magic = HB_MAGIC; | 367 | hashbin->magic = HB_MAGIC; |
369 | //hashbin->hb_current = NULL; | 368 | //hashbin->hb_current = NULL; |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 3c2e70b77d..03504f3e49 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include <linux/skbuff.h> | 27 | #include <linux/skbuff.h> |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/fs.h> | ||
29 | #include <linux/seq_file.h> | 30 | #include <linux/seq_file.h> |
30 | 31 | ||
31 | #include <asm/byteorder.h> | 32 | #include <asm/byteorder.h> |
@@ -1099,7 +1100,7 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, | |||
1099 | return -ENOMEM; | 1100 | return -ENOMEM; |
1100 | 1101 | ||
1101 | /* Reserve space for MUX_CONTROL and LAP header */ | 1102 | /* Reserve space for MUX_CONTROL and LAP header */ |
1102 | skb_reserve(tx_skb, TTP_MAX_HEADER); | 1103 | skb_reserve(tx_skb, TTP_MAX_HEADER + TTP_SAR_HEADER); |
1103 | } else { | 1104 | } else { |
1104 | tx_skb = userdata; | 1105 | tx_skb = userdata; |
1105 | /* | 1106 | /* |
@@ -1147,7 +1148,7 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, | |||
1147 | frame[3] = 0x02; /* Value length */ | 1148 | frame[3] = 0x02; /* Value length */ |
1148 | 1149 | ||
1149 | put_unaligned(cpu_to_be16((__u16) max_sdu_size), | 1150 | put_unaligned(cpu_to_be16((__u16) max_sdu_size), |
1150 | (__u16 *)(frame+4)); | 1151 | (__be16 *)(frame+4)); |
1151 | } else { | 1152 | } else { |
1152 | /* Insert plain TTP header */ | 1153 | /* Insert plain TTP header */ |
1153 | frame = skb_push(tx_skb, TTP_HEADER); | 1154 | frame = skb_push(tx_skb, TTP_HEADER); |
@@ -1348,7 +1349,7 @@ int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, | |||
1348 | return -ENOMEM; | 1349 | return -ENOMEM; |
1349 | 1350 | ||
1350 | /* Reserve space for MUX_CONTROL and LAP header */ | 1351 | /* Reserve space for MUX_CONTROL and LAP header */ |
1351 | skb_reserve(tx_skb, TTP_MAX_HEADER); | 1352 | skb_reserve(tx_skb, TTP_MAX_HEADER + TTP_SAR_HEADER); |
1352 | } else { | 1353 | } else { |
1353 | tx_skb = userdata; | 1354 | tx_skb = userdata; |
1354 | /* | 1355 | /* |
@@ -1394,7 +1395,7 @@ int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, | |||
1394 | frame[3] = 0x02; /* Value length */ | 1395 | frame[3] = 0x02; /* Value length */ |
1395 | 1396 | ||
1396 | put_unaligned(cpu_to_be16((__u16) max_sdu_size), | 1397 | put_unaligned(cpu_to_be16((__u16) max_sdu_size), |
1397 | (__u16 *)(frame+4)); | 1398 | (__be16 *)(frame+4)); |
1398 | } else { | 1399 | } else { |
1399 | /* Insert TTP header */ | 1400 | /* Insert TTP header */ |
1400 | frame = skb_push(tx_skb, TTP_HEADER); | 1401 | frame = skb_push(tx_skb, TTP_HEADER); |