From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
balbi@kernel.org, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
kishon@ti.com, hminas@synopsys.com,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 8/8] usb: dwc3: Add Amlogic G12A DWC3 glue
Date: Mon, 11 Mar 2019 22:19:00 +0100 [thread overview]
Message-ID: <CAFBinCAUMNBeTABNeyOiYu9Gu8zWWmG3dBNJwFpop3QNp6ZG0g@mail.gmail.com> (raw)
In-Reply-To: <6eaff413-d2c7-125a-f165-e4226c7a153e@baylibre.com>
On Thu, Mar 7, 2019 at 10:46 AM Neil Armstrong <narmstrong@baylibre.com> wrote:
[...]
> >> + /* Setup role switcher */
> >> + priv->switch_desc.usb2_port = dwc3_meson_g12_find_child(dev,
> >> + "snps,dwc3");
> >> + priv->switch_desc.udc = dwc3_meson_g12_find_child(dev, "snps,dwc2");
> >> + priv->switch_desc.allow_userspace_control = true;
> >> + priv->switch_desc.set = dwc3_meson_g12a_role_set;
> >> + priv->switch_desc.get = dwc3_meson_g12a_role_get;
> > to me, use a local variable for switch_desc
>
> I'm never fan of changing a local global variable for a driver instance,
> is it strictly required ?
usb_role_switch_register (which is called a few lines below this)
copies all data from "struct usb_role_switch_desc" to a newly
allocated "struct usb_role_switch"
in other words: you could make it a stack-variable
personally I have no preference so I leave the decision up to you
Regards
Martin
WARNING: multiple messages have this Message-ID (diff)
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
balbi@kernel.org, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
kishon@ti.com, hminas@synopsys.com,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: [v2,8/8] usb: dwc3: Add Amlogic G12A DWC3 glue
Date: Mon, 11 Mar 2019 22:19:00 +0100 [thread overview]
Message-ID: <CAFBinCAUMNBeTABNeyOiYu9Gu8zWWmG3dBNJwFpop3QNp6ZG0g@mail.gmail.com> (raw)
On Thu, Mar 7, 2019 at 10:46 AM Neil Armstrong <narmstrong@baylibre.com> wrote:
[...]
> >> + /* Setup role switcher */
> >> + priv->switch_desc.usb2_port = dwc3_meson_g12_find_child(dev,
> >> + "snps,dwc3");
> >> + priv->switch_desc.udc = dwc3_meson_g12_find_child(dev, "snps,dwc2");
> >> + priv->switch_desc.allow_userspace_control = true;
> >> + priv->switch_desc.set = dwc3_meson_g12a_role_set;
> >> + priv->switch_desc.get = dwc3_meson_g12a_role_get;
> > to me, use a local variable for switch_desc
>
> I'm never fan of changing a local global variable for a driver instance,
> is it strictly required ?
usb_role_switch_register (which is called a few lines below this)
copies all data from "struct usb_role_switch_desc" to a newly
allocated "struct usb_role_switch"
in other words: you could make it a stack-variable
personally I have no preference so I leave the decision up to you
Regards
Martin
WARNING: multiple messages have this Message-ID (diff)
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: balbi@kernel.org, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
kishon@ti.com, hminas@synopsys.com,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 8/8] usb: dwc3: Add Amlogic G12A DWC3 glue
Date: Mon, 11 Mar 2019 22:19:00 +0100 [thread overview]
Message-ID: <CAFBinCAUMNBeTABNeyOiYu9Gu8zWWmG3dBNJwFpop3QNp6ZG0g@mail.gmail.com> (raw)
In-Reply-To: <6eaff413-d2c7-125a-f165-e4226c7a153e@baylibre.com>
On Thu, Mar 7, 2019 at 10:46 AM Neil Armstrong <narmstrong@baylibre.com> wrote:
[...]
> >> + /* Setup role switcher */
> >> + priv->switch_desc.usb2_port = dwc3_meson_g12_find_child(dev,
> >> + "snps,dwc3");
> >> + priv->switch_desc.udc = dwc3_meson_g12_find_child(dev, "snps,dwc2");
> >> + priv->switch_desc.allow_userspace_control = true;
> >> + priv->switch_desc.set = dwc3_meson_g12a_role_set;
> >> + priv->switch_desc.get = dwc3_meson_g12a_role_get;
> > to me, use a local variable for switch_desc
>
> I'm never fan of changing a local global variable for a driver instance,
> is it strictly required ?
usb_role_switch_register (which is called a few lines below this)
copies all data from "struct usb_role_switch_desc" to a newly
allocated "struct usb_role_switch"
in other words: you could make it a stack-variable
personally I have no preference so I leave the decision up to you
Regards
Martin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: balbi@kernel.org, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
kishon@ti.com, hminas@synopsys.com,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 8/8] usb: dwc3: Add Amlogic G12A DWC3 glue
Date: Mon, 11 Mar 2019 22:19:00 +0100 [thread overview]
Message-ID: <CAFBinCAUMNBeTABNeyOiYu9Gu8zWWmG3dBNJwFpop3QNp6ZG0g@mail.gmail.com> (raw)
In-Reply-To: <6eaff413-d2c7-125a-f165-e4226c7a153e@baylibre.com>
On Thu, Mar 7, 2019 at 10:46 AM Neil Armstrong <narmstrong@baylibre.com> wrote:
[...]
> >> + /* Setup role switcher */
> >> + priv->switch_desc.usb2_port = dwc3_meson_g12_find_child(dev,
> >> + "snps,dwc3");
> >> + priv->switch_desc.udc = dwc3_meson_g12_find_child(dev, "snps,dwc2");
> >> + priv->switch_desc.allow_userspace_control = true;
> >> + priv->switch_desc.set = dwc3_meson_g12a_role_set;
> >> + priv->switch_desc.get = dwc3_meson_g12a_role_get;
> > to me, use a local variable for switch_desc
>
> I'm never fan of changing a local global variable for a driver instance,
> is it strictly required ?
usb_role_switch_register (which is called a few lines below this)
copies all data from "struct usb_role_switch_desc" to a newly
allocated "struct usb_role_switch"
in other words: you could make it a stack-variable
personally I have no preference so I leave the decision up to you
Regards
Martin
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2019-03-11 21:19 UTC|newest]
Thread overview: 110+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-04 10:38 [PATCH v2 0/8] arm64: meson: Add support for USB on Amlogic G12A Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` [PATCH v2 1/8] dt-bindings: phy: Add Amlogic G12A USB2 PHY Bindings Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` [v2,1/8] " Neil Armstrong
2019-03-04 10:38 ` [PATCH v2 2/8] dt-bindings: phy: Add Amlogic G12A USB3+PCIE Combo " Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` [v2,2/8] " Neil Armstrong
2019-03-04 10:38 ` [PATCH v2 2/8] " Neil Armstrong
2019-03-05 21:42 ` Martin Blumenstingl
2019-03-05 21:42 ` Martin Blumenstingl
2019-03-05 21:42 ` Martin Blumenstingl
2019-03-05 21:42 ` [v2,2/8] " Martin Blumenstingl
2019-03-07 8:35 ` [PATCH v2 2/8] " Neil Armstrong
2019-03-07 8:35 ` Neil Armstrong
2019-03-07 8:35 ` Neil Armstrong
2019-03-07 8:35 ` [v2,2/8] " Neil Armstrong
2019-03-12 18:23 ` [PATCH v2 2/8] " Rob Herring
2019-03-12 18:23 ` Rob Herring
2019-03-12 18:23 ` Rob Herring
2019-03-12 18:23 ` [v2,2/8] " Rob Herring
2019-03-12 18:23 ` [PATCH v2 2/8] " Rob Herring
2019-03-04 10:38 ` [PATCH v2 3/8] dt-bindings: usb: dwc2: Add Amlogic G12A DWC2 Compatible Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` [v2,3/8] " Neil Armstrong
2019-03-04 10:38 ` [PATCH v2 4/8] dt-bindings: usb: dwc3: Add Amlogic G12A DWC3 Glue Bindings Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` [v2,4/8] " Neil Armstrong
2019-03-06 21:27 ` [PATCH v2 4/8] " Martin Blumenstingl
2019-03-06 21:27 ` Martin Blumenstingl
2019-03-06 21:27 ` Martin Blumenstingl
2019-03-06 21:27 ` [v2,4/8] " Martin Blumenstingl
2019-03-07 8:36 ` [PATCH v2 4/8] " Neil Armstrong
2019-03-07 8:36 ` Neil Armstrong
2019-03-07 8:36 ` Neil Armstrong
2019-03-07 8:36 ` [v2,4/8] " Neil Armstrong
2019-03-12 18:29 ` [PATCH v2 4/8] " Rob Herring
2019-03-12 18:29 ` Rob Herring
2019-03-12 18:29 ` Rob Herring
2019-03-12 18:29 ` [v2,4/8] " Rob Herring
2019-03-12 18:29 ` [PATCH v2 4/8] " Rob Herring
2019-03-04 10:38 ` [PATCH v2 5/8] phy: amlogic: add Amlogic G12A USB2 PHY Driver Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` [v2,5/8] " Neil Armstrong
2019-03-06 21:00 ` [PATCH v2 5/8] " Martin Blumenstingl
2019-03-06 21:00 ` Martin Blumenstingl
2019-03-06 21:00 ` Martin Blumenstingl
2019-03-06 21:00 ` [v2,5/8] " Martin Blumenstingl
2019-03-07 8:41 ` [PATCH v2 5/8] " Neil Armstrong
2019-03-07 8:41 ` Neil Armstrong
2019-03-07 8:41 ` Neil Armstrong
2019-03-07 8:41 ` [v2,5/8] " Neil Armstrong
2019-03-11 21:04 ` [PATCH v2 5/8] " Martin Blumenstingl
2019-03-11 21:04 ` Martin Blumenstingl
2019-03-11 21:04 ` Martin Blumenstingl
2019-03-11 21:04 ` [v2,5/8] " Martin Blumenstingl
2019-03-04 10:38 ` [PATCH v2 6/8] phy: amlogic: Add Amlogic G12A USB3 + PCIE Combo " Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` [v2,6/8] " Neil Armstrong
2019-03-06 21:04 ` [PATCH v2 6/8] " Martin Blumenstingl
2019-03-06 21:04 ` Martin Blumenstingl
2019-03-06 21:04 ` Martin Blumenstingl
2019-03-06 21:04 ` [v2,6/8] " Martin Blumenstingl
2019-03-07 8:44 ` [PATCH v2 6/8] " Neil Armstrong
2019-03-07 8:44 ` Neil Armstrong
2019-03-07 8:44 ` Neil Armstrong
2019-03-07 8:44 ` [v2,6/8] " Neil Armstrong
2019-03-11 21:14 ` [PATCH v2 6/8] " Martin Blumenstingl
2019-03-11 21:14 ` Martin Blumenstingl
2019-03-11 21:14 ` Martin Blumenstingl
2019-03-11 21:14 ` [v2,6/8] " Martin Blumenstingl
2019-03-04 10:38 ` [PATCH v2 7/8] usb: dwc2: Add Amlogic G12A DWC2 Params Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` [v2,7/8] " Neil Armstrong
2019-03-04 10:38 ` [PATCH v2 8/8] usb: dwc3: Add Amlogic G12A DWC3 glue Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` Neil Armstrong
2019-03-04 10:38 ` [v2,8/8] " Neil Armstrong
2019-03-07 2:02 ` [PATCH v2 8/8] " Chunfeng Yun
2019-03-07 2:02 ` Chunfeng Yun
2019-03-07 2:02 ` Chunfeng Yun
2019-03-07 2:02 ` [v2,8/8] " Chunfeng Yun
2019-03-07 9:45 ` [PATCH v2 8/8] " Neil Armstrong
2019-03-07 9:45 ` Neil Armstrong
2019-03-07 9:45 ` Neil Armstrong
2019-03-07 9:45 ` [v2,8/8] " Neil Armstrong
2019-03-07 11:01 ` [PATCH v2 8/8] " Chunfeng Yun
2019-03-07 11:01 ` Chunfeng Yun
2019-03-07 11:01 ` Chunfeng Yun
2019-03-07 11:01 ` [v2,8/8] " Chunfeng Yun
2019-03-11 21:19 ` Martin Blumenstingl [this message]
2019-03-11 21:19 ` [PATCH v2 8/8] " Martin Blumenstingl
2019-03-11 21:19 ` Martin Blumenstingl
2019-03-11 21:19 ` [v2,8/8] " Martin Blumenstingl
2019-03-11 21:56 ` [PATCH v2 8/8] " Martin Blumenstingl
2019-03-11 21:56 ` Martin Blumenstingl
2019-03-11 21:56 ` Martin Blumenstingl
2019-03-11 21:56 ` [v2,8/8] " Martin Blumenstingl
2019-03-13 13:07 ` [PATCH v2 8/8] " Neil Armstrong
2019-03-13 13:07 ` Neil Armstrong
2019-03-13 13:07 ` Neil Armstrong
2019-03-13 13:07 ` [v2,8/8] " Neil Armstrong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFBinCAUMNBeTABNeyOiYu9Gu8zWWmG3dBNJwFpop3QNp6ZG0g@mail.gmail.com \
--to=martin.blumenstingl@googlemail.com \
--cc=balbi@kernel.org \
--cc=chunfeng.yun@mediatek.com \
--cc=gregkh@linuxfoundation.org \
--cc=hminas@synopsys.com \
--cc=kishon@ti.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=narmstrong@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.