summaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>2006-08-26 23:48:11 -0300
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 11:58:55 -0700
commit095bc335360a51623dd8571839bbf465851a7f4b (patch)
treee28c101dd9665b67b137e3e21a8161c1bcf4b898 /include/linux/usb.h
parent83a07196735dbf371b61d6dffbb7e6a696c633c2 (diff)
downloadlinux-095bc335360a51623dd8571839bbf465851a7f4b.tar.gz
linux-095bc335360a51623dd8571839bbf465851a7f4b.tar.bz2
linux-095bc335360a51623dd8571839bbf465851a7f4b.zip
USB core: Use const where possible.
This patch marks some USB core's functions parameters as const. This improves the design (we're saying to the caller that its parameter is not going to be modified) and may help in compiler's optimisation work. Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index f807479ef65b..26d8a5f36896 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -387,7 +387,7 @@ extern void usb_put_dev(struct usb_device *dev);
#define usb_unlock_device(udev) up(&(udev)->dev.sem)
#define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem)
extern int usb_lock_device_for_reset(struct usb_device *udev,
- struct usb_interface *iface);
+ const struct usb_interface *iface);
/* USB port reset for device reinitialization */
extern int usb_reset_device(struct usb_device *dev);
@@ -426,10 +426,10 @@ const struct usb_device_id *usb_match_id(struct usb_interface *interface,
extern struct usb_interface *usb_find_interface(struct usb_driver *drv,
int minor);
-extern struct usb_interface *usb_ifnum_to_if(struct usb_device *dev,
+extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev,
unsigned ifnum);
extern struct usb_host_interface *usb_altnum_to_altsetting(
- struct usb_interface *intf, unsigned int altnum);
+ const struct usb_interface *intf, unsigned int altnum);
/**
@@ -1064,14 +1064,14 @@ void usb_buffer_unmap (struct urb *urb);
#endif
struct scatterlist;
-int usb_buffer_map_sg (struct usb_device *dev, unsigned pipe,
- struct scatterlist *sg, int nents);
+int usb_buffer_map_sg(const struct usb_device *dev, unsigned pipe,
+ struct scatterlist *sg, int nents);
#if 0
-void usb_buffer_dmasync_sg (struct usb_device *dev, unsigned pipe,
- struct scatterlist *sg, int n_hw_ents);
+void usb_buffer_dmasync_sg(const struct usb_device *dev, unsigned pipe,
+ struct scatterlist *sg, int n_hw_ents);
#endif
-void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
- struct scatterlist *sg, int n_hw_ents);
+void usb_buffer_unmap_sg(const struct usb_device *dev, unsigned pipe,
+ struct scatterlist *sg, int n_hw_ents);
/*-------------------------------------------------------------------*
* SYNCHRONOUS CALL SUPPORT *