Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96607
b: refs/heads/master
c: 3322238
h: refs/heads/master
i:
  96605: 748b975
  96603: 5a8b7c2
  96599: 6e3f10e
  96591: faeb03e
  96575: 9b59b3c
v: v3
  • Loading branch information
Graf Yang authored and David S. Miller committed May 14, 2008
1 parent 0e9b2f4 commit 813d85e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c1cc678adaa78ae2aab6a6d699241ad516d84476
refs/heads/master: 332223831e86b2e17b48b4afafad07d8e3b73861
3 changes: 0 additions & 3 deletions trunk/include/net/irda/discovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ typedef union {
__u8 byte[2];
} __u16_host_order;

/* Same purpose, different application */
#define u16ho(array) (* ((__u16 *) array))

/* Types of discovery */
typedef enum {
DISCOVERY_LOG, /* What's in our discovery log */
Expand Down
8 changes: 5 additions & 3 deletions trunk/net/irda/discovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

#include <net/irda/discovery.h>

#include <asm/unaligned.h>

/*
* Function irlmp_add_discovery (cachelog, discovery)
*
Expand Down Expand Up @@ -87,7 +89,7 @@ void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *new)
*/
hashbin_remove_this(cachelog, (irda_queue_t *) node);
/* Check if hints bits are unchanged */
if(u16ho(node->data.hints) == u16ho(new->data.hints))
if (get_unaligned((__u16 *)node->data.hints) == get_unaligned((__u16 *)new->data.hints))
/* Set time of first discovery for this node */
new->firststamp = node->firststamp;
kfree(node);
Expand Down Expand Up @@ -281,9 +283,9 @@ struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn,
/* Mask out the ones we don't want :
* We want to match the discovery mask, and to get only
* the most recent one (unless we want old ones) */
if ((u16ho(discovery->data.hints) & mask) &&
if ((get_unaligned((__u16 *)discovery->data.hints) & mask) &&
((old_entries) ||
((jiffies - discovery->firststamp) < j_timeout)) ) {
((jiffies - discovery->firststamp) < j_timeout))) {
/* Create buffer as needed.
* As this function get called a lot and most time
* we don't have anything to put in the log (we are
Expand Down
5 changes: 3 additions & 2 deletions trunk/net/irda/irlmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,8 @@ void irlmp_discovery_expiry(discinfo_t *expiries, int number)
for(i = 0; i < number; i++) {
/* Check if we should notify client */
if ((client->expir_callback) &&
(client->hint_mask.word & u16ho(expiries[i].hints)
(client->hint_mask.word &
get_unaligned((__u16 *)expiries[i].hints)
& 0x7f7f) )
client->expir_callback(&(expiries[i]),
EXPIRY_TIMEOUT,
Expand All @@ -1086,7 +1087,7 @@ discovery_t *irlmp_get_discovery_response(void)

IRDA_ASSERT(irlmp != NULL, return NULL;);

u16ho(irlmp->discovery_rsp.data.hints) = irlmp->hints.word;
put_unaligned(irlmp->hints.word, (__u16 *)irlmp->discovery_rsp.data.hints);

/*
* Set character set for device name (we use ASCII), and
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/irda/irnet/irnet_irda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ irnet_discovery_indication(discinfo_t * discovery,
/* Notify the control channel */
irnet_post_event(NULL, IRNET_DISCOVER,
discovery->saddr, discovery->daddr, discovery->info,
u16ho(discovery->hints));
get_unaligned((__u16 *)discovery->hints));

DEXIT(IRDA_OCB_TRACE, "\n");
}
Expand Down Expand Up @@ -1704,7 +1704,7 @@ irnet_expiry_indication(discinfo_t * expiry,
/* Notify the control channel */
irnet_post_event(NULL, IRNET_EXPIRE,
expiry->saddr, expiry->daddr, expiry->info,
u16ho(expiry->hints));
get_unaligned((__u16 *)expiry->hints));

DEXIT(IRDA_OCB_TRACE, "\n");
}
Expand Down

0 comments on commit 813d85e

Please sign in to comment.