5858 * These descriptors remove the combined Y axis and instead report
5959 * separate throttle (Y) and brake (RZ).
6060 */
61- static __u8 df_rdesc_fixed [] = {
61+ static const __u8 df_rdesc_fixed [] = {
62620x05 , 0x01 , /* Usage Page (Desktop), */
63630x09 , 0x04 , /* Usage (Joystick), */
64640xA1 , 0x01 , /* Collection (Application), */
@@ -124,7 +124,7 @@ static __u8 df_rdesc_fixed[] = {
1241240xC0 /* End Collection */
125125};
126126
127- static __u8 dfp_rdesc_fixed [] = {
127+ static const __u8 dfp_rdesc_fixed [] = {
1281280x05 , 0x01 , /* Usage Page (Desktop), */
1291290x09 , 0x04 , /* Usage (Joystick), */
1301300xA1 , 0x01 , /* Collection (Application), */
@@ -172,7 +172,7 @@ static __u8 dfp_rdesc_fixed[] = {
1721720xC0 /* End Collection */
173173};
174174
175- static __u8 fv_rdesc_fixed [] = {
175+ static const __u8 fv_rdesc_fixed [] = {
1761760x05 , 0x01 , /* Usage Page (Desktop), */
1771770x09 , 0x04 , /* Usage (Joystick), */
1781780xA1 , 0x01 , /* Collection (Application), */
@@ -239,7 +239,7 @@ static __u8 fv_rdesc_fixed[] = {
2392390xC0 /* End Collection */
240240};
241241
242- static __u8 momo_rdesc_fixed [] = {
242+ static const __u8 momo_rdesc_fixed [] = {
2432430x05 , 0x01 , /* Usage Page (Desktop), */
2442440x09 , 0x04 , /* Usage (Joystick), */
2452450xA1 , 0x01 , /* Collection (Application), */
@@ -285,7 +285,7 @@ static __u8 momo_rdesc_fixed[] = {
2852850xC0 /* End Collection */
286286};
287287
288- static __u8 momo2_rdesc_fixed [] = {
288+ static const __u8 momo2_rdesc_fixed [] = {
2892890x05 , 0x01 , /* Usage Page (Desktop), */
2902900x09 , 0x04 , /* Usage (Joystick), */
2912910xA1 , 0x01 , /* Collection (Application), */
@@ -333,7 +333,7 @@ static __u8 momo2_rdesc_fixed[] = {
3333330xC0 /* End Collection */
334334};
335335
336- static __u8 ffg_rdesc_fixed [] = {
336+ static const __u8 ffg_rdesc_fixed [] = {
3373370x05 , 0x01 , /* Usage Page (Desktop), */
3383380x09 , 0x04 , /* Usage (Joystik), */
3393390xA1 , 0x01 , /* Collection (Application), */
@@ -379,7 +379,7 @@ static __u8 ffg_rdesc_fixed[] = {
3793790xC0 /* End Collection */
380380};
381381
382- static __u8 fg_rdesc_fixed [] = {
382+ static const __u8 fg_rdesc_fixed [] = {
3833830x05 , 0x01 , /* Usage Page (Desktop), */
3843840x09 , 0x04 , /* Usage (Joystik), */
3853850xA1 , 0x01 , /* Collection (Application), */
@@ -453,8 +453,8 @@ static const __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
453453 if (* rsize == FG_RDESC_ORIG_SIZE ) {
454454 hid_info (hdev ,
455455 "fixing up Logitech Wingman Formula GP report descriptor\n" );
456- rdesc = fg_rdesc_fixed ;
457456 * rsize = sizeof (fg_rdesc_fixed );
457+ return fg_rdesc_fixed ;
458458 } else {
459459 hid_info (hdev ,
460460 "rdesc size test failed for formula gp\n" );
@@ -466,8 +466,8 @@ static const __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
466466 if (* rsize == FFG_RDESC_ORIG_SIZE ) {
467467 hid_info (hdev ,
468468 "fixing up Logitech Wingman Formula Force GP report descriptor\n" );
469- rdesc = ffg_rdesc_fixed ;
470469 * rsize = sizeof (ffg_rdesc_fixed );
470+ return ffg_rdesc_fixed ;
471471 }
472472 break ;
473473
@@ -476,44 +476,44 @@ static const __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
476476 if (* rsize == DF_RDESC_ORIG_SIZE ) {
477477 hid_info (hdev ,
478478 "fixing up Logitech Driving Force report descriptor\n" );
479- rdesc = df_rdesc_fixed ;
480479 * rsize = sizeof (df_rdesc_fixed );
480+ return df_rdesc_fixed ;
481481 }
482482 break ;
483483
484484 case USB_DEVICE_ID_LOGITECH_MOMO_WHEEL :
485485 if (* rsize == MOMO_RDESC_ORIG_SIZE ) {
486486 hid_info (hdev ,
487487 "fixing up Logitech Momo Force (Red) report descriptor\n" );
488- rdesc = momo_rdesc_fixed ;
489488 * rsize = sizeof (momo_rdesc_fixed );
489+ return momo_rdesc_fixed ;
490490 }
491491 break ;
492492
493493 case USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2 :
494494 if (* rsize == MOMO2_RDESC_ORIG_SIZE ) {
495495 hid_info (hdev ,
496496 "fixing up Logitech Momo Racing Force (Black) report descriptor\n" );
497- rdesc = momo2_rdesc_fixed ;
498497 * rsize = sizeof (momo2_rdesc_fixed );
498+ return momo2_rdesc_fixed ;
499499 }
500500 break ;
501501
502502 case USB_DEVICE_ID_LOGITECH_VIBRATION_WHEEL :
503503 if (* rsize == FV_RDESC_ORIG_SIZE ) {
504504 hid_info (hdev ,
505505 "fixing up Logitech Formula Vibration report descriptor\n" );
506- rdesc = fv_rdesc_fixed ;
507506 * rsize = sizeof (fv_rdesc_fixed );
507+ return fv_rdesc_fixed ;
508508 }
509509 break ;
510510
511511 case USB_DEVICE_ID_LOGITECH_DFP_WHEEL :
512512 if (* rsize == DFP_RDESC_ORIG_SIZE ) {
513513 hid_info (hdev ,
514514 "fixing up Logitech Driving Force Pro report descriptor\n" );
515- rdesc = dfp_rdesc_fixed ;
516515 * rsize = sizeof (dfp_rdesc_fixed );
516+ return dfp_rdesc_fixed ;
517517 }
518518 break ;
519519
0 commit comments