* [PATCH 0/3] [media] dvbdev: clean up the code
@ 2016-01-15 5:14 Xiubo Li
2016-01-15 5:14 ` [PATCH 1/3] [media] dvbdev: replace kcalloc with kzalloc Xiubo Li
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Xiubo Li @ 2016-01-15 5:14 UTC (permalink / raw)
To: m.chehab; +Cc: linux-media, Xiubo Li
Xiubo Li (3):
[media] dvbdev: replace kcalloc with kzalloc
[media] dvbdev: the space is required after ','
[media] dvbdev: remove useless parentheses after return
drivers/media/dvb-core/dvbdev.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] [media] dvbdev: replace kcalloc with kzalloc
2016-01-15 5:14 [PATCH 0/3] [media] dvbdev: clean up the code Xiubo Li
@ 2016-01-15 5:14 ` Xiubo Li
2016-01-15 5:14 ` [PATCH 2/3] [media] dvbdev: the space is required after ',' Xiubo Li
2016-01-15 5:15 ` [PATCH 3/3] [media] dvbdev: remove useless parentheses after return Xiubo Li
2 siblings, 0 replies; 4+ messages in thread
From: Xiubo Li @ 2016-01-15 5:14 UTC (permalink / raw)
To: m.chehab; +Cc: linux-media, Xiubo Li
Since the number of elements equals to 1, so just use kzalloc to
simplify the code and make it more readable.
Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
---
drivers/media/dvb-core/dvbdev.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index 560450a..f38fabe 100644
--- a/drivers/media/dvb-core/dvbdev.c
+++ b/drivers/media/dvb-core/dvbdev.c
@@ -620,8 +620,7 @@ int dvb_create_media_graph(struct dvb_adapter *adap,
return -ENOMEM;
adap->conn = conn;
- adap->conn_pads = kcalloc(1, sizeof(*adap->conn_pads),
- GFP_KERNEL);
+ adap->conn_pads = kzalloc(sizeof(*adap->conn_pads), GFP_KERNEL);
if (!adap->conn_pads)
return -ENOMEM;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] [media] dvbdev: the space is required after ','
2016-01-15 5:14 [PATCH 0/3] [media] dvbdev: clean up the code Xiubo Li
2016-01-15 5:14 ` [PATCH 1/3] [media] dvbdev: replace kcalloc with kzalloc Xiubo Li
@ 2016-01-15 5:14 ` Xiubo Li
2016-01-15 5:15 ` [PATCH 3/3] [media] dvbdev: remove useless parentheses after return Xiubo Li
2 siblings, 0 replies; 4+ messages in thread
From: Xiubo Li @ 2016-01-15 5:14 UTC (permalink / raw)
To: m.chehab; +Cc: linux-media, Xiubo Li
The space is missing after ',', and this will be introduce much
noise when checking new patch around them.
Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
---
drivers/media/dvb-core/dvbdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index f38fabe..3b6e79e 100644
--- a/drivers/media/dvb-core/dvbdev.c
+++ b/drivers/media/dvb-core/dvbdev.c
@@ -58,7 +58,7 @@ static const char * const dnames[] = {
#define DVB_MAX_IDS MAX_DVB_MINORS
#else
#define DVB_MAX_IDS 4
-#define nums2minor(num,type,id) ((num << 6) | (id << 4) | type)
+#define nums2minor(num, type, id) ((num << 6) | (id << 4) | type)
#define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64)
#endif
@@ -85,7 +85,7 @@ static int dvb_device_open(struct inode *inode, struct file *file)
file->private_data = dvbdev;
replace_fops(file, new_fops);
if (file->f_op->open)
- err = file->f_op->open(inode,file);
+ err = file->f_op->open(inode, file);
up_read(&minor_rwsem);
mutex_unlock(&dvbdev_mutex);
return err;
@@ -867,7 +867,7 @@ int dvb_usercopy(struct file *file,
parg = sbuf;
} else {
/* too big to allocate from stack */
- mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL);
+ mbuf = kmalloc(_IOC_SIZE(cmd), GFP_KERNEL);
if (NULL == mbuf)
return -ENOMEM;
parg = mbuf;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] [media] dvbdev: remove useless parentheses after return
2016-01-15 5:14 [PATCH 0/3] [media] dvbdev: clean up the code Xiubo Li
2016-01-15 5:14 ` [PATCH 1/3] [media] dvbdev: replace kcalloc with kzalloc Xiubo Li
2016-01-15 5:14 ` [PATCH 2/3] [media] dvbdev: the space is required after ',' Xiubo Li
@ 2016-01-15 5:15 ` Xiubo Li
2 siblings, 0 replies; 4+ messages in thread
From: Xiubo Li @ 2016-01-15 5:15 UTC (permalink / raw)
To: m.chehab; +Cc: linux-media, Xiubo Li
The parentheses are not required after return, and just remove it.
Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
---
drivers/media/dvb-core/dvbdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index 3b6e79e..a6c26b5 100644
--- a/drivers/media/dvb-core/dvbdev.c
+++ b/drivers/media/dvb-core/dvbdev.c
@@ -352,7 +352,7 @@ static int dvb_create_media_entity(struct dvb_device *dvbdev,
ret = media_device_register_entity(dvbdev->adapter->mdev,
dvbdev->entity);
if (ret)
- return (ret);
+ return ret;
printk(KERN_DEBUG "%s: media entity '%s' registered.\n",
__func__, dvbdev->entity->name);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-15 5:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-15 5:14 [PATCH 0/3] [media] dvbdev: clean up the code Xiubo Li
2016-01-15 5:14 ` [PATCH 1/3] [media] dvbdev: replace kcalloc with kzalloc Xiubo Li
2016-01-15 5:14 ` [PATCH 2/3] [media] dvbdev: the space is required after ',' Xiubo Li
2016-01-15 5:15 ` [PATCH 3/3] [media] dvbdev: remove useless parentheses after return Xiubo Li
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).