[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0835B3720019904CB8F7AA43166CEEB2F18F4F92@RTITMBSVM03.realtek.com.tw>
Date: Tue, 5 Nov 2019 11:48:04 +0000
From: Hayes Wang <hayeswang@...ltek.com>
To: Kai-Heng Feng <kai.heng.feng@...onical.com>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"oliver@...kum.org" <oliver@...kum.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] r8152: Add macpassthru support for ThinkPad Thunderbolt 3 Dock Gen 2
Kai-Heng Feng [mailto:kai.heng.feng@...onical.com]
> Sent: Tuesday, November 05, 2019 7:18 PM
[...]
> >> } else {
> >> - /* test for RTL8153-BND and RTL8153-BD */
> >> - ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1);
> >> - if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK) == 0) {
> >> - netif_dbg(tp, probe, tp->netdev,
> >> - "Invalid variant for MAC pass through\n");
> >> - return -ENODEV;
> >> + bypass_test = false;
> >> + mac_obj_name = "\\_SB.AMAC";
> >> + mac_obj_type = ACPI_TYPE_BUFFER;
> >> + mac_strlen = 0x17;
> >> + }
> >> +
> >> + if (!bypass_test) {
> >
> > Maybe you could combine this with the "else" above.
> > Then, the variable "bypass_test" could be removed.
>
> Ok, will do in V3.
>
> > And the declaration of "ocp_data" could be moved after the "else".
>
> Isn't putting declarations at the top of the function the preferred way?
I mean the ocp_data wouldn't be used out of the else,
so you could move the declaration to the inside of the else.
However, I don't think you have to send another patch for this.
Thanks.
Best Regards,
Hayes
Powered by blists - more mailing lists