* [PATCH 0/3] staging: emxx_udc: Fix several coding style issues
@ 2015-09-04 7:57 Ravi Teja Darbha
2015-09-04 7:59 ` [PATCH 1/3] staging: emxx_udc: Remove FSF mailing address Ravi Teja Darbha
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ravi Teja Darbha @ 2015-09-04 7:57 UTC (permalink / raw)
To: gregkh
Cc: hamohammed.sa, balbi, vinc94, hgujulan, roberta.dobrescu,
tapaswenipathak, devel, linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] staging: emxx_udc: Remove FSF mailing address
2015-09-04 7:57 [PATCH 0/3] staging: emxx_udc: Fix several coding style issues Ravi Teja Darbha
@ 2015-09-04 7:59 ` Ravi Teja Darbha
2015-09-04 8:16 ` [PATCH 2/3] staging: emxx_udc: Avoid using multiple blank lines Ravi Teja Darbha
2015-09-04 8:18 ` [PATCH 3/3] staging: emxx_udc: Fix NULL comparison style Ravi Teja Darbha
2 siblings, 0 replies; 4+ messages in thread
From: Ravi Teja Darbha @ 2015-09-04 7:59 UTC (permalink / raw)
To: gregkh
Cc: hamohammed.sa, balbi, vinc94, hgujulan, roberta.dobrescu,
tapaswenipathak, devel, linux-kernel
FSF mailing address is no longer required to be specified. Hence
removed.
Signed-off-by: Ravi Teja Darbha <ravi2j@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 <linux/kernel.h>
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] staging: emxx_udc: Avoid using multiple blank lines
2015-09-04 7:57 [PATCH 0/3] staging: emxx_udc: Fix several coding style issues Ravi Teja Darbha
2015-09-04 7:59 ` [PATCH 1/3] staging: emxx_udc: Remove FSF mailing address Ravi Teja Darbha
@ 2015-09-04 8:16 ` Ravi Teja Darbha
2015-09-04 8:18 ` [PATCH 3/3] staging: emxx_udc: Fix NULL comparison style Ravi Teja Darbha
2 siblings, 0 replies; 4+ messages in thread
From: Ravi Teja Darbha @ 2015-09-04 8:16 UTC (permalink / raw)
To: gregkh
Cc: hamohammed.sa, balbi, vinc94, hgujulan, roberta.dobrescu,
tapaswenipathak, devel, linux-kernel
Fixed multiple blank lines warning by checkpatch.pl
Signed-off-by: Ravi Teja Darbha <ravi2j@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(&udc->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 @@
#define USE_DMA 1
#define USE_SUSPEND_WAIT 1
-
-
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
-
/*------------ Board dependence(Resource) */
#define VBUS_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_DISABLE 0
-
/*------- BIT */
#define BIT00 0x00000001
#define BIT01 0x00000002
@@ -456,8 +442,6 @@
/*------- (0x1118:) EPnTADR Register */
#define EPn_TADR 0xFFFFFFFF /* 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 usb_gadget_driver *driver;
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] staging: emxx_udc: Fix NULL comparison style
2015-09-04 7:57 [PATCH 0/3] staging: emxx_udc: Fix several coding style issues Ravi Teja Darbha
2015-09-04 7:59 ` [PATCH 1/3] staging: emxx_udc: Remove FSF mailing address Ravi Teja Darbha
2015-09-04 8:16 ` [PATCH 2/3] staging: emxx_udc: Avoid using multiple blank lines Ravi Teja Darbha
@ 2015-09-04 8:18 ` Ravi Teja Darbha
2 siblings, 0 replies; 4+ messages in thread
From: Ravi Teja Darbha @ 2015-09-04 8:18 UTC (permalink / raw)
To: gregkh
Cc: hamohammed.sa, balbi, vinc94, hgujulan, roberta.dobrescu,
tapaswenipathak, devel, linux-kernel
Fixed NULL comparison style as suggested by checkpatch.pl
Signed-off-by: Ravi Teja Darbha <ravi2j@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(&udc->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 = &udc->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 = &udc->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 = &udc->ep0_req;
if (req->req.complete)
req->req.complete(&ep->ep, &req->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 */
- if ((_ep == NULL) || (_req == NULL)) {
- if (_ep == NULL)
+ if ((!_ep) || (!_req)) {
+ if (!_ep)
pr_err("udc: %s --- _ep == NULL\n", __func__);
- if (_req == NULL)
+ if (!_req)
pr_err("udc: %s --- _req == NULL\n", __func__);
return -EINVAL;
@@ -2738,7 +2738,7 @@ static int nbu2ss_ep_queue(
req->unaligned = FALSE;
if (req->unaligned) {
- if (ep->virt_buf == NULL)
+ if (!ep->virt_buf)
ep->virt_buf = (u8 *)dma_alloc_coherent(
NULL, PAGE_SIZE,
&ep->phys_buf, GFP_ATOMIC | GFP_DMA);
@@ -2794,7 +2794,7 @@ static int nbu2ss_ep_dequeue(
unsigned long flags;
/* catch various bogus parameters */
- if ((_ep == NULL) || (_req == NULL)) {
+ if ((!_ep) || (!_req)) {
/* pr_err("%s, bad param(1)\n", __func__); */
return -EINVAL;
}
@@ -2806,7 +2806,7 @@ static int nbu2ss_ep_dequeue(
}
udc = ep->udc;
- if (udc == NULL)
+ if (!udc)
return -EINVAL;
spin_lock_irqsave(&udc->lock, flags);
@@ -2989,13 +2989,13 @@ static int nbu2ss_gad_get_frame(struct usb_gadget *pgadget)
u32 data;
struct nbu2ss_udc *udc;
- if (pgadget == NULL) {
+ if (!pgadget) {
pr_err("udc: %s, bad param\n", __func__);
return -EINVAL;
}
udc = container_of(pgadget, struct nbu2ss_udc, gadget);
- if (udc == NULL) {
+ if (!udc) {
dev_err(&pgadget->dev, "%s, udc == NULL\n", __func__);
return -EINVAL;
}
@@ -3017,13 +3017,13 @@ static int nbu2ss_gad_wakeup(struct usb_gadget *pgadget)
struct nbu2ss_udc *udc;
- if (pgadget == NULL) {
+ if (!pgadget) {
pr_err("%s, bad param\n", __func__);
return -EINVAL;
}
udc = container_of(pgadget, struct nbu2ss_udc, gadget);
- if (udc == NULL) {
+ if (!udc) {
dev_err(&pgadget->dev, "%s, udc == NULL\n", __func__);
return -EINVAL;
}
@@ -3055,7 +3055,7 @@ static int nbu2ss_gad_set_selfpowered(struct usb_gadget *pgadget,
struct nbu2ss_udc *udc;
unsigned long flags;
- if (pgadget == NULL) {
+ if (!pgadget) {
pr_err("%s, bad param\n", __func__);
return -EINVAL;
}
@@ -3081,7 +3081,7 @@ static int nbu2ss_gad_vbus_draw(struct usb_gadget *pgadget, unsigned mA)
struct nbu2ss_udc *udc;
unsigned long flags;
- if (pgadget == NULL) {
+ if (!pgadget) {
pr_err("%s, bad param\n", __func__);
return -EINVAL;
}
@@ -3101,14 +3101,14 @@ static int nbu2ss_gad_pullup(struct usb_gadget *pgadget, int is_on)
struct nbu2ss_udc *udc;
unsigned long flags;
- if (pgadget == NULL) {
+ if (!pgadget) {
pr_err("%s, bad param\n", __func__);
return -EINVAL;
}
udc = container_of(pgadget, struct nbu2ss_udc, gadget);
- if (udc->driver == NULL) {
+ if (!udc->driver) {
pr_warn("%s, Not Regist Driver\n", __func__);
return -EINVAL;
}
@@ -3319,7 +3319,7 @@ static void nbu2ss_drv_shutdown(struct platform_device *pdev)
struct nbu2ss_udc *udc;
udc = platform_get_drvdata(pdev);
- if (udc == NULL)
+ if (!udc)
return;
_nbu2ss_disable_controller(udc);
@@ -3353,7 +3353,7 @@ static int nbu2ss_drv_suspend(struct platform_device *pdev, pm_message_t state)
struct nbu2ss_udc *udc;
udc = platform_get_drvdata(pdev);
- if (udc == NULL)
+ if (!udc)
return 0;
if (udc->vbus_active) {
@@ -3380,7 +3380,7 @@ static int nbu2ss_drv_resume(struct platform_device *pdev)
struct nbu2ss_udc *udc;
udc = platform_get_drvdata(pdev);
- if (udc == NULL)
+ if (!udc)
return 0;
data = gpio_get_value(VBUS_VALUE);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-09-04 8:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-04 7:57 [PATCH 0/3] staging: emxx_udc: Fix several coding style issues Ravi Teja Darbha
2015-09-04 7:59 ` [PATCH 1/3] staging: emxx_udc: Remove FSF mailing address Ravi Teja Darbha
2015-09-04 8:16 ` [PATCH 2/3] staging: emxx_udc: Avoid using multiple blank lines Ravi Teja Darbha
2015-09-04 8:18 ` [PATCH 3/3] staging: emxx_udc: Fix NULL comparison style Ravi Teja Darbha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).