File tree Expand file tree Collapse file tree
drivers/gpu/drm/amd/display/dc/resource Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -650,9 +650,6 @@ static struct link_encoder *dce100_link_encoder_create(
650650 return & enc110 -> base ;
651651 }
652652
653- if (enc_init_data -> hpd_source >= ARRAY_SIZE (link_enc_hpd_regs ))
654- return NULL ;
655-
656653 link_regs_id =
657654 map_transmitter_id_to_phy_instance (enc_init_data -> transmitter );
658655
@@ -661,7 +658,8 @@ static struct link_encoder *dce100_link_encoder_create(
661658 & link_enc_feature ,
662659 & link_enc_regs [link_regs_id ],
663660 & link_enc_aux_regs [enc_init_data -> channel - 1 ],
664- & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
661+ enc_init_data -> hpd_source >= ARRAY_SIZE (link_enc_hpd_regs ) ?
662+ NULL : & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
665663 return & enc110 -> base ;
666664}
667665
Original file line number Diff line number Diff line change @@ -671,7 +671,7 @@ static struct link_encoder *dce110_link_encoder_create(
671671 kzalloc_obj (struct dce110_link_encoder );
672672 int link_regs_id ;
673673
674- if (!enc110 || enc_init_data -> hpd_source >= ARRAY_SIZE ( link_enc_hpd_regs ) )
674+ if (!enc110 )
675675 return NULL ;
676676
677677 link_regs_id =
@@ -682,7 +682,8 @@ static struct link_encoder *dce110_link_encoder_create(
682682 & link_enc_feature ,
683683 & link_enc_regs [link_regs_id ],
684684 & link_enc_aux_regs [enc_init_data -> channel - 1 ],
685- & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
685+ enc_init_data -> hpd_source >= ARRAY_SIZE (link_enc_hpd_regs ) ?
686+ NULL : & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
686687 return & enc110 -> base ;
687688}
688689
Original file line number Diff line number Diff line change @@ -632,7 +632,7 @@ static struct link_encoder *dce112_link_encoder_create(
632632 kzalloc_obj (struct dce110_link_encoder );
633633 int link_regs_id ;
634634
635- if (!enc110 || enc_init_data -> hpd_source >= ARRAY_SIZE ( link_enc_hpd_regs ) )
635+ if (!enc110 )
636636 return NULL ;
637637
638638 link_regs_id =
@@ -643,7 +643,8 @@ static struct link_encoder *dce112_link_encoder_create(
643643 & link_enc_feature ,
644644 & link_enc_regs [link_regs_id ],
645645 & link_enc_aux_regs [enc_init_data -> channel - 1 ],
646- & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
646+ enc_init_data -> hpd_source >= ARRAY_SIZE (link_enc_hpd_regs ) ?
647+ NULL : & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
647648 return & enc110 -> base ;
648649}
649650
Original file line number Diff line number Diff line change @@ -716,7 +716,7 @@ static struct link_encoder *dce120_link_encoder_create(
716716 kzalloc_obj (struct dce110_link_encoder );
717717 int link_regs_id ;
718718
719- if (!enc110 || enc_init_data -> hpd_source >= ARRAY_SIZE ( link_enc_hpd_regs ) )
719+ if (!enc110 )
720720 return NULL ;
721721
722722 link_regs_id =
@@ -727,7 +727,8 @@ static struct link_encoder *dce120_link_encoder_create(
727727 & link_enc_feature ,
728728 & link_enc_regs [link_regs_id ],
729729 & link_enc_aux_regs [enc_init_data -> channel - 1 ],
730- & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
730+ enc_init_data -> hpd_source >= ARRAY_SIZE (link_enc_hpd_regs ) ?
731+ NULL : & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
731732
732733 return & enc110 -> base ;
733734}
Original file line number Diff line number Diff line change @@ -746,18 +746,16 @@ static struct link_encoder *dce60_link_encoder_create(
746746 return & enc110 -> base ;
747747 }
748748
749- if (enc_init_data -> hpd_source >= ARRAY_SIZE (link_enc_hpd_regs ))
750- return NULL ;
751-
752749 link_regs_id =
753750 map_transmitter_id_to_phy_instance (enc_init_data -> transmitter );
754751
755752 dce60_link_encoder_construct (enc110 ,
756- enc_init_data ,
757- & link_enc_feature ,
758- & link_enc_regs [link_regs_id ],
759- & link_enc_aux_regs [enc_init_data -> channel - 1 ],
760- & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
753+ enc_init_data ,
754+ & link_enc_feature ,
755+ & link_enc_regs [link_regs_id ],
756+ & link_enc_aux_regs [enc_init_data -> channel - 1 ],
757+ enc_init_data -> hpd_source >= ARRAY_SIZE (link_enc_hpd_regs ) ?
758+ NULL : & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
761759 return & enc110 -> base ;
762760}
763761
Original file line number Diff line number Diff line change @@ -752,9 +752,6 @@ static struct link_encoder *dce80_link_encoder_create(
752752 return & enc110 -> base ;
753753 }
754754
755- if (enc_init_data -> hpd_source >= ARRAY_SIZE (link_enc_hpd_regs ))
756- return NULL ;
757-
758755 link_regs_id =
759756 map_transmitter_id_to_phy_instance (enc_init_data -> transmitter );
760757
@@ -763,7 +760,8 @@ static struct link_encoder *dce80_link_encoder_create(
763760 & link_enc_feature ,
764761 & link_enc_regs [link_regs_id ],
765762 & link_enc_aux_regs [enc_init_data -> channel - 1 ],
766- & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
763+ enc_init_data -> hpd_source >= ARRAY_SIZE (link_enc_hpd_regs ) ?
764+ NULL : & link_enc_hpd_regs [enc_init_data -> hpd_source ]);
767765 return & enc110 -> base ;
768766}
769767
You can’t perform that action at this time.
0 commit comments