提交 0ad78200 编写于 作者: A Arjan van de Ven 提交者: James Bottomley

[SCSI] Mark some core scsi data structures const

patch below marks a few scsi core datastructures as const, so that they end up
in the .rodata section and don't cacheline share with things that get dirtied
Signed-off-by: NArjan van de Ven <arjan@infradead.org>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 ce155cce
...@@ -75,7 +75,7 @@ static int vendor_counts[CH_TYPES-4]; ...@@ -75,7 +75,7 @@ static int vendor_counts[CH_TYPES-4];
module_param_array(vendor_firsts, int, NULL, 0444); module_param_array(vendor_firsts, int, NULL, 0444);
module_param_array(vendor_counts, int, NULL, 0444); module_param_array(vendor_counts, int, NULL, 0444);
static char *vendor_labels[CH_TYPES-4] = { static const char * vendor_labels[CH_TYPES-4] = {
"v0", "v1", "v2", "v3" "v0", "v1", "v2", "v3"
}; };
// module_param_string_array(vendor_labels, NULL, 0444); // module_param_string_array(vendor_labels, NULL, 0444);
...@@ -140,7 +140,7 @@ static struct file_operations changer_fops = ...@@ -140,7 +140,7 @@ static struct file_operations changer_fops =
#endif #endif
}; };
static struct { static const struct {
unsigned char sense; unsigned char sense;
unsigned char asc; unsigned char asc;
unsigned char ascq; unsigned char ascq;
......
...@@ -1065,7 +1065,7 @@ struct error_info2 { ...@@ -1065,7 +1065,7 @@ struct error_info2 {
const char * fmt; const char * fmt;
}; };
static struct error_info2 additional2[] = static const struct error_info2 additional2[] =
{ {
{0x40,0x00,0x7f,"Ram failure (%x)"}, {0x40,0x00,0x7f,"Ram failure (%x)"},
{0x40,0x80,0xff,"Diagnostic failure on component (%x)"}, {0x40,0x80,0xff,"Diagnostic failure on component (%x)"},
...@@ -1077,7 +1077,7 @@ static struct error_info2 additional2[] = ...@@ -1077,7 +1077,7 @@ static struct error_info2 additional2[] =
}; };
/* description of the sense key values */ /* description of the sense key values */
static const char *snstext[] = { static const char * const snstext[] = {
"No Sense", /* 0: There is no sense information */ "No Sense", /* 0: There is no sense information */
"Recovered Error", /* 1: The last command completed successfully "Recovered Error", /* 1: The last command completed successfully
but used error correction */ but used error correction */
...@@ -1279,7 +1279,7 @@ void scsi_print_req_sense(const char *devclass, struct scsi_request *sreq) ...@@ -1279,7 +1279,7 @@ void scsi_print_req_sense(const char *devclass, struct scsi_request *sreq)
EXPORT_SYMBOL(scsi_print_req_sense); EXPORT_SYMBOL(scsi_print_req_sense);
#ifdef CONFIG_SCSI_CONSTANTS #ifdef CONFIG_SCSI_CONSTANTS
static const char *one_byte_msgs[] = { static const char * const one_byte_msgs[] = {
/* 0x00 */ "Command Complete", NULL, "Save Pointers", /* 0x00 */ "Command Complete", NULL, "Save Pointers",
/* 0x03 */ "Restore Pointers", "Disconnect", "Initiator Error", /* 0x03 */ "Restore Pointers", "Disconnect", "Initiator Error",
/* 0x06 */ "Abort", "Message Reject", "Nop", "Message Parity Error", /* 0x06 */ "Abort", "Message Reject", "Nop", "Message Parity Error",
...@@ -1289,13 +1289,13 @@ static const char *one_byte_msgs[] = { ...@@ -1289,13 +1289,13 @@ static const char *one_byte_msgs[] = {
}; };
#define NO_ONE_BYTE_MSGS (sizeof(one_byte_msgs) / sizeof (const char *)) #define NO_ONE_BYTE_MSGS (sizeof(one_byte_msgs) / sizeof (const char *))
static const char *two_byte_msgs[] = { static const char * const two_byte_msgs[] = {
/* 0x20 */ "Simple Queue Tag", "Head of Queue Tag", "Ordered Queue Tag" /* 0x20 */ "Simple Queue Tag", "Head of Queue Tag", "Ordered Queue Tag"
/* 0x23 */ "Ignore Wide Residue" /* 0x23 */ "Ignore Wide Residue"
}; };
#define NO_TWO_BYTE_MSGS (sizeof(two_byte_msgs) / sizeof (const char *)) #define NO_TWO_BYTE_MSGS (sizeof(two_byte_msgs) / sizeof (const char *))
static const char *extended_msgs[] = { static const char * const extended_msgs[] = {
/* 0x00 */ "Modify Data Pointer", "Synchronous Data Transfer Request", /* 0x00 */ "Modify Data Pointer", "Synchronous Data Transfer Request",
/* 0x02 */ "SCSI-I Extended Identify", "Wide Data Transfer Request" /* 0x02 */ "SCSI-I Extended Identify", "Wide Data Transfer Request"
}; };
...@@ -1397,7 +1397,7 @@ EXPORT_SYMBOL(scsi_print_command); ...@@ -1397,7 +1397,7 @@ EXPORT_SYMBOL(scsi_print_command);
#ifdef CONFIG_SCSI_CONSTANTS #ifdef CONFIG_SCSI_CONSTANTS
static const char * hostbyte_table[]={ static const char * const hostbyte_table[]={
"DID_OK", "DID_NO_CONNECT", "DID_BUS_BUSY", "DID_TIME_OUT", "DID_BAD_TARGET", "DID_OK", "DID_NO_CONNECT", "DID_BUS_BUSY", "DID_TIME_OUT", "DID_BAD_TARGET",
"DID_ABORT", "DID_PARITY", "DID_ERROR", "DID_RESET", "DID_BAD_INTR", "DID_ABORT", "DID_PARITY", "DID_ERROR", "DID_RESET", "DID_BAD_INTR",
"DID_PASSTHROUGH", "DID_SOFT_ERROR", "DID_IMM_RETRY"}; "DID_PASSTHROUGH", "DID_SOFT_ERROR", "DID_IMM_RETRY"};
...@@ -1422,12 +1422,12 @@ void scsi_print_hostbyte(int scsiresult) ...@@ -1422,12 +1422,12 @@ void scsi_print_hostbyte(int scsiresult)
#ifdef CONFIG_SCSI_CONSTANTS #ifdef CONFIG_SCSI_CONSTANTS
static const char * driverbyte_table[]={ static const char * const driverbyte_table[]={
"DRIVER_OK", "DRIVER_BUSY", "DRIVER_SOFT", "DRIVER_MEDIA", "DRIVER_ERROR", "DRIVER_OK", "DRIVER_BUSY", "DRIVER_SOFT", "DRIVER_MEDIA", "DRIVER_ERROR",
"DRIVER_INVALID", "DRIVER_TIMEOUT", "DRIVER_HARD", "DRIVER_SENSE"}; "DRIVER_INVALID", "DRIVER_TIMEOUT", "DRIVER_HARD", "DRIVER_SENSE"};
#define NUM_DRIVERBYTE_STRS (sizeof(driverbyte_table) / sizeof(const char *)) #define NUM_DRIVERBYTE_STRS (sizeof(driverbyte_table) / sizeof(const char *))
static const char * driversuggest_table[]={"SUGGEST_OK", static const char * const driversuggest_table[]={"SUGGEST_OK",
"SUGGEST_RETRY", "SUGGEST_ABORT", "SUGGEST_REMAP", "SUGGEST_DIE", "SUGGEST_RETRY", "SUGGEST_ABORT", "SUGGEST_REMAP", "SUGGEST_DIE",
"SUGGEST_5", "SUGGEST_6", "SUGGEST_7", "SUGGEST_SENSE"}; "SUGGEST_5", "SUGGEST_6", "SUGGEST_7", "SUGGEST_SENSE"};
#define NUM_SUGGEST_STRS (sizeof(driversuggest_table) / sizeof(const char *)) #define NUM_SUGGEST_STRS (sizeof(driversuggest_table) / sizeof(const char *))
......
...@@ -115,7 +115,7 @@ static DECLARE_TRANSPORT_CLASS(raid_class, ...@@ -115,7 +115,7 @@ static DECLARE_TRANSPORT_CLASS(raid_class,
raid_remove, raid_remove,
NULL); NULL);
static struct { static const struct {
enum raid_state value; enum raid_state value;
char *name; char *name;
} raid_states[] = { } raid_states[] = {
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
#define SCSI_SCAN_TARGET_PRESENT 1 #define SCSI_SCAN_TARGET_PRESENT 1
#define SCSI_SCAN_LUN_PRESENT 2 #define SCSI_SCAN_LUN_PRESENT 2
static char *scsi_null_device_strs = "nullnullnullnull"; static const char *scsi_null_device_strs = "nullnullnullnull";
#define MAX_SCSI_LUNS 512 #define MAX_SCSI_LUNS 512
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "scsi_priv.h" #include "scsi_priv.h"
#include "scsi_logging.h" #include "scsi_logging.h"
static struct { static const struct {
enum scsi_device_state value; enum scsi_device_state value;
char *name; char *name;
} sdev_states[] = { } sdev_states[] = {
...@@ -48,7 +48,7 @@ const char *scsi_device_state_name(enum scsi_device_state state) ...@@ -48,7 +48,7 @@ const char *scsi_device_state_name(enum scsi_device_state state)
return name; return name;
} }
static struct { static const struct {
enum scsi_host_state value; enum scsi_host_state value;
char *name; char *name;
} shost_states[] = { } shost_states[] = {
......
...@@ -111,7 +111,7 @@ fc_enum_name_search(port_state, fc_port_state, fc_port_state_names) ...@@ -111,7 +111,7 @@ fc_enum_name_search(port_state, fc_port_state, fc_port_state_names)
/* Convert fc_tgtid_binding_type values to ascii string name */ /* Convert fc_tgtid_binding_type values to ascii string name */
static struct { static const struct {
enum fc_tgtid_binding_type value; enum fc_tgtid_binding_type value;
char *name; char *name;
int matchlen; int matchlen;
...@@ -149,7 +149,7 @@ get_fc_##title##_names(u32 table_key, char *buf) \ ...@@ -149,7 +149,7 @@ get_fc_##title##_names(u32 table_key, char *buf) \
/* Convert FC_COS bit values to ascii string name */ /* Convert FC_COS bit values to ascii string name */
static struct { static const struct {
u32 value; u32 value;
char *name; char *name;
} fc_cos_names[] = { } fc_cos_names[] = {
...@@ -163,7 +163,7 @@ fc_bitfield_name_search(cos, fc_cos_names) ...@@ -163,7 +163,7 @@ fc_bitfield_name_search(cos, fc_cos_names)
/* Convert FC_PORTSPEED bit values to ascii string name */ /* Convert FC_PORTSPEED bit values to ascii string name */
static struct { static const struct {
u32 value; u32 value;
char *name; char *name;
} fc_port_speed_names[] = { } fc_port_speed_names[] = {
...@@ -189,7 +189,7 @@ show_fc_fc4s (char *buf, u8 *fc4_list) ...@@ -189,7 +189,7 @@ show_fc_fc4s (char *buf, u8 *fc4_list)
/* Convert FC_RPORT_ROLE bit values to ascii string name */ /* Convert FC_RPORT_ROLE bit values to ascii string name */
static struct { static const struct {
u32 value; u32 value;
char *name; char *name;
} fc_remote_port_role_names[] = { } fc_remote_port_role_names[] = {
......
...@@ -730,7 +730,7 @@ static void get_capabilities(struct scsi_cd *cd) ...@@ -730,7 +730,7 @@ static void get_capabilities(struct scsi_cd *cd)
unsigned int the_result; unsigned int the_result;
int retries, rc, n; int retries, rc, n;
static char *loadmech[] = static const char *loadmech[] =
{ {
"caddy", "caddy",
"tray", "tray",
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support
*/ */
static char *verstr = "20050830"; static const char *verstr = "20050830";
#include <linux/module.h> #include <linux/module.h>
...@@ -134,7 +134,7 @@ static struct st_dev_parm { ...@@ -134,7 +134,7 @@ static struct st_dev_parm {
#endif #endif
/* Bit reversed order to get same names for same minors with all /* Bit reversed order to get same names for same minors with all
mode counts */ mode counts */
static char *st_formats[] = { static const char *st_formats[] = {
"", "r", "k", "s", "l", "t", "o", "u", "", "r", "k", "s", "l", "t", "o", "u",
"m", "v", "p", "x", "a", "y", "q", "z"}; "m", "v", "p", "x", "a", "y", "q", "z"};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册