greybus: get rid of {conceal,reveal}_urb()
These clever macros were fine for early development, but they're more of a distraction now. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
parent
d3d2bea161
commit
142f8ddf71
|
@ -21,13 +21,6 @@
|
||||||
#include "svc_msg.h"
|
#include "svc_msg.h"
|
||||||
#include "kernel_ver.h"
|
#include "kernel_ver.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* Macros for making pointers explicitly opaque, such that the result
|
|
||||||
* isn't valid but also can't be mistaken for an ERR_PTR() value.
|
|
||||||
*/
|
|
||||||
#define conceal_urb(urb) ((void *)((uintptr_t)(urb) ^ 0xbad))
|
|
||||||
#define reveal_urb(cookie) ((void *)((uintptr_t)(cookie) ^ 0xbad))
|
|
||||||
|
|
||||||
/* Memory sizes for the buffers sent to/from the ES1 controller */
|
/* Memory sizes for the buffers sent to/from the ES1 controller */
|
||||||
#define ES1_SVC_MSG_SIZE (sizeof(struct svc_msg) + SZ_64K)
|
#define ES1_SVC_MSG_SIZE (sizeof(struct svc_msg) + SZ_64K)
|
||||||
#define ES1_GBUF_MSG_SIZE_MAX PAGE_SIZE
|
#define ES1_GBUF_MSG_SIZE_MAX PAGE_SIZE
|
||||||
|
@ -274,7 +267,7 @@ static void *buffer_send(struct greybus_host_device *hd, u16 cport_id,
|
||||||
return ERR_PTR(retval);
|
return ERR_PTR(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
return conceal_urb(urb);
|
return urb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -292,7 +285,7 @@ static void buffer_cancel(void *cookie)
|
||||||
* is valid. For the time being, this will do.
|
* is valid. For the time being, this will do.
|
||||||
*/
|
*/
|
||||||
if (cookie)
|
if (cookie)
|
||||||
usb_kill_urb(reveal_urb(cookie));
|
usb_kill_urb(cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct greybus_host_driver es1_driver = {
|
static struct greybus_host_driver es1_driver = {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Greybus "AP" USB driver for "ES2" controller chips
|
* Greybus "AP" USB driver for "ES2" controller chips
|
||||||
*
|
*
|
||||||
* Copyright 2014 Google Inc.
|
* Copyright 2014-2015 Google Inc.
|
||||||
* Copyright 2014 Linaro Ltd.
|
* Copyright 2014-2015 Linaro Ltd.
|
||||||
*
|
*
|
||||||
* Released under the GPLv2 only.
|
* Released under the GPLv2 only.
|
||||||
*/
|
*/
|
||||||
|
@ -17,13 +17,6 @@
|
||||||
#include "svc_msg.h"
|
#include "svc_msg.h"
|
||||||
#include "kernel_ver.h"
|
#include "kernel_ver.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* Macros for making pointers explicitly opaque, such that the result
|
|
||||||
* isn't valid but also can't be mistaken for an ERR_PTR() value.
|
|
||||||
*/
|
|
||||||
#define conceal_urb(urb) ((void *)((uintptr_t)(urb) ^ 0xbad))
|
|
||||||
#define reveal_urb(cookie) ((void *)((uintptr_t)(cookie) ^ 0xbad))
|
|
||||||
|
|
||||||
/* Memory sizes for the buffers sent to/from the ES1 controller */
|
/* Memory sizes for the buffers sent to/from the ES1 controller */
|
||||||
#define ES1_SVC_MSG_SIZE (sizeof(struct svc_msg) + SZ_64K)
|
#define ES1_SVC_MSG_SIZE (sizeof(struct svc_msg) + SZ_64K)
|
||||||
#define ES1_GBUF_MSG_SIZE_MAX PAGE_SIZE
|
#define ES1_GBUF_MSG_SIZE_MAX PAGE_SIZE
|
||||||
|
@ -262,7 +255,7 @@ static void *buffer_send(struct greybus_host_device *hd, u16 cport_id,
|
||||||
return ERR_PTR(retval);
|
return ERR_PTR(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
return conceal_urb(urb);
|
return urb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -280,7 +273,7 @@ static void buffer_cancel(void *cookie)
|
||||||
* is valid. For the time being, this will do.
|
* is valid. For the time being, this will do.
|
||||||
*/
|
*/
|
||||||
if (cookie)
|
if (cookie)
|
||||||
usb_kill_urb(reveal_urb(cookie));
|
usb_kill_urb(cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct greybus_host_driver es1_driver = {
|
static struct greybus_host_driver es1_driver = {
|
||||||
|
|
Loading…
Reference in New Issue