Staging: emxx_udc: Initialize local var at declaration
PATCH 1/1 Staging: emxx_udc: Initialize local var at declaration
This patch improves code readability by initializing local variables at declaration.
Signed-off-by Bhumika Goyal <[email protected]>
--- drivers/staging/emxx_udc/emxx_udc.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/staging/emxx_udc/emxx_udc.c +4 -9
@@ -1704,9 +1704,8 @@ static inline int _nbu2ss_decode_request(struct nbu2ss_udc *udc) {bool bcall_back = TRUE;int nret = -EINVAL ; -struct usb_ctrlrequest *p_ctrl; +struct usb_ctrlrequest *p_ctrl = &udc->ctrl; - p_ctrl = &udc->ctrl;_nbu2ss_read_request_data (udc, (u32 *)p_ctrl);/* ep0 state control */
@@ -2023,9 +2022,7 @@ static inline void _nbu2ss_epn_in_dma_int( {u32 mpkt;u32 size; -struct usb_request *preq; - - preq = &req->req; +struct usb_request *preq = &req->req;if (!req->dma_flag)return ;
@@ -3284,9 +3281,8 @@ static int nbu2ss_drv_probe(struct platform_device *pdev)/*-------------------------------------------------------------------------*/ static void nbu2ss_drv_shutdown (struct platform_device *pdev) { -struct nbu2ss_udc *udc; +struct nbu2ss_udc *udc =platform_get_drvdata (pdev); - udc =platform_get_drvdata (pdev);if (!udc)return ;
@@ -3296,9 +3292,8 @@ static void nbu2ss_drv_shutdown(struct platform_device *pdev)/*-------------------------------------------------------------------------*/ static int nbu2ss_drv_suspend (struct platform_device *pdev,pm_message_t state) { -struct nbu2ss_udc *udc; +struct nbu2ss_udc *udc =platform_get_drvdata (pdev); - udc =platform_get_drvdata (pdev);if (!udc)return 0 ;
Signature · 1 line
1.9.1
Greg KH
maintainerQuoted 2 lines · Bhumika Goyal
This patch improves code readability by initializing local variables at declaration.
Not really, you are removing the check from the initialization in some places here, making it harder to understand.
I suggest just leaving this alone, it's not anything that is needed to do here, sorry.
greg k-h