@@ -2674,8 +2674,10 @@ static int resp_rsup_tmfs(struct scsi_cmnd *scp,
2674
2674
2675
2675
static int resp_err_recov_pg (unsigned char * p , int pcontrol , int target )
2676
2676
{ /* Read-Write Error Recovery page for mode_sense */
2677
- unsigned char err_recov_pg [] = {0x1 , 0xa , 0xc0 , 11 , 240 , 0 , 0 , 0 ,
2678
- 5 , 0 , 0xff , 0xff };
2677
+ static const unsigned char err_recov_pg [] = {
2678
+ 0x1 , 0xa , 0xc0 , 11 , 240 , 0 , 0 , 0 ,
2679
+ 5 , 0 , 0xff , 0xff
2680
+ };
2679
2681
2680
2682
memcpy (p , err_recov_pg , sizeof (err_recov_pg ));
2681
2683
if (1 == pcontrol )
@@ -2685,8 +2687,10 @@ static int resp_err_recov_pg(unsigned char *p, int pcontrol, int target)
2685
2687
2686
2688
static int resp_disconnect_pg (unsigned char * p , int pcontrol , int target )
2687
2689
{ /* Disconnect-Reconnect page for mode_sense */
2688
- unsigned char disconnect_pg [] = {0x2 , 0xe , 128 , 128 , 0 , 10 , 0 , 0 ,
2689
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
2690
+ static const unsigned char disconnect_pg [] = {
2691
+ 0x2 , 0xe , 128 , 128 , 0 , 10 , 0 , 0 ,
2692
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
2693
+ };
2690
2694
2691
2695
memcpy (p , disconnect_pg , sizeof (disconnect_pg ));
2692
2696
if (1 == pcontrol )
@@ -2696,9 +2700,11 @@ static int resp_disconnect_pg(unsigned char *p, int pcontrol, int target)
2696
2700
2697
2701
static int resp_format_pg (unsigned char * p , int pcontrol , int target )
2698
2702
{ /* Format device page for mode_sense */
2699
- unsigned char format_pg [] = {0x3 , 0x16 , 0 , 0 , 0 , 0 , 0 , 0 ,
2700
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
2701
- 0 , 0 , 0 , 0 , 0x40 , 0 , 0 , 0 };
2703
+ static const unsigned char format_pg [] = {
2704
+ 0x3 , 0x16 , 0 , 0 , 0 , 0 , 0 , 0 ,
2705
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
2706
+ 0 , 0 , 0 , 0 , 0x40 , 0 , 0 , 0
2707
+ };
2702
2708
2703
2709
memcpy (p , format_pg , sizeof (format_pg ));
2704
2710
put_unaligned_be16 (sdebug_sectors_per , p + 10 );
@@ -2716,10 +2722,14 @@ static unsigned char caching_pg[] = {0x8, 18, 0x14, 0, 0xff, 0xff, 0, 0,
2716
2722
2717
2723
static int resp_caching_pg (unsigned char * p , int pcontrol , int target )
2718
2724
{ /* Caching page for mode_sense */
2719
- unsigned char ch_caching_pg [] = {/* 0x8, 18, */ 0x4 , 0 , 0 , 0 , 0 , 0 ,
2720
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };
2721
- unsigned char d_caching_pg [] = {0x8 , 18 , 0x14 , 0 , 0xff , 0xff , 0 , 0 ,
2722
- 0xff , 0xff , 0xff , 0xff , 0x80 , 0x14 , 0 , 0 , 0 , 0 , 0 , 0 };
2725
+ static const unsigned char ch_caching_pg [] = {
2726
+ /* 0x8, 18, */ 0x4 , 0 , 0 , 0 , 0 , 0 ,
2727
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
2728
+ };
2729
+ static const unsigned char d_caching_pg [] = {
2730
+ 0x8 , 18 , 0x14 , 0 , 0xff , 0xff , 0 , 0 ,
2731
+ 0xff , 0xff , 0xff , 0xff , 0x80 , 0x14 , 0 , 0 , 0 , 0 , 0 , 0
2732
+ };
2723
2733
2724
2734
if (SDEBUG_OPT_N_WCE & sdebug_opts )
2725
2735
caching_pg [2 ] &= ~0x4 ; /* set WCE=0 (default WCE=1) */
@@ -2738,8 +2748,10 @@ static int resp_ctrl_m_pg(unsigned char *p, int pcontrol, int target)
2738
2748
{ /* Control mode page for mode_sense */
2739
2749
unsigned char ch_ctrl_m_pg [] = {/* 0xa, 10, */ 0x6 , 0 , 0 , 0 , 0 , 0 ,
2740
2750
0 , 0 , 0 , 0 };
2741
- unsigned char d_ctrl_m_pg [] = {0xa , 10 , 2 , 0 , 0 , 0 , 0 , 0 ,
2742
- 0 , 0 , 0x2 , 0x4b };
2751
+ static const unsigned char d_ctrl_m_pg [] = {
2752
+ 0xa , 10 , 2 , 0 , 0 , 0 , 0 , 0 ,
2753
+ 0 , 0 , 0x2 , 0x4b
2754
+ };
2743
2755
2744
2756
if (sdebug_dsense )
2745
2757
ctrl_m_pg [2 ] |= 0x4 ;
@@ -2794,10 +2806,14 @@ static int resp_grouping_m_pg(unsigned char *p, int pcontrol, int target)
2794
2806
2795
2807
static int resp_iec_m_pg (unsigned char * p , int pcontrol , int target )
2796
2808
{ /* Informational Exceptions control mode page for mode_sense */
2797
- unsigned char ch_iec_m_pg [] = {/* 0x1c, 0xa, */ 0x4 , 0xf , 0 , 0 , 0 , 0 ,
2798
- 0 , 0 , 0x0 , 0x0 };
2799
- unsigned char d_iec_m_pg [] = {0x1c , 0xa , 0x08 , 0 , 0 , 0 , 0 , 0 ,
2800
- 0 , 0 , 0x0 , 0x0 };
2809
+ static const unsigned char ch_iec_m_pg [] = {
2810
+ /* 0x1c, 0xa, */ 0x4 , 0xf , 0 , 0 , 0 , 0 ,
2811
+ 0 , 0 , 0x0 , 0x0
2812
+ };
2813
+ static const unsigned char d_iec_m_pg [] = {
2814
+ 0x1c , 0xa , 0x08 , 0 , 0 , 0 , 0 , 0 ,
2815
+ 0 , 0 , 0x0 , 0x0
2816
+ };
2801
2817
2802
2818
memcpy (p , iec_m_pg , sizeof (iec_m_pg ));
2803
2819
if (1 == pcontrol )
@@ -2809,8 +2825,9 @@ static int resp_iec_m_pg(unsigned char *p, int pcontrol, int target)
2809
2825
2810
2826
static int resp_sas_sf_m_pg (unsigned char * p , int pcontrol , int target )
2811
2827
{ /* SAS SSP mode page - short format for mode_sense */
2812
- unsigned char sas_sf_m_pg [] = {0x19 , 0x6 ,
2813
- 0x6 , 0x0 , 0x7 , 0xd0 , 0x0 , 0x0 };
2828
+ static const unsigned char sas_sf_m_pg [] = {
2829
+ 0x19 , 0x6 , 0x6 , 0x0 , 0x7 , 0xd0 , 0x0 , 0x0
2830
+ };
2814
2831
2815
2832
memcpy (p , sas_sf_m_pg , sizeof (sas_sf_m_pg ));
2816
2833
if (1 == pcontrol )
@@ -2854,9 +2871,10 @@ static int resp_sas_pcd_m_spg(unsigned char *p, int pcontrol, int target,
2854
2871
2855
2872
static int resp_sas_sha_m_spg (unsigned char * p , int pcontrol )
2856
2873
{ /* SAS SSP shared protocol specific port mode subpage */
2857
- unsigned char sas_sha_m_pg [] = {0x59 , 0x2 , 0 , 0xc , 0 , 0x6 , 0x10 , 0 ,
2858
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
2859
- };
2874
+ static const unsigned char sas_sha_m_pg [] = {
2875
+ 0x59 , 0x2 , 0 , 0xc , 0 , 0x6 , 0x10 , 0 ,
2876
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
2877
+ };
2860
2878
2861
2879
memcpy (p , sas_sha_m_pg , sizeof (sas_sha_m_pg ));
2862
2880
if (1 == pcontrol )
@@ -2923,8 +2941,10 @@ static int process_medium_part_m_pg(struct sdebug_dev_info *devip,
2923
2941
static int resp_compression_m_pg (unsigned char * p , int pcontrol , int target ,
2924
2942
unsigned char dce )
2925
2943
{ /* Compression page for mode_sense (tape) */
2926
- unsigned char compression_pg [] = {0x0f , 14 , 0x40 , 0 , 0 , 0 , 0 , 0 ,
2927
- 0 , 0 , 0 , 0 , 00 , 00 };
2944
+ static const unsigned char compression_pg [] = {
2945
+ 0x0f , 14 , 0x40 , 0 , 0 , 0 , 0 , 0 ,
2946
+ 0 , 0 , 0 , 0 , 0 , 0
2947
+ };
2928
2948
2929
2949
memcpy (p , compression_pg , sizeof (compression_pg ));
2930
2950
if (dce )
@@ -3282,18 +3302,20 @@ static int resp_mode_select(struct scsi_cmnd *scp,
3282
3302
3283
3303
static int resp_temp_l_pg (unsigned char * arr )
3284
3304
{
3285
- unsigned char temp_l_pg [] = {0x0 , 0x0 , 0x3 , 0x2 , 0x0 , 38 ,
3286
- 0x0 , 0x1 , 0x3 , 0x2 , 0x0 , 65 ,
3287
- };
3305
+ static const unsigned char temp_l_pg [] = {
3306
+ 0x0 , 0x0 , 0x3 , 0x2 , 0x0 , 38 ,
3307
+ 0x0 , 0x1 , 0x3 , 0x2 , 0x0 , 65 ,
3308
+ };
3288
3309
3289
3310
memcpy (arr , temp_l_pg , sizeof (temp_l_pg ));
3290
3311
return sizeof (temp_l_pg );
3291
3312
}
3292
3313
3293
3314
static int resp_ie_l_pg (unsigned char * arr )
3294
3315
{
3295
- unsigned char ie_l_pg [] = {0x0 , 0x0 , 0x3 , 0x3 , 0x0 , 0x0 , 38 ,
3296
- };
3316
+ static const unsigned char ie_l_pg [] = {
3317
+ 0x0 , 0x0 , 0x3 , 0x3 , 0x0 , 0x0 , 38 ,
3318
+ };
3297
3319
3298
3320
memcpy (arr , ie_l_pg , sizeof (ie_l_pg ));
3299
3321
if (iec_m_pg [2 ] & 0x4 ) { /* TEST bit set */
@@ -3305,11 +3327,12 @@ static int resp_ie_l_pg(unsigned char *arr)
3305
3327
3306
3328
static int resp_env_rep_l_spg (unsigned char * arr )
3307
3329
{
3308
- unsigned char env_rep_l_spg [] = {0x0 , 0x0 , 0x23 , 0x8 ,
3309
- 0x0 , 40 , 72 , 0xff , 45 , 18 , 0 , 0 ,
3310
- 0x1 , 0x0 , 0x23 , 0x8 ,
3311
- 0x0 , 55 , 72 , 35 , 55 , 45 , 0 , 0 ,
3312
- };
3330
+ static const unsigned char env_rep_l_spg [] = {
3331
+ 0x0 , 0x0 , 0x23 , 0x8 ,
3332
+ 0x0 , 40 , 72 , 0xff , 45 , 18 , 0 , 0 ,
3333
+ 0x1 , 0x0 , 0x23 , 0x8 ,
3334
+ 0x0 , 55 , 72 , 35 , 55 , 45 , 0 , 0 ,
3335
+ };
3313
3336
3314
3337
memcpy (arr , env_rep_l_spg , sizeof (env_rep_l_spg ));
3315
3338
return sizeof (env_rep_l_spg );
0 commit comments