Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932314AbbHJOga (ORCPT ); Mon, 10 Aug 2015 10:36:30 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:39105 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932210AbbHJOg2 (ORCPT ); Mon, 10 Aug 2015 10:36:28 -0400 Date: Mon, 10 Aug 2015 09:36:23 -0500 From: Felipe Balbi To: Alan Stern CC: Ramneek Mehresh , , , , , Li Yang Subject: Re: [PATCH 3/8][v2]usb:fsl:otg: Add support to add/remove usb host driver Message-ID: <20150810143623.GD31059@saruman.tx.rr.com> Reply-To: References: <1436961772-11482-4-git-send-email-ramneek.mehresh@freescale.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yudcn1FV7Hsu/q59" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2965 Lines: 85 --yudcn1FV7Hsu/q59 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 07, 2015 at 04:33:33PM -0400, Alan Stern wrote: > On Wed, 15 Jul 2015, Ramneek Mehresh wrote: >=20 > > Add workqueue to add/remove host driver (outside > > interrupt context) upon each id change. > >=20 > > Signed-off-by: Li Yang > > Signed-off-by: Ramneek Mehresh > > --- > > drivers/usb/host/ehci-fsl.c | 83 ++++++++++++++++++++++++++++++++++---= -------- > > drivers/usb/host/ehci-fsl.h | 20 +++++++++++ > > 2 files changed, 84 insertions(+), 19 deletions(-) > >=20 > > diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c > > index 5352e74..81e4bf5 100644 > > --- a/drivers/usb/host/ehci-fsl.c > > +++ b/drivers/usb/host/ehci-fsl.c > > @@ -44,6 +44,34 @@ > > =20 > > static struct hc_driver __read_mostly fsl_ehci_hc_driver; > > =20 > > +#if defined(CONFIG_FSL_USB2_OTG) || defined(CONFIG_FSL_USB2_OTG_MODULE) >=20 > You've got these #if lines all over the place. They look ugly and make > the code hard to read. Consider removing them. Or even if you can't > remove them entirely, removing most of them would help. >=20 > Also, instead of testing both CONFIG_FSL_USB2_OTG and > CONFIG_FSL_USB2_OTG_MODULE, how about testing a single symbol? For=20 > example: >=20 > #if defined(CONFIG_FSL_USB2_OTG) || defined(CONFIG_FSL_USB2_OTG_MODULE) > #define CHANGE_HCD 1 > #else > #define CHANGE_HCD 0 > #endif >=20 > Then all you need later on is "#if CHANGE_HCD". Or if it's inside a=20 > code block, just "if (CHANGE_HCD)". what about IS_ENABLED() ? if (IS_ENABLED(CONFIG_FSL_USB2_OTG)) { foo(); } else { bar(); } --=20 balbi --yudcn1FV7Hsu/q59 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVyLbnAAoJEIaOsuA1yqREp4gQAIOOkMf+8BzEL8nDG3vgp08C FCOs3Di85nJSXcZ1im/oLZEGs1nIDFwfFeNxDklbRTGk27BdEJ+n6Ad+9OIX8GwY gQG69ZRkKlVcjgBphgmnljXU8y6IaBgTFv2JwhfY4HGWs7fYMg/Ggdp2ZOm/ne0b 49Ycmdb25hliJLW6DjtAazlN3Y8nro+vfV7G/11W7IPN9RyUbSgBwhpp/WaObGhk QgMrVKvR2fW04WXMY5axKma0WuXGMw7YK2gxg65QSEL8n1ubK/l5Crx6iTPpAJxQ wSM40l7bwGaYmIukf+5PQDuvanRV50zZNvwsjBo1BfrHD+T0MxDEHbfke7T3Q4ir iXe0Glzv7fNJuwdQY2Nc2alQg8OB7J+B7AcJPUYksbXTiR6ALBPeN0ErqFP80uY2 UximPnaA/EPm9lp4VWx9QngJE0qISLO63Jt9J11AhKT/T6T3tOtw83Vxtr8laM7K Y7w1YsO4jex5czAD9m+aTXv7f0Dr0bXkEeaAekwxincoHPl8EzcClvZnkn7AEo/m hDFpb207xAlnamO1voNbeLruFdjDOWwsdjNbVWWTqq+CJmifMJXJZDKloU1dHobk P01Z7p1r9+UYPNY+l2uIDg9xF1aE6GV1eFWiIsOVmrAuv8UYE3lYHV4h9Auf7LDx OOHhn3AxO7dRoLvCFEcx =OJcm -----END PGP SIGNATURE----- --yudcn1FV7Hsu/q59-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/