Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c4c9432 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Greg Kroah-Hartman
Browse files

[PATCH] USB: mark various usb tables const



patch below marks various USB tables and variables as const so that they
end up in .rodata section and don't cacheline share with things that get
written to. For the non-array variables it also allows gcc to optimize
more.

Signed-off-by: default avatarArjan van de Ven <arjan@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9fe6fcd8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -658,7 +658,7 @@ static int acm_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int
	return -ENOIOCTLCMD;
}

static __u32 acm_tty_speed[] = {
static const __u32 acm_tty_speed[] = {
	0, 50, 75, 110, 134, 150, 200, 300, 600,
	1200, 1800, 2400, 4800, 9600, 19200, 38400,
	57600, 115200, 230400, 460800, 500000, 576000,
@@ -666,7 +666,7 @@ static __u32 acm_tty_speed[] = {
	2500000, 3000000, 3500000, 4000000
};

static __u8 acm_tty_size[] = {
static const __u8 acm_tty_size[] = {
	5, 6, 7, 8
};

+2 −2
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ struct quirk_printer_struct {
#define USBLP_QUIRK_BIDIR	0x1	/* reports bidir but requires unidirectional mode (no INs/reads) */
#define USBLP_QUIRK_USB_INIT	0x2	/* needs vendor USB init string */

static struct quirk_printer_struct quirk_printers[] = {
static const struct quirk_printer_struct quirk_printers[] = {
	{ 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */
	{ 0x03f0, 0x0104, USBLP_QUIRK_BIDIR }, /* HP DeskJet 880C */
	{ 0x03f0, 0x0204, USBLP_QUIRK_BIDIR }, /* HP DeskJet 815C */
@@ -301,7 +301,7 @@ static void usblp_bulk_write(struct urb *urb, struct pt_regs *regs)
 * Get and print printer errors.
 */

static char *usblp_messages[] = { "ok", "out of paper", "off-line", "on fire" };
static const char *usblp_messages[] = { "ok", "out of paper", "off-line", "on fire" };

static int usblp_check_status(struct usblp *usblp, int err)
{
+10 −10
Original line number Diff line number Diff line
@@ -67,45 +67,45 @@
/* Define ALLOW_SERIAL_NUMBER if you want to see the serial number of devices */
#define ALLOW_SERIAL_NUMBER

static char *format_topo =
static const char *format_topo =
/* T:  Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd */
"\nT:  Bus=%2.2d Lev=%2.2d Prnt=%2.2d Port=%2.2d Cnt=%2.2d Dev#=%3d Spd=%3s MxCh=%2d\n";

static char *format_string_manufacturer =
static const char *format_string_manufacturer =
/* S:  Manufacturer=xxxx */
  "S:  Manufacturer=%.100s\n";

static char *format_string_product =
static const char *format_string_product =
/* S:  Product=xxxx */
  "S:  Product=%.100s\n";

#ifdef ALLOW_SERIAL_NUMBER
static char *format_string_serialnumber =
static const char *format_string_serialnumber =
/* S:  SerialNumber=xxxx */
  "S:  SerialNumber=%.100s\n";
#endif

static char *format_bandwidth =
static const char *format_bandwidth =
/* B:  Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd */
  "B:  Alloc=%3d/%3d us (%2d%%), #Int=%3d, #Iso=%3d\n";
  
static char *format_device1 =
static const char *format_device1 =
/* D:  Ver=xx.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd */
  "D:  Ver=%2x.%02x Cls=%02x(%-5s) Sub=%02x Prot=%02x MxPS=%2d #Cfgs=%3d\n";

static char *format_device2 =
static const char *format_device2 =
/* P:  Vendor=xxxx ProdID=xxxx Rev=xx.xx */
  "P:  Vendor=%04x ProdID=%04x Rev=%2x.%02x\n";

static char *format_config =
static const char *format_config =
/* C:  #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA */
  "C:%c #Ifs=%2d Cfg#=%2d Atr=%02x MxPwr=%3dmA\n";
  
static char *format_iface =
static const char *format_iface =
/* I:  If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=xxxx*/
  "I:  If#=%2d Alt=%2d #EPs=%2d Cls=%02x(%-5s) Sub=%02x Prot=%02x Driver=%s\n";

static char *format_endpt =
static const char *format_endpt =
/* E:  Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=D?s */
  "E:  Ad=%02x(%c) Atr=%02x(%-4s) MxPS=%4d Ivl=%d%cs\n";

+1 −1
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space)
	}

#ifdef CONFIG_PROC_FS
static const char *qh_names[] = {
static const char * const qh_names[] = {
  "skel_int128_qh", "skel_int64_qh",
  "skel_int32_qh", "skel_int16_qh",
  "skel_int8_qh", "skel_int4_qh",
+1 −1
Original line number Diff line number Diff line
@@ -338,7 +338,7 @@ struct aiptek {
 * the bitmap which comes from the tablet. This hides the
 * issue that the F_keys are not sequentially numbered.
 */
static int macroKeyEvents[] = {
static const int macroKeyEvents[] = {
	KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5,
	KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11,
	KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17,
Loading