[PATCH] staging: emxx_udc: Remove unused parameter from function parameter list parameter list
struct nbu2ss_ep *ep parameter in functions _nbu2ss_ep0_in_transfer() and _nbu2ss_ep0_out_transfer() is not used anywhere inside. Hence, removed. Signed-off-by: Ravi Teja Darbha --- drivers/staging/emxx_udc/emxx_udc.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index b6b76ff..80135e6 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -691,7 +691,6 @@ static int EP0_receive_NULL(struct nbu2ss_udc *udc, bool pid_flag) /*-*/ static int _nbu2ss_ep0_in_transfer( struct nbu2ss_udc *udc, - struct nbu2ss_ep *ep, struct nbu2ss_req *req ) { @@ -749,7 +748,6 @@ static int _nbu2ss_ep0_in_transfer( /*-*/ static int _nbu2ss_ep0_out_transfer( struct nbu2ss_udc *udc, - struct nbu2ss_ep *ep, struct nbu2ss_req *req ) { @@ -1258,11 +1256,11 @@ static int _nbu2ss_start_transfer( /* EP0 */ switch (udc->ep0state) { case EP0_IN_DATA_PHASE: - nret = _nbu2ss_ep0_in_transfer(udc, ep, req); + nret = _nbu2ss_ep0_in_transfer(udc, req); break; case EP0_OUT_DATA_PHASE: - nret = _nbu2ss_ep0_out_transfer(udc, ep, req); + nret = _nbu2ss_ep0_out_transfer(udc, req); break; case EP0_IN_STATUS_PHASE: @@ -1635,7 +1633,7 @@ static int std_req_get_status(struct nbu2ss_udc *udc) if (result >= 0) { memcpy(udc->ep0_buf, _data, length); _nbu2ss_create_ep0_packet(udc, udc->ep0_buf, length); - _nbu2ss_ep0_in_transfer(udc, >ep[0], >ep0_req); + _nbu2ss_ep0_in_transfer(udc, >ep0_req); } else { dev_err(udc->dev, " Error GET_STATUS\n"); @@ -1806,7 +1804,7 @@ static inline int _nbu2ss_ep0_in_data_stage(struct nbu2ss_udc *udc) req->req.actual += req->div_len; req->div_len = 0; - nret = _nbu2ss_ep0_in_transfer(udc, ep, req); + nret = _nbu2ss_ep0_in_transfer(udc, req); if (nret == 0) { udc->ep0state = EP0_OUT_STATUS_PAHSE; EP0_receive_NULL(udc, TRUE); @@ -1830,7 +1828,7 @@ static inline int _nbu2ss_ep0_out_data_stage(struct nbu2ss_udc *udc) if (req == NULL) req = >ep0_req; - nret = _nbu2ss_ep0_out_transfer(udc, ep, req); + nret = _nbu2ss_ep0_out_transfer(udc, req); if (nret == 0) { udc->ep0state = EP0_IN_STATUS_PHASE; EP0_send_NULL(udc, TRUE); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: emxx_udc: Remove unused parameter from function parameter list parameter list
struct nbu2ss_ep *ep parameter in functions _nbu2ss_ep0_in_transfer() and _nbu2ss_ep0_out_transfer() is not used anywhere inside. Hence, removed. Signed-off-by: Ravi Teja Darbha <rav...@gmail.com> --- drivers/staging/emxx_udc/emxx_udc.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index b6b76ff..80135e6 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -691,7 +691,6 @@ static int EP0_receive_NULL(struct nbu2ss_udc *udc, bool pid_flag) /*-*/ static int _nbu2ss_ep0_in_transfer( struct nbu2ss_udc *udc, - struct nbu2ss_ep *ep, struct nbu2ss_req *req ) { @@ -749,7 +748,6 @@ static int _nbu2ss_ep0_in_transfer( /*-*/ static int _nbu2ss_ep0_out_transfer( struct nbu2ss_udc *udc, - struct nbu2ss_ep *ep, struct nbu2ss_req *req ) { @@ -1258,11 +1256,11 @@ static int _nbu2ss_start_transfer( /* EP0 */ switch (udc->ep0state) { case EP0_IN_DATA_PHASE: - nret = _nbu2ss_ep0_in_transfer(udc, ep, req); + nret = _nbu2ss_ep0_in_transfer(udc, req); break; case EP0_OUT_DATA_PHASE: - nret = _nbu2ss_ep0_out_transfer(udc, ep, req); + nret = _nbu2ss_ep0_out_transfer(udc, req); break; case EP0_IN_STATUS_PHASE: @@ -1635,7 +1633,7 @@ static int std_req_get_status(struct nbu2ss_udc *udc) if (result >= 0) { memcpy(udc->ep0_buf, _data, length); _nbu2ss_create_ep0_packet(udc, udc->ep0_buf, length); - _nbu2ss_ep0_in_transfer(udc, >ep[0], >ep0_req); + _nbu2ss_ep0_in_transfer(udc, >ep0_req); } else { dev_err(udc->dev, " Error GET_STATUS\n"); @@ -1806,7 +1804,7 @@ static inline int _nbu2ss_ep0_in_data_stage(struct nbu2ss_udc *udc) req->req.actual += req->div_len; req->div_len = 0; - nret = _nbu2ss_ep0_in_transfer(udc, ep, req); + nret = _nbu2ss_ep0_in_transfer(udc, req); if (nret == 0) { udc->ep0state = EP0_OUT_STATUS_PAHSE; EP0_receive_NULL(udc, TRUE); @@ -1830,7 +1828,7 @@ static inline int _nbu2ss_ep0_out_data_stage(struct nbu2ss_udc *udc) if (req == NULL) req = >ep0_req; - nret = _nbu2ss_ep0_out_transfer(udc, ep, req); + nret = _nbu2ss_ep0_out_transfer(udc, req); if (nret == 0) { udc->ep0state = EP0_IN_STATUS_PHASE; EP0_send_NULL(udc, TRUE); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: emxx_udc: Remove cleanup1 label
The cleanup1 label does nothing but return. Better way is to return immediately instead of using goto. Hence, removed. Signed-off-by: Ravi Teja Darbha --- drivers/staging/emxx_udc/emxx_udc.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 8cef08d..ffb8a3d 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -3284,14 +3284,14 @@ static int nbu2ss_drv_probe(struct platform_device *pdev) /* USB Function Controller Interrupt */ if (status != 0) { dev_err(udc->dev, "request_irq(USB_UDC_IRQ_1) failed\n"); - goto cleanup1; + return status; } /* Driver Initialization */ status = nbu2ss_drv_contest_init(pdev, udc); if (status < 0) { /* Error */ - goto cleanup1; + return status; } /* VBUS Interrupt */ @@ -3304,13 +3304,10 @@ static int nbu2ss_drv_probe(struct platform_device *pdev) if (status != 0) { dev_err(udc->dev, "request_irq(INT_VBUS) failed\n"); - goto cleanup1; + return status; } return status; - -cleanup1: - return status; } /*-*/ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/3] staging: emxx_udc: Fix NULL comparison style
Fixed NULL comparison style as suggested by checkpatch.pl Signed-off-by: Ravi Teja Darbha --- drivers/staging/emxx_udc/emxx_udc.c | 62 ++--- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index d57a9ab..8cef08d 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -108,7 +108,7 @@ static void _nbu2ss_dump_register(struct nbu2ss_udc *udc) pr_info("=== %s()\n", __func__); - if (udc == NULL) { + if (!udc) { pr_err("%s udc == NULL\n", __func__); return; } @@ -149,7 +149,7 @@ static void _nbu2ss_ep0_complete(struct usb_ep *_ep, struct usb_request *_req) struct usb_ctrlrequest *p_ctrl; struct nbu2ss_udc *udc; - if ((_ep == NULL) || (_req == NULL)) + if ((!_ep) || (!_req)) return; udc = (struct nbu2ss_udc *)_req->context; @@ -1294,7 +1294,7 @@ static void _nbu2ss_restert_transfer(struct nbu2ss_ep *ep) else req = list_entry(ep->queue.next, struct nbu2ss_req, queue); - if (req == NULL) + if (!req) return; if (ep->epnum > 0) { @@ -1700,7 +1700,7 @@ static int std_req_set_configuration(struct nbu2ss_udc *udc) /*-*/ static inline void _nbu2ss_read_request_data(struct nbu2ss_udc *udc, u32 *pdata) { - if ((udc == NULL) && (pdata == NULL)) + if ((!udc) && (!pdata)) return; *pdata = _nbu2ss_readl(>p_regs->SETUP_DATA0); @@ -1793,7 +1793,7 @@ static inline int _nbu2ss_ep0_in_data_stage(struct nbu2ss_udc *udc) else req = list_entry(ep->queue.next, struct nbu2ss_req, queue); - if (req == NULL) + if (!req) req = >ep0_req; req->req.actual += req->div_len; @@ -1820,7 +1820,7 @@ static inline int _nbu2ss_ep0_out_data_stage(struct nbu2ss_udc *udc) else req = list_entry(ep->queue.next, struct nbu2ss_req, queue); - if (req == NULL) + if (!req) req = >ep0_req; nret = _nbu2ss_ep0_out_transfer(udc, ep, req); @@ -1847,7 +1847,7 @@ static inline int _nbu2ss_ep0_status_stage(struct nbu2ss_udc *udc) else req = list_entry(ep->queue.next, struct nbu2ss_req, queue); - if (req == NULL) { + if (!req) { req = >ep0_req; if (req->req.complete) req->req.complete(>ep, >req); @@ -2154,7 +2154,7 @@ static inline void _nbu2ss_epn_int(struct nbu2ss_udc *udc, u32 epnum) else req = list_entry(ep->queue.next, struct nbu2ss_req, queue); - if (req == NULL) { + if (!req) { /* pr_warn("=== %s(%d) req == NULL\n", __func__, epnum); */ return; } @@ -2559,13 +2559,13 @@ static int nbu2ss_ep_enable( struct nbu2ss_ep*ep; struct nbu2ss_udc *udc; - if ((_ep == NULL) || (desc == NULL)) { + if ((!_ep) || (!desc)) { pr_err(" *** %s, bad param\n", __func__); return -EINVAL; } ep = container_of(_ep, struct nbu2ss_ep, ep); - if ((ep == NULL) || (ep->udc == NULL)) { + if ((!ep) || (!ep->udc)) { pr_err(" *** %s, ep == NULL !!\n", __func__); return -EINVAL; } @@ -2582,7 +2582,7 @@ static int nbu2ss_ep_enable( if (udc->vbus_active == 0) return -ESHUTDOWN; - if ((udc->driver == NULL) + if ((!udc->driver) || (udc->gadget.speed == USB_SPEED_UNKNOWN)) { dev_err(ep->udc->dev, " *** %s, udc !!\n", __func__); @@ -2619,13 +2619,13 @@ static int nbu2ss_ep_disable(struct usb_ep *_ep) struct nbu2ss_udc *udc; unsigned long flags; - if (_ep == NULL) { + if (!_ep) { pr_err(" *** %s, bad param\n", __func__); return -EINVAL; } ep = container_of(_ep, struct nbu2ss_ep, ep); - if ((ep == NULL) || (ep->udc == NULL)) { + if ((!ep) || (!ep->udc)) { pr_err("udc: *** %s, ep == NULL !!\n", __func__); return -EINVAL; } @@ -2667,7 +2667,7 @@ static void nbu2ss_ep_free_request( { struct nbu2ss_req *req; - if (_req != NULL) { + if (_req) { req = container_of(_req, struct nbu2ss_req, req); kfree(req); @@ -2688,11 +2688,11 @@ static int nbu2ss_ep_queue( int result = -EINVAL; /* catch various bogus parameters */ -
[PATCH 2/3] staging: emxx_udc: Avoid using multiple blank lines
Fixed multiple blank lines warning by checkpatch.pl Signed-off-by: Ravi Teja Darbha --- drivers/staging/emxx_udc/emxx_udc.c | 9 - drivers/staging/emxx_udc/emxx_udc.h | 26 -- 2 files changed, 35 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index a5b9e1e..d57a9ab 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -63,12 +63,10 @@ static void _nbu2ss_fifo_flush(struct nbu2ss_udc *, struct nbu2ss_ep *); #define_nbu2ss_zero_len_pkt(udc, epnum)\ _nbu2ss_ep_in_end(udc, epnum, 0, 0) - /*===*/ /* Global */ struct nbu2ss_udc udc_controller; - /*-*/ /* Read */ static inline u32 _nbu2ss_readl(void *address) @@ -1394,7 +1392,6 @@ static void _nbu2ss_set_endpoint_stall( } } - /*-*/ /* Device Descriptor */ static struct usb_device_descriptor device_desc = { @@ -2195,7 +2192,6 @@ static void _nbu2ss_ep0_enable(struct nbu2ss_udc *udc) _nbu2ss_writel(>p_regs->EP0_INT_ENA, EP0_INT_EN_BIT); } - /*-*/ static int _nbu2ss_nuke(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep, @@ -2331,7 +2327,6 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc *udc) return 0; } - /*-*/ static void _nbu2ss_reset_controller(struct nbu2ss_udc *udc) { @@ -2985,7 +2980,6 @@ static struct usb_ep_ops nbu2ss_ep_ops = { .fifo_flush = nbu2ss_ep_fifo_flush, }; - /*-*/ /* usb_gadget_ops */ @@ -3138,7 +3132,6 @@ static int nbu2ss_gad_ioctl( return 0; } - static const struct usb_gadget_ops nbu2ss_gadget_ops = { .get_frame = nbu2ss_gad_get_frame, .wakeup = nbu2ss_gad_wakeup, @@ -3403,7 +3396,6 @@ static int nbu2ss_drv_resume(struct platform_device *pdev) return 0; } - static struct platform_driver udc_driver = { .probe = nbu2ss_drv_probe, .shutdown = nbu2ss_drv_shutdown, @@ -3421,4 +3413,3 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_AUTHOR("Renesas Electronics Corporation"); MODULE_LICENSE("GPL"); - diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h index 5a53186..4a2cc38 100644 --- a/drivers/staging/emxx_udc/emxx_udc.h +++ b/drivers/staging/emxx_udc/emxx_udc.h @@ -13,14 +13,9 @@ * GNU General Public License for more details. */ - - - #ifndef _LINUX_EMXX_H #define _LINUX_EMXX_H - - /*---*/ /*- Default undef */ #if 0 @@ -32,14 +27,11 @@ #defineUSE_DMA 1 #define USE_SUSPEND_WAIT 1 - - #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif - /* Board dependence(Resource) */ #defineVBUS_VALUE GPIO_VBUS @@ -54,15 +46,11 @@ /* DMA Abort wait time ms */ #define DMA_DISABLE_TIME 10 - - /* Controller dependence */ #define NUM_ENDPOINTS 14 /* Endpoint */ #define REG_EP_NUM 15 /* Endpoint Register */ #define DMA_MAX_COUNT 256 /* DMA Block */ - - #define EPC_RST_DISABLE_TIME 1 /* 1 usec */ #define EPC_DIRPD_DISABLE_TIME 1 /* 1 msec */ #define EPC_PLL_LOCK_COUNT 1000/* 1000 */ @@ -71,12 +59,10 @@ #define CHATGER_TIME 700 /* 700msec */ #define USB_SUSPEND_TIME 2000/* 2 sec */ - /* U2F FLAG */ #define U2F_ENABLE 1 #define U2F_DISABLE0 - /*--- BIT */ #define BIT00 0x0001 #define BIT01 0x0002 @@ -456,8 +442,6 @@ /*--- (0x1118:) EPnTADR Register */ #define EPn_TADR 0x /* RW */ - - /*===*/ /* Struct */ /*--- ep_regs */ @@ -522,13 +506,6 @@ struct fc_regs { u8 Reserved1200[0x1000-0x200]; /* Reserved */ } __aligned(32); - - - - - - - #define EP0_PACKETSIZE 64 #define EP_PACKETSIZE 1024 @@ -539,10 +516,8 @@ struct fc_regs { #define D_FS_RAM_SIZE_BULK 64 #define D_HS_RAM_SIZE_BULK 512 - struct nbu2ss_udc; - enum ep0_state { EP0_IDLE, EP0_IN_DATA_PHASE, @@ -587,7 +562,6 @@ struct nbu2ss_ep { dma_addr_t phys_buf; }; - struct nbu2ss_udc { struct usb_gadget gadget; struct
[PATCH 1/3] staging: emxx_udc: Remove FSF mailing address
FSF mailing address is no longer required to be specified. Hence removed. Signed-off-by: Ravi Teja Darbha --- drivers/staging/emxx_udc/emxx_udc.c | 4 drivers/staging/emxx_udc/emxx_udc.h | 4 2 files changed, 8 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index b6b76ff..a5b9e1e 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -12,10 +12,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. */ #include diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h index 0db6b41..5a53186 100644 --- a/drivers/staging/emxx_udc/emxx_udc.h +++ b/drivers/staging/emxx_udc/emxx_udc.h @@ -11,10 +11,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. */ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/3] staging: emxx_udc: Fix several coding style issues
Fix several coding style issue as suggested by checkpatch.pl with --strict option Ravi Teja Darbha (3): staging: emxx_udc: Remove FSF mailing address staging: emxx_udc: Avoid using multiple blank lines staging: emxx_udc: Fix NULL comparison style drivers/staging/emxx_udc/emxx_udc.c | 75 +++-- drivers/staging/emxx_udc/emxx_udc.h | 30 --- 2 files changed, 31 insertions(+), 74 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: emxx_udc: Remove cleanup1 label
The cleanup1 label does nothing but return. Better way is to return immediately instead of using goto. Hence, removed. Signed-off-by: Ravi Teja Darbha <rav...@gmail.com> --- drivers/staging/emxx_udc/emxx_udc.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 8cef08d..ffb8a3d 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -3284,14 +3284,14 @@ static int nbu2ss_drv_probe(struct platform_device *pdev) /* USB Function Controller Interrupt */ if (status != 0) { dev_err(udc->dev, "request_irq(USB_UDC_IRQ_1) failed\n"); - goto cleanup1; + return status; } /* Driver Initialization */ status = nbu2ss_drv_contest_init(pdev, udc); if (status < 0) { /* Error */ - goto cleanup1; + return status; } /* VBUS Interrupt */ @@ -3304,13 +3304,10 @@ static int nbu2ss_drv_probe(struct platform_device *pdev) if (status != 0) { dev_err(udc->dev, "request_irq(INT_VBUS) failed\n"); - goto cleanup1; + return status; } return status; - -cleanup1: - return status; } /*-*/ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/3] staging: emxx_udc: Fix several coding style issues
Fix several coding style issue as suggested by checkpatch.pl with --strict option Ravi Teja Darbha (3): staging: emxx_udc: Remove FSF mailing address staging: emxx_udc: Avoid using multiple blank lines staging: emxx_udc: Fix NULL comparison style drivers/staging/emxx_udc/emxx_udc.c | 75 +++-- drivers/staging/emxx_udc/emxx_udc.h | 30 --- 2 files changed, 31 insertions(+), 74 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/3] staging: emxx_udc: Remove FSF mailing address
FSF mailing address is no longer required to be specified. Hence removed. Signed-off-by: Ravi Teja Darbha <rav...@gmail.com> --- drivers/staging/emxx_udc/emxx_udc.c | 4 drivers/staging/emxx_udc/emxx_udc.h | 4 2 files changed, 8 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index b6b76ff..a5b9e1e 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -12,10 +12,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. */ #include diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h index 0db6b41..5a53186 100644 --- a/drivers/staging/emxx_udc/emxx_udc.h +++ b/drivers/staging/emxx_udc/emxx_udc.h @@ -11,10 +11,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. */ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/3] staging: emxx_udc: Avoid using multiple blank lines
Fixed multiple blank lines warning by checkpatch.pl Signed-off-by: Ravi Teja Darbha <rav...@gmail.com> --- drivers/staging/emxx_udc/emxx_udc.c | 9 - drivers/staging/emxx_udc/emxx_udc.h | 26 -- 2 files changed, 35 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index a5b9e1e..d57a9ab 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -63,12 +63,10 @@ static void _nbu2ss_fifo_flush(struct nbu2ss_udc *, struct nbu2ss_ep *); #define_nbu2ss_zero_len_pkt(udc, epnum)\ _nbu2ss_ep_in_end(udc, epnum, 0, 0) - /*===*/ /* Global */ struct nbu2ss_udc udc_controller; - /*-*/ /* Read */ static inline u32 _nbu2ss_readl(void *address) @@ -1394,7 +1392,6 @@ static void _nbu2ss_set_endpoint_stall( } } - /*-*/ /* Device Descriptor */ static struct usb_device_descriptor device_desc = { @@ -2195,7 +2192,6 @@ static void _nbu2ss_ep0_enable(struct nbu2ss_udc *udc) _nbu2ss_writel(>p_regs->EP0_INT_ENA, EP0_INT_EN_BIT); } - /*-*/ static int _nbu2ss_nuke(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep, @@ -2331,7 +2327,6 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc *udc) return 0; } - /*-*/ static void _nbu2ss_reset_controller(struct nbu2ss_udc *udc) { @@ -2985,7 +2980,6 @@ static struct usb_ep_ops nbu2ss_ep_ops = { .fifo_flush = nbu2ss_ep_fifo_flush, }; - /*-*/ /* usb_gadget_ops */ @@ -3138,7 +3132,6 @@ static int nbu2ss_gad_ioctl( return 0; } - static const struct usb_gadget_ops nbu2ss_gadget_ops = { .get_frame = nbu2ss_gad_get_frame, .wakeup = nbu2ss_gad_wakeup, @@ -3403,7 +3396,6 @@ static int nbu2ss_drv_resume(struct platform_device *pdev) return 0; } - static struct platform_driver udc_driver = { .probe = nbu2ss_drv_probe, .shutdown = nbu2ss_drv_shutdown, @@ -3421,4 +3413,3 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_AUTHOR("Renesas Electronics Corporation"); MODULE_LICENSE("GPL"); - diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h index 5a53186..4a2cc38 100644 --- a/drivers/staging/emxx_udc/emxx_udc.h +++ b/drivers/staging/emxx_udc/emxx_udc.h @@ -13,14 +13,9 @@ * GNU General Public License for more details. */ - - - #ifndef _LINUX_EMXX_H #define _LINUX_EMXX_H - - /*---*/ /*- Default undef */ #if 0 @@ -32,14 +27,11 @@ #defineUSE_DMA 1 #define USE_SUSPEND_WAIT 1 - - #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif - /* Board dependence(Resource) */ #defineVBUS_VALUE GPIO_VBUS @@ -54,15 +46,11 @@ /* DMA Abort wait time ms */ #define DMA_DISABLE_TIME 10 - - /* Controller dependence */ #define NUM_ENDPOINTS 14 /* Endpoint */ #define REG_EP_NUM 15 /* Endpoint Register */ #define DMA_MAX_COUNT 256 /* DMA Block */ - - #define EPC_RST_DISABLE_TIME 1 /* 1 usec */ #define EPC_DIRPD_DISABLE_TIME 1 /* 1 msec */ #define EPC_PLL_LOCK_COUNT 1000/* 1000 */ @@ -71,12 +59,10 @@ #define CHATGER_TIME 700 /* 700msec */ #define USB_SUSPEND_TIME 2000/* 2 sec */ - /* U2F FLAG */ #define U2F_ENABLE 1 #define U2F_DISABLE0 - /*--- BIT */ #define BIT00 0x0001 #define BIT01 0x0002 @@ -456,8 +442,6 @@ /*--- (0x1118:) EPnTADR Register */ #define EPn_TADR 0x /* RW */ - - /*===*/ /* Struct */ /*--- ep_regs */ @@ -522,13 +506,6 @@ struct fc_regs { u8 Reserved1200[0x1000-0x200]; /* Reserved */ } __aligned(32); - - - - - - - #define EP0_PACKETSIZE 64 #define EP_PACKETSIZE 1024 @@ -539,10 +516,8 @@ struct fc_regs { #define D_FS_RAM_SIZE_BULK 64 #define D_HS_RAM_SIZE_BULK 512 - struct nbu2ss_udc; - enum ep0_state { EP0_IDLE, EP0_IN_DATA_PHASE, @@ -587,7 +562,6 @@ struct nbu2ss_ep { dma_addr_t phys_buf; }; - struct nbu2ss_udc { struct usb_gadget gadget;
[PATCH 3/3] staging: emxx_udc: Fix NULL comparison style
Fixed NULL comparison style as suggested by checkpatch.pl Signed-off-by: Ravi Teja Darbha <rav...@gmail.com> --- drivers/staging/emxx_udc/emxx_udc.c | 62 ++--- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index d57a9ab..8cef08d 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -108,7 +108,7 @@ static void _nbu2ss_dump_register(struct nbu2ss_udc *udc) pr_info("=== %s()\n", __func__); - if (udc == NULL) { + if (!udc) { pr_err("%s udc == NULL\n", __func__); return; } @@ -149,7 +149,7 @@ static void _nbu2ss_ep0_complete(struct usb_ep *_ep, struct usb_request *_req) struct usb_ctrlrequest *p_ctrl; struct nbu2ss_udc *udc; - if ((_ep == NULL) || (_req == NULL)) + if ((!_ep) || (!_req)) return; udc = (struct nbu2ss_udc *)_req->context; @@ -1294,7 +1294,7 @@ static void _nbu2ss_restert_transfer(struct nbu2ss_ep *ep) else req = list_entry(ep->queue.next, struct nbu2ss_req, queue); - if (req == NULL) + if (!req) return; if (ep->epnum > 0) { @@ -1700,7 +1700,7 @@ static int std_req_set_configuration(struct nbu2ss_udc *udc) /*-*/ static inline void _nbu2ss_read_request_data(struct nbu2ss_udc *udc, u32 *pdata) { - if ((udc == NULL) && (pdata == NULL)) + if ((!udc) && (!pdata)) return; *pdata = _nbu2ss_readl(>p_regs->SETUP_DATA0); @@ -1793,7 +1793,7 @@ static inline int _nbu2ss_ep0_in_data_stage(struct nbu2ss_udc *udc) else req = list_entry(ep->queue.next, struct nbu2ss_req, queue); - if (req == NULL) + if (!req) req = >ep0_req; req->req.actual += req->div_len; @@ -1820,7 +1820,7 @@ static inline int _nbu2ss_ep0_out_data_stage(struct nbu2ss_udc *udc) else req = list_entry(ep->queue.next, struct nbu2ss_req, queue); - if (req == NULL) + if (!req) req = >ep0_req; nret = _nbu2ss_ep0_out_transfer(udc, ep, req); @@ -1847,7 +1847,7 @@ static inline int _nbu2ss_ep0_status_stage(struct nbu2ss_udc *udc) else req = list_entry(ep->queue.next, struct nbu2ss_req, queue); - if (req == NULL) { + if (!req) { req = >ep0_req; if (req->req.complete) req->req.complete(>ep, >req); @@ -2154,7 +2154,7 @@ static inline void _nbu2ss_epn_int(struct nbu2ss_udc *udc, u32 epnum) else req = list_entry(ep->queue.next, struct nbu2ss_req, queue); - if (req == NULL) { + if (!req) { /* pr_warn("=== %s(%d) req == NULL\n", __func__, epnum); */ return; } @@ -2559,13 +2559,13 @@ static int nbu2ss_ep_enable( struct nbu2ss_ep*ep; struct nbu2ss_udc *udc; - if ((_ep == NULL) || (desc == NULL)) { + if ((!_ep) || (!desc)) { pr_err(" *** %s, bad param\n", __func__); return -EINVAL; } ep = container_of(_ep, struct nbu2ss_ep, ep); - if ((ep == NULL) || (ep->udc == NULL)) { + if ((!ep) || (!ep->udc)) { pr_err(" *** %s, ep == NULL !!\n", __func__); return -EINVAL; } @@ -2582,7 +2582,7 @@ static int nbu2ss_ep_enable( if (udc->vbus_active == 0) return -ESHUTDOWN; - if ((udc->driver == NULL) + if ((!udc->driver) || (udc->gadget.speed == USB_SPEED_UNKNOWN)) { dev_err(ep->udc->dev, " *** %s, udc !!\n", __func__); @@ -2619,13 +2619,13 @@ static int nbu2ss_ep_disable(struct usb_ep *_ep) struct nbu2ss_udc *udc; unsigned long flags; - if (_ep == NULL) { + if (!_ep) { pr_err(" *** %s, bad param\n", __func__); return -EINVAL; } ep = container_of(_ep, struct nbu2ss_ep, ep); - if ((ep == NULL) || (ep->udc == NULL)) { + if ((!ep) || (!ep->udc)) { pr_err("udc: *** %s, ep == NULL !!\n", __func__); return -EINVAL; } @@ -2667,7 +2667,7 @@ static void nbu2ss_ep_free_request( { struct nbu2ss_req *req; - if (_req != NULL) { + if (_req) { req = container_of(_req, struct nbu2ss_req, req); kfree(req); @@ -2688,11 +2688,11 @@ static int nbu2ss_ep_queue( int result = -EINVAL; /* catch various
[PATCH] staging: goldfish: Prefer kernel type u32 over uint32_t
Prefer kernel type u32 over uint32_t to maintain uniformity. Signed-off-by: Ravi Teja Darbha --- drivers/staging/goldfish/goldfish_nand_reg.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/goldfish/goldfish_nand_reg.h b/drivers/staging/goldfish/goldfish_nand_reg.h index fe7f47c..43aeba3 100644 --- a/drivers/staging/goldfish/goldfish_nand_reg.h +++ b/drivers/staging/goldfish/goldfish_nand_reg.h @@ -66,11 +66,11 @@ enum nand_reg { }; struct cmd_params { - uint32_t dev; - uint32_t addr_low; - uint32_t addr_high; - uint32_t transfer_size; + u32 dev; + u32 addr_low; + u32 addr_high; + u32 transfer_size; unsigned long data; - uint32_t result; + u32 result; }; #endif -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: goldfish: Fix NULL comparison style
Fixed NULL comparison style as suggested by checkpatch.pl with --strict option. Signed-off-by: Ravi Teja Darbha --- drivers/staging/goldfish/goldfish_nand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/goldfish/goldfish_nand.c b/drivers/staging/goldfish/goldfish_nand.c index 66ae48f..623353db5 100644 --- a/drivers/staging/goldfish/goldfish_nand.c +++ b/drivers/staging/goldfish/goldfish_nand.c @@ -48,7 +48,7 @@ static u32 goldfish_nand_cmd_with_params(struct mtd_info *mtd, struct cmd_params *cps = nand->cmd_params; unsigned char __iomem *base = nand->base; - if (cps == NULL) + if (!cps) return -1; switch (cmd) { @@ -379,7 +379,7 @@ static int goldfish_nand_probe(struct platform_device *pdev) unsigned char __iomem *base; r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (r == NULL) + if (!r) return -ENODEV; base = devm_ioremap(>dev, r->start, PAGE_SIZE); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: goldfish: Fix NULL comparison style
Fixed NULL comparison style as suggested by checkpatch.pl with --strict option. Signed-off-by: Ravi Teja Darbha <rav...@gmail.com> --- drivers/staging/goldfish/goldfish_nand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/goldfish/goldfish_nand.c b/drivers/staging/goldfish/goldfish_nand.c index 66ae48f..623353db5 100644 --- a/drivers/staging/goldfish/goldfish_nand.c +++ b/drivers/staging/goldfish/goldfish_nand.c @@ -48,7 +48,7 @@ static u32 goldfish_nand_cmd_with_params(struct mtd_info *mtd, struct cmd_params *cps = nand->cmd_params; unsigned char __iomem *base = nand->base; - if (cps == NULL) + if (!cps) return -1; switch (cmd) { @@ -379,7 +379,7 @@ static int goldfish_nand_probe(struct platform_device *pdev) unsigned char __iomem *base; r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (r == NULL) + if (!r) return -ENODEV; base = devm_ioremap(>dev, r->start, PAGE_SIZE); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: goldfish: Prefer kernel type u32 over uint32_t
Prefer kernel type u32 over uint32_t to maintain uniformity. Signed-off-by: Ravi Teja Darbha <rav...@gmail.com> --- drivers/staging/goldfish/goldfish_nand_reg.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/goldfish/goldfish_nand_reg.h b/drivers/staging/goldfish/goldfish_nand_reg.h index fe7f47c..43aeba3 100644 --- a/drivers/staging/goldfish/goldfish_nand_reg.h +++ b/drivers/staging/goldfish/goldfish_nand_reg.h @@ -66,11 +66,11 @@ enum nand_reg { }; struct cmd_params { - uint32_t dev; - uint32_t addr_low; - uint32_t addr_high; - uint32_t transfer_size; + u32 dev; + u32 addr_low; + u32 addr_high; + u32 transfer_size; unsigned long data; - uint32_t result; + u32 result; }; #endif -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] staging: dgnc: Replace macro with flow control statement by a function
Why would you use a macro to avoid code duplication? Regards, Ravi Teja On Mon, Jul 06, 2015 at 05:57:06PM +0530, Sudip Mukherjee wrote: > That is why the macro is there, to avoid the duplication of code. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] staging: dgnc: Replace macro with flow control statement by a function
What you need to do is to replace all DGNC_VERIFY_BOARD() macro calls with its definition. Regards, Ravi Teja On Sun, Jul 05, 2015 at 11:46:28PM +0530, Arjun Krishna Babu wrote: > This patch fixes the checkpatch.pl warning: > > WARNING: Macros with flow control statements should be avoided > > Replace the macro with a function doing the exact same task as the > macro. > > Signed-off-by: Arjun Krishna Babu > --- > drivers/staging/dgnc/dgnc_sysfs.c | 22 ++ > 1 file changed, 10 insertions(+), 12 deletions(-) > > diff --git a/drivers/staging/dgnc/dgnc_sysfs.c > b/drivers/staging/dgnc/dgnc_sysfs.c > index 44db870..8ab0922 100644 > --- a/drivers/staging/dgnc/dgnc_sysfs.c > +++ b/drivers/staging/dgnc/dgnc_sysfs.c > @@ -92,19 +92,17 @@ void dgnc_remove_driver_sysfiles(struct pci_driver > *dgnc_driver) > } > > > -#define DGNC_VERIFY_BOARD(p, bd) \ > - do {\ > - if (!p) \ > - return 0; \ > - \ > - bd = dev_get_drvdata(p);\ > - if (!bd || bd->magic != DGNC_BOARD_MAGIC) \ > - return 0; \ > - if (bd->state != BOARD_READY) \ > - return 0; \ > - } while (0) > - > +static int DGNC_VERIFY_BOARD(struct device *p, struct dgnc_board *bd) > +{ > + if (!p) > + return 0; > > + bd = dev_get_drvdata(p); > + if (!bd || bd->magic != DGNC_BOARD_MAGIC) > + return 0; > + if (bd->state != BOARD_READY) > + return 0; > +} > > static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr, >char *buf) > -- > 1.9.1 > > ___ > devel mailing list > de...@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] staging: dgnc: Replace macro with flow control statement by a function
What you need to do is to replace all DGNC_VERIFY_BOARD() macro calls with its definition. Regards, Ravi Teja On Sun, Jul 05, 2015 at 11:46:28PM +0530, Arjun Krishna Babu wrote: This patch fixes the checkpatch.pl warning: WARNING: Macros with flow control statements should be avoided Replace the macro with a function doing the exact same task as the macro. Signed-off-by: Arjun Krishna Babu arjunkrishnabab...@gmail.com --- drivers/staging/dgnc/dgnc_sysfs.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c index 44db870..8ab0922 100644 --- a/drivers/staging/dgnc/dgnc_sysfs.c +++ b/drivers/staging/dgnc/dgnc_sysfs.c @@ -92,19 +92,17 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver) } -#define DGNC_VERIFY_BOARD(p, bd) \ - do {\ - if (!p) \ - return 0; \ - \ - bd = dev_get_drvdata(p);\ - if (!bd || bd-magic != DGNC_BOARD_MAGIC) \ - return 0; \ - if (bd-state != BOARD_READY) \ - return 0; \ - } while (0) - +static int DGNC_VERIFY_BOARD(struct device *p, struct dgnc_board *bd) +{ + if (!p) + return 0; + bd = dev_get_drvdata(p); + if (!bd || bd-magic != DGNC_BOARD_MAGIC) + return 0; + if (bd-state != BOARD_READY) + return 0; +} static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr, char *buf) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] staging: dgnc: Replace macro with flow control statement by a function
Why would you use a macro to avoid code duplication? Regards, Ravi Teja On Mon, Jul 06, 2015 at 05:57:06PM +0530, Sudip Mukherjee wrote: That is why the macro is there, to avoid the duplication of code. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH][RESEND] rts5208:Fix checkpatch warnings
else is not generally useful after a break or return, hence removed. Signed-off-by: Ravi Teja Darbha --- drivers/staging/rts5208/xd.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c index 10fea7b..42d8d82 100644 --- a/drivers/staging/rts5208/xd.c +++ b/drivers/staging/rts5208/xd.c @@ -1689,10 +1689,9 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, xd_set_err_code(chip, XD_TO_ERROR); rtsx_trace(chip); return STATUS_FAIL; - } else { - rtsx_trace(chip); - goto Fail; } + rtsx_trace(chip); + goto Fail; } return STATUS_SUCCESS; @@ -1905,10 +1904,9 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk, xd_set_err_code(chip, XD_TO_ERROR); rtsx_trace(chip); return STATUS_FAIL; - } else { - rtsx_trace(chip); - goto Fail; } + rtsx_trace(chip); + goto Fail; } if (end_page == (xd_card->page_off + 1)) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH][RESEND] rts5208:Fix checkpatch warnings
else is not generally useful after a break or return, hence removed. Signed-off-by: Ravi Teja Darbha rav...@gmail.com --- drivers/staging/rts5208/xd.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c index 10fea7b..42d8d82 100644 --- a/drivers/staging/rts5208/xd.c +++ b/drivers/staging/rts5208/xd.c @@ -1689,10 +1689,9 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, xd_set_err_code(chip, XD_TO_ERROR); rtsx_trace(chip); return STATUS_FAIL; - } else { - rtsx_trace(chip); - goto Fail; } + rtsx_trace(chip); + goto Fail; } return STATUS_SUCCESS; @@ -1905,10 +1904,9 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk, xd_set_err_code(chip, XD_TO_ERROR); rtsx_trace(chip); return STATUS_FAIL; - } else { - rtsx_trace(chip); - goto Fail; } + rtsx_trace(chip); + goto Fail; } if (end_page == (xd_card-page_off + 1)) { -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] rts5208:Fix checkpatch warnings
Else condition after if statement is not necessary, hence removed. Signed-off-by: Ravi Teja Darbha --- drivers/staging/rts5208/xd.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c index 10fea7b..42d8d82 100644 --- a/drivers/staging/rts5208/xd.c +++ b/drivers/staging/rts5208/xd.c @@ -1689,10 +1689,9 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, xd_set_err_code(chip, XD_TO_ERROR); rtsx_trace(chip); return STATUS_FAIL; - } else { - rtsx_trace(chip); - goto Fail; } + rtsx_trace(chip); + goto Fail; } return STATUS_SUCCESS; @@ -1905,10 +1904,9 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk, xd_set_err_code(chip, XD_TO_ERROR); rtsx_trace(chip); return STATUS_FAIL; - } else { - rtsx_trace(chip); - goto Fail; } + rtsx_trace(chip); + goto Fail; } if (end_page == (xd_card->page_off + 1)) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [RESEND] rtl8712:Fix checkpatch warning
Fix line over 80 characters warning. Signed-off-by: Ravi Teja Darbha --- drivers/staging/rtl8712/rtl8712_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index fcb8c61..4fa2540 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -58,8 +58,8 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter) /*init recv_buf*/ _init_queue(>free_recv_buf_queue); - precvpriv->pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, -GFP_ATOMIC); + precvpriv->pallocated_recv_buf = + kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC); if (precvpriv->pallocated_recv_buf == NULL) return _FAIL; precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 - -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND] rtl8712:Fix checkpatch warning
Fix line over 80 characters warning. Signed-off-by: Ravi Teja Darbha --- drivers/staging/rtl8712/rtl8712_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index fcb8c61..4fa2540 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -58,8 +58,8 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter) /*init recv_buf*/ _init_queue(>free_recv_buf_queue); -precvpriv->pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, - GFP_ATOMIC); +precvpriv->pallocated_recv_buf = +kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC); if (precvpriv->pallocated_recv_buf == NULL) return _FAIL; precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 - -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] rtl8712:Fix checkpatch warning
1. Fix line over 80 characters warning. 2. The checkpatch warning at line 499 seems to be false positive. WARNING: else is not generally useful after a break or return #499: FILE: rtl8712_recv.c:499: +return false; +else while(condition1) { if(condition2) foo(); else if(condition3) return false; else break; } The else condition here cannot be eliminated Signed-off-by: Ravi Teja Darbha --- drivers/staging/rtl8712/rtl8712_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index fcb8c61..4fa2540 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -58,8 +58,8 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter) /*init recv_buf*/ _init_queue(>free_recv_buf_queue); -precvpriv->pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, - GFP_ATOMIC); +precvpriv->pallocated_recv_buf = +kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC); if (precvpriv->pallocated_recv_buf == NULL) return _FAIL; precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 - -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND] rtl8712:Fix checkpatch warning
Fix line over 80 characters warning. Signed-off-by: Ravi Teja Darbha rav...@gmail.com --- drivers/staging/rtl8712/rtl8712_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index fcb8c61..4fa2540 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -58,8 +58,8 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter) /*init recv_buf*/ _init_queue(precvpriv-free_recv_buf_queue); -precvpriv-pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, - GFP_ATOMIC); +precvpriv-pallocated_recv_buf = +kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC); if (precvpriv-pallocated_recv_buf == NULL) return _FAIL; precvpriv-precv_buf = precvpriv-pallocated_recv_buf + 4 - -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] rtl8712:Fix checkpatch warning
1. Fix line over 80 characters warning. 2. The checkpatch warning at line 499 seems to be false positive. WARNING: else is not generally useful after a break or return #499: FILE: rtl8712_recv.c:499: +return false; +else while(condition1) { if(condition2) foo(); else if(condition3) return false; else break; } The else condition here cannot be eliminated Signed-off-by: Ravi Teja Darbha rav...@gmail.com --- drivers/staging/rtl8712/rtl8712_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index fcb8c61..4fa2540 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -58,8 +58,8 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter) /*init recv_buf*/ _init_queue(precvpriv-free_recv_buf_queue); -precvpriv-pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, - GFP_ATOMIC); +precvpriv-pallocated_recv_buf = +kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC); if (precvpriv-pallocated_recv_buf == NULL) return _FAIL; precvpriv-precv_buf = precvpriv-pallocated_recv_buf + 4 - -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [RESEND] rtl8712:Fix checkpatch warning
Fix line over 80 characters warning. Signed-off-by: Ravi Teja Darbha rav...@gmail.com --- drivers/staging/rtl8712/rtl8712_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index fcb8c61..4fa2540 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -58,8 +58,8 @@ int r8712_init_recv_priv(struct recv_priv *precvpriv, struct _adapter *padapter) /*init recv_buf*/ _init_queue(precvpriv-free_recv_buf_queue); - precvpriv-pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, -GFP_ATOMIC); + precvpriv-pallocated_recv_buf = + kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC); if (precvpriv-pallocated_recv_buf == NULL) return _FAIL; precvpriv-precv_buf = precvpriv-pallocated_recv_buf + 4 - -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] rts5208:Fix checkpatch warnings
Else condition after if statement is not necessary, hence removed. Signed-off-by: Ravi Teja Darbha rav...@gmail.com --- drivers/staging/rts5208/xd.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c index 10fea7b..42d8d82 100644 --- a/drivers/staging/rts5208/xd.c +++ b/drivers/staging/rts5208/xd.c @@ -1689,10 +1689,9 @@ static int xd_read_multiple_pages(struct rtsx_chip *chip, u32 phy_blk, xd_set_err_code(chip, XD_TO_ERROR); rtsx_trace(chip); return STATUS_FAIL; - } else { - rtsx_trace(chip); - goto Fail; } + rtsx_trace(chip); + goto Fail; } return STATUS_SUCCESS; @@ -1905,10 +1904,9 @@ static int xd_write_multiple_pages(struct rtsx_chip *chip, u32 old_blk, xd_set_err_code(chip, XD_TO_ERROR); rtsx_trace(chip); return STATUS_FAIL; - } else { - rtsx_trace(chip); - goto Fail; } + rtsx_trace(chip); + goto Fail; } if (end_page == (xd_card-page_off + 1)) { -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH]drivers:staging:visorbus:Fix checkpatch warnings
This patch fixes checkpatch warnings Signed-off-by: Ravi Teja Darbha --- drivers/staging/unisys/visorbus/visorchipset.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index bb8087e..62f7f68 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1410,8 +1410,8 @@ visorchipset_chipset_ready(void) static int visorchipset_chipset_selftest(void) { -char env_selftest[20]; -char *envp[] = { env_selftest, NULL }; +static char env_selftest[20]; +static const char * const envp[] = { env_selftest, NULL }; sprintf(env_selftest, "SPARSP_SELFTEST=%d", 1); kobject_uevent_env(_platform_device.dev.kobj, KOBJ_CHANGE, @@ -1559,9 +1559,9 @@ static void parahotplug_request_kickoff(struct parahotplug_request *req) { struct controlvm_message_packet *cmd = >msg.cmd; -char env_cmd[40], env_id[40], env_state[40], env_bus[40], env_dev[40], -env_func[40]; -char *envp[] = { +static char env_cmd[40], env_id[40], env_state[40], env_bus[40], +env_dev[40], env_func[40]; +static const char * const envp[] = { env_cmd, env_id, env_state, env_bus, env_dev, env_func, NULL }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH]drivers:staging:visorbus:Fix checkpatch warnings
This patch fixes checkpatch warnings Signed-off-by: Ravi Teja Darbha rav...@gmail.com --- drivers/staging/unisys/visorbus/visorchipset.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index bb8087e..62f7f68 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1410,8 +1410,8 @@ visorchipset_chipset_ready(void) static int visorchipset_chipset_selftest(void) { -char env_selftest[20]; -char *envp[] = { env_selftest, NULL }; +static char env_selftest[20]; +static const char * const envp[] = { env_selftest, NULL }; sprintf(env_selftest, SPARSP_SELFTEST=%d, 1); kobject_uevent_env(visorchipset_platform_device.dev.kobj, KOBJ_CHANGE, @@ -1559,9 +1559,9 @@ static void parahotplug_request_kickoff(struct parahotplug_request *req) { struct controlvm_message_packet *cmd = req-msg.cmd; -char env_cmd[40], env_id[40], env_state[40], env_bus[40], env_dev[40], -env_func[40]; -char *envp[] = { +static char env_cmd[40], env_id[40], env_state[40], env_bus[40], +env_dev[40], env_func[40]; +static const char * const envp[] = { env_cmd, env_id, env_state, env_bus, env_dev, env_func, NULL }; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/