<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.apple-tab-span
{mso-style-name:apple-tab-span;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">IIRC, zero sized arrays are not technically allowed in C, although gcc allows them. As I said, some versions of gcc worked, others didn't. I'm not sure why.
Also, my example was slightly wrong. atombios.h uses arrays of size 1, not 0. So my example should look like:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">struct table {<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"> uint16_t size;<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"> struct element elements[1];<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">};<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">atombios.h uses [1] since I don't think [0] is portable. The same indexing issue applies to [1].<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Alex<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org]
<b>On Behalf Of </b>StDenis, Tom<br>
<b>Sent:</b> Thursday, August 18, 2016 11:40 AM<br>
<b>To:</b> Alex Deucher<br>
<b>Cc:</b> Christian König; amd-gfx list<br>
<b>Subject:</b> Re: tidy'ing up cz_hwmgr.c<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="divtagdefaultwrapper">
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">It had to be something more complicated because this demo program<o:p></o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">#include <stdio.h></span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">#include <stdlib.h></span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">struct one {</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">char *foo;</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">int bar[0];</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">};</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">struct two {</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">char *foo;</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">int bar[1];</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">};</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">int main(void)</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">{</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">struct one *a = calloc(1, sizeof(struct one) + 4 * sizeof(int));</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">struct two *b = calloc(1, sizeof(struct two) + 3 * sizeof(int));</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">int x;</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">printf("a == %p\n", a);</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">for (x = 0; x < 4; x++)</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">printf("&a.bar[%d] = %p\n", x, &a->bar[x]);</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">printf("b == %p\n", b);</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">for (x = 0; x < 4; x++)</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">printf("&b.bar[%d] = %p\n", x, &b->bar[x]);</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">return 0;</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">}</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">produces this output<o:p></o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">tom@fx8:~$ gcc test.c -o test</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">tom@fx8:~$ ./test</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">a == 0x1fd4010</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">&a.bar[0] = 0x1fd4018</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">&a.bar[1] = 0x1fd401c</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">&a.bar[2] = 0x1fd4020</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">&a.bar[3] = 0x1fd4024</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">b == 0x1fd4030</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">&b.bar[0] = 0x1fd4038</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">&b.bar[1] = 0x1fd403c</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">&b.bar[2] = 0x1fd4040</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">&b.bar[3] = 0x1fd4044</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Which is exactly what you'd expect. I'm not strongly advocating we change the PP code just noting it's not really clear that it's correct from a first
reading and in theory would be better with [0]. <o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Calibri","sans-serif";color:black">Tom<o:p></o:p></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center;background:white">
<span style="font-family:"Calibri","sans-serif";color:black">
<hr size="2" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p class="MsoNormal" style="background:white"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black"> Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>><br>
<b>Sent:</b> Thursday, August 18, 2016 11:33<br>
<b>To:</b> StDenis, Tom<br>
<b>Cc:</b> Christian König; amd-gfx list<br>
<b>Subject:</b> Re: tidy'ing up cz_hwmgr.c</span><span style="font-family:"Calibri","sans-serif";color:black">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Calibri","sans-serif";color:black">The problem we ran into was when we had a struct like this:<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">struct table {<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"> uint16_t size;<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"> struct element elements[0];<o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">};<o:p></o:p></span></p>
<div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Calibri","sans-serif";color:black">and then we would try and index the array:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">for (i = 0; i < table->size; i++) {<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"> element = &table->elements[i];<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Calibri","sans-serif";color:black">}<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">element ended up off in the weeds. The only thing that seems to make some versions of gcc happy was pointer arithmetic. E.g.,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Calibri","sans-serif";color:black">element = (struct element *)((char *)&table->elements[0] + (sizeof(struct element) * i));<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Alex<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">On Thu, Aug 18, 2016 at 11:21 AM, StDenis, Tom <<a href="mailto:Tom.StDenis@amd.com" target="_blank">Tom.StDenis@amd.com</a>> wrote:<o:p></o:p></span></p>
<div>
<div>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Any modern GCC should support [0] at the tail of a struct. This came up because when I was reading the code I saw they allocated 7 slots (plus the size of the struct)
but then fill 8 slots. It's just weird <img border="0" width="19" height="19" id="_x0000_i1026" src="cid:image001.png@01D1F946.4668DF40" alt="😊"><o:p></o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Using [0] in the struct and allocating for 8 entries makes more sense and is clearer to read.<o:p></o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Tom<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center;background:white">
<span style="font-family:"Calibri","sans-serif";color:black">
<hr size="2" width="98%" align="center">
</span></div>
<div>
<p class="MsoNormal" style="background:white"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black"> Christian König <<a href="mailto:deathsimple@vodafone.de" target="_blank">deathsimple@vodafone.de</a>><br>
<b>Sent:</b> Thursday, August 18, 2016 11:17<br>
<b>To:</b> StDenis, Tom; amd-gfx list<br>
<b>Subject:</b> Re: tidy'ing up cz_hwmgr.c</span><span style="font-family:"Calibri","sans-serif";color:black">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<div>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Has a [1] array at the tail which is then kzalloc'ed with N-1 entries. Shouldn't that just be a [0] with N entries allocated for clarity?<o:p></o:p></span></p>
</div>
</blockquote>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Actually the starting address of a dynamic array should be manually calculated instead of using [1] or [0].<br>
<br>
We had tons of problems with that because some gcc versions get this wrong and the atombios code used this as well.<br>
<br>
Alex how did we resolved such issues?<br>
<br>
Regards,<br>
Christian.<br>
<br>
Am 18.08.2016 um 16:26 schrieb StDenis, Tom:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Tidying up cz_hwmgr.c I noted a couple of things but first is <o:p></o:p></span></p>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">static bool cz_dpm_check_smu_features(struct pp_hwmgr *hwmgr,</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">unsigned long check_feature);</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Which will return "true" if the smu call fails
<b>or</b> the feature is set. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">The structure <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Courier New";color:black">struct phm_clock_voltage_dependency_table;</span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Has a [1] array at the tail which is then kzalloc'ed with N-1 entries. Shouldn't that just be a [0] with N entries allocated for clarity?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black">Tom<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><br>
<br>
<o:p></o:p></span></p>
<pre style="background:white"><span style="color:black">_______________________________________________<o:p></o:p></span></pre>
<pre style="background:white"><span style="color:black">amd-gfx mailing list<o:p></o:p></span></pre>
<pre style="background:white"><span style="color:black"><a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><o:p></o:p></span></pre>
<pre style="background:white"><span style="color:black"><a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" target="_blank">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><o:p></o:p></span></pre>
</blockquote>
<p style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Calibri","sans-serif";color:black"><br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" target="_blank">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>