diff mbox

net-next build failure due to 16e5cc64?

Message ID CAM_iQpXDo5Lh+MF7yds3vDyn7D-aqKH3-9kmVYZ924QkAw=imA@mail.gmail.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Cong Wang March 1, 2016, 6:51 p.m. UTC
On Tue, Mar 1, 2016 at 10:41 AM, Sowmini Varadhan
<sowmini.varadhan@oracle.com> wrote:
> On (03/01/16 10:23), Cong Wang wrote:
>> > The compiler error is for fields within the union which lacks
>> > both a tag and a union-name.  So I'm not sure how the above will
>> > help.
>> >
>>
>> Come on.. we have plenty of such anonymous unions in skbuff.h...
>
> I realize that, even netdevice.h itself has other instances.
> Thus I dont understand why this one generated a compiler error
> for me.  Thus I was wondering why others had not run into this
> and not suggesting it should be patched.
>
> However, changing the way we set up type etc. doesnt seem relevant
> to what the compiler is flagging.
>

Clearly the compiler indicates something is wrong in the initializer.

I don't know why you don't want to try the way I suggest or maybe
the following:

                err = dev->netdev_ops->ndo_setup_tc(dev, sch->handle, 0, &tc);

Comments

Sowmini Varadhan March 1, 2016, 7:09 p.m. UTC | #1
On (03/01/16 10:51), Cong Wang wrote:
> --- a/net/sched/sch_mqprio.c
> +++ b/net/sched/sch_mqprio.c
> @@ -142,7 +142,7 @@ static int mqprio_init(struct Qdisc *sch, struct
> nlattr *opt)
>          */
>         if (qopt->hw) {
>                 struct tc_to_netdev tc = {.type = TC_SETUP_MQPRIO,
> -                                         .tc = qopt->num_tc};
> +                                         {.tc = qopt->num_tc} };
> 

this fix works.

The first suggestion had no effect (needs changes to a lot of files
I suspect).

BTW, I remain surprised that no one else has noticed this. It did not
take me any effort to reproduce it on an x86.

--Sowmini
Cong Wang March 1, 2016, 7:29 p.m. UTC | #2
On Tue, Mar 1, 2016 at 11:09 AM, Sowmini Varadhan
<sowmini.varadhan@oracle.com> wrote:
> On (03/01/16 10:51), Cong Wang wrote:
>> --- a/net/sched/sch_mqprio.c
>> +++ b/net/sched/sch_mqprio.c
>> @@ -142,7 +142,7 @@ static int mqprio_init(struct Qdisc *sch, struct
>> nlattr *opt)
>>          */
>>         if (qopt->hw) {
>>                 struct tc_to_netdev tc = {.type = TC_SETUP_MQPRIO,
>> -                                         .tc = qopt->num_tc};
>> +                                         {.tc = qopt->num_tc} };
>>
>
> this fix works.
>
> The first suggestion had no effect (needs changes to a lot of files
> I suspect).
>

It must work, you just didn't try it hard.

> BTW, I remain surprised that no one else has noticed this. It did not
> take me any effort to reproduce it on an x86.

I think that is probably because most people use newer gcc, at least
I don't see any compile error with gcc 4.9.2.
diff mbox

Patch

diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
index f9947d1..77743e8 100644
--- a/net/sched/sch_mqprio.c
+++ b/net/sched/sch_mqprio.c
@@ -142,7 +142,7 @@  static int mqprio_init(struct Qdisc *sch, struct
nlattr *opt)
         */
        if (qopt->hw) {
                struct tc_to_netdev tc = {.type = TC_SETUP_MQPRIO,
-                                         .tc = qopt->num_tc};
+                                         {.tc = qopt->num_tc} };

                priv->hw_owned = 1;