From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 18 Mar 2016 12:21:20 +0100 Subject: [U-Boot] [PATCH v4 2/4] drivers:usb:common:fsl-dt-fixup: Remove code duplication for fdt_usb_get_node_type In-Reply-To: References: <1457677576-29195-1-git-send-email-sriram.dash@nxp.com> <1457677576-29195-3-git-send-email-sriram.dash@nxp.com> <56E2F5BE.30503@denx.de> Message-ID: <56EBE4B0.1010903@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 03/18/2016 06:05 AM, Sriram Dash wrote: > >> -----Original Message----- >> From: Marek Vasut [mailto:marex at denx.de] >> Sent: Friday, March 11, 2016 10:14 PM >> To: Sriram Dash ; u-boot at lists.denx.de >> Cc: york sun ; Ramneek Mehresh >> ; Rajesh Bhagat >> Subject: Re: [PATCH v4 2/4] drivers:usb:common:fsl-dt-fixup: Remove code >> duplication for fdt_usb_get_node_type >> >> On 03/11/2016 07:26 AM, Sriram Dash wrote: >>> Call fdt_usb_get_node_type() from fdt_fixup_usb_mode_phy_type() to >>> avoid code duplication. >>> >>> Signed-off-by: Sriram Dash >>> Signed-off-by: Rajesh Bhagat >>> --- >>> Changes in v4: >>> - Make minimal modification to code >>> Changes in v3: >>> - Move the duplication of code to new patch >>> >>> drivers/usb/common/fsl-dt-fixup.c | 23 ++++++----------------- >>> 1 file changed, 6 insertions(+), 17 deletions(-) >>> >>> diff --git a/drivers/usb/common/fsl-dt-fixup.c >>> b/drivers/usb/common/fsl-dt-fixup.c >>> index 92adb46..64e20d8 100644 >>> --- a/drivers/usb/common/fsl-dt-fixup.c >>> +++ b/drivers/usb/common/fsl-dt-fixup.c >>> @@ -19,32 +19,21 @@ >>> #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 #endif >>> >>> +static const char *fdt_usb_get_node_type(void *blob, int start_offset, >>> + int *node_offset); >>> + >> >> Why do you need this forward declaration ? >> > > The forwarded declaration is needed as the function " fdt_usb_get_node_type " is used in " fdt_fixup_usb_mode_phy_type " but defined below " fdt_fixup_usb_mode_phy_type ". > > This was done to avoid the confusion created due to git diff, while moving the " fdt_usb_get_node_type " above " fdt_fixup_usb_mode_phy_type", in v3. Just swap those functions please. Best regards, Marek Vasut