Re: [PATCH v2 6/8] usb: ehci-omap: add helpers for checking port mode
On Tue, Nov 30, 2010 at 08:14:36PM +0530, Anand Gadiyar wrote: > On 11/30/2010 5:55 PM, Sergei Shtylyov wrote: > > Hello. > > > > On 29-11-2010 20:25, Anand Gadiyar wrote: > > > >> Introduce helper functions to test port mode. These checks are > >> performed in several places in the driver, and these helpers > >> improve readability. > > > >> Signed-off-by: Anand Gadiyar > > [...] > > > >> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c > >> index 7a4682c..dd9d5c1 100644 > >> --- a/drivers/usb/host/ehci-omap.c > >> +++ b/drivers/usb/host/ehci-omap.c > > [...] > >> @@ -387,27 +390,27 @@ static int omap_start_ehc(struct ehci_hcd_omap > >> *omap, struct usb_hcd *hcd) > >> /* Bypass the TLL module for PHY mode operation */ > >> if (cpu_is_omap3430()&& (omap_rev()<= OMAP3430_REV_ES2_1)) { > >> dev_dbg(omap->dev, "OMAP3 ES version<= ES2.1\n"); > >> -if ((omap->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY) || > >> -(omap->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY) || > >> -(omap->port_mode[2] == EHCI_HCD_OMAP_MODE_PHY)) > >> +if (is_ehci_phy_mode(omap->port_mode[0]) || > >> +is_ehci_phy_mode(omap->port_mode[1]) || > >> +is_ehci_phy_mode(omap->port_mode[2])) > > > >Why there's another indentation level whenre there shouldn't be one? > > > > No particular reason, other than that it was a find-and-replace change. > I can fix it up if you insist. No, it's not needed. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 6/8] usb: ehci-omap: add helpers for checking port mode
On 11/30/2010 5:55 PM, Sergei Shtylyov wrote: > Hello. > > On 29-11-2010 20:25, Anand Gadiyar wrote: > >> Introduce helper functions to test port mode. These checks are >> performed in several places in the driver, and these helpers >> improve readability. > >> Signed-off-by: Anand Gadiyar > [...] > >> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c >> index 7a4682c..dd9d5c1 100644 >> --- a/drivers/usb/host/ehci-omap.c >> +++ b/drivers/usb/host/ehci-omap.c > [...] >> @@ -387,27 +390,27 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, >> struct usb_hcd *hcd) >> /* Bypass the TLL module for PHY mode operation */ >> if (cpu_is_omap3430()&& (omap_rev()<= OMAP3430_REV_ES2_1)) { >> dev_dbg(omap->dev, "OMAP3 ES version<= ES2.1\n"); >> -if ((omap->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY) || >> -(omap->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY) || >> -(omap->port_mode[2] == EHCI_HCD_OMAP_MODE_PHY)) >> +if (is_ehci_phy_mode(omap->port_mode[0]) || >> +is_ehci_phy_mode(omap->port_mode[1]) || >> +is_ehci_phy_mode(omap->port_mode[2])) > >Why there's another indentation level whenre there shouldn't be one? > No particular reason, other than that it was a find-and-replace change. I can fix it up if you insist. - Anand -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 6/8] usb: ehci-omap: add helpers for checking port mode
Hello. On 29-11-2010 20:25, Anand Gadiyar wrote: Introduce helper functions to test port mode. These checks are performed in several places in the driver, and these helpers improve readability. Signed-off-by: Anand Gadiyar [...] diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 7a4682c..dd9d5c1 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c [...] @@ -387,27 +390,27 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd) /* Bypass the TLL module for PHY mode operation */ if (cpu_is_omap3430()&& (omap_rev()<= OMAP3430_REV_ES2_1)) { dev_dbg(omap->dev, "OMAP3 ES version<= ES2.1\n"); - if ((omap->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY) || - (omap->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY) || - (omap->port_mode[2] == EHCI_HCD_OMAP_MODE_PHY)) + if (is_ehci_phy_mode(omap->port_mode[0]) || + is_ehci_phy_mode(omap->port_mode[1]) || + is_ehci_phy_mode(omap->port_mode[2])) Why there's another indentation level whenre there shouldn't be one? WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html