Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1637319 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-05-08 11:20 +0200 |
| Last post | 2017-05-09 06:30 +0200 |
| Articles | 10 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/4] DMA-buf: Fine-tuning for four function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 11:20 +0200
[PATCH 4/4] dma-buf: Use seq_putc() in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 11:20 +0200
Re: [PATCH 4/4] dma-buf: Use seq_putc() in two functions Gustavo Padovan <gustavo@padovan.org> - 2017-05-08 16:40 +0200
[PATCH 1/4] dma-buf: Combine two function calls into one in dma_buf_debug_show() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 11:20 +0200
Re: [PATCH 1/4] dma-buf: Combine two function calls into one in dma_buf_debug_show() Gustavo Padovan <gustavo@padovan.org> - 2017-05-08 16:40 +0200
[PATCH 3/4] dma-buf: Adjust a null pointer check in dma_buf_attach() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 11:20 +0200
Re: [PATCH 3/4] dma-buf: Adjust a null pointer check in dma_buf_attach() Gustavo Padovan <gustavo@padovan.org> - 2017-05-08 16:40 +0200
[PATCH 2/4] dma-buf: Improve a size determination in dma_buf_attach() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 11:20 +0200
Re: [PATCH 2/4] dma-buf: Improve a size determination in dma_buf_attach() Gustavo Padovan <gustavo@padovan.org> - 2017-05-08 16:40 +0200
Re: [PATCH 0/4] DMA-buf: Fine-tuning for four function implementations Sumit Semwal <sumit.semwal@linaro.org> - 2017-05-09 06:30 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-08 11:20 +0200 |
| Subject | [PATCH 0/4] DMA-buf: Fine-tuning for four function implementations |
| Message-ID | <tEMZI-1ZS-5@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 8 May 2017 11:05:05 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (4): Combine two function calls into one in dma_buf_debug_show() Improve a size determination in dma_buf_attach() Adjust a null pointer check in dma_buf_attach() Use seq_putc() in two functions drivers/dma-buf/dma-buf.c | 8 +++----- drivers/dma-buf/sync_debug.c | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) -- 2.12.2
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-08 11:20 +0200 |
| Subject | [PATCH 4/4] dma-buf: Use seq_putc() in two functions |
| Message-ID | <tEMZI-1ZS-17@gated-at.bofh.it> |
| In reply to | #1637319 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 8 May 2017 10:55:42 +0200 Three single characters (line breaks) should be put into a sequence. Thus use the corresponding function "seq_putc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/dma-buf/sync_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c index c769dc653b34..a0d780ab68c3 100644 --- a/drivers/dma-buf/sync_debug.c +++ b/drivers/dma-buf/sync_debug.c @@ -110,7 +110,7 @@ static void sync_print_fence(struct seq_file *s, } } - seq_puts(s, "\n"); + seq_putc(s, '\n'); } static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj) @@ -161,7 +161,7 @@ static int sync_debugfs_show(struct seq_file *s, void *unused) sync_timeline_list); sync_print_obj(s, obj); - seq_puts(s, "\n"); + seq_putc(s, '\n'); } spin_unlock_irqrestore(&sync_timeline_list_lock, flags); @@ -173,7 +173,7 @@ static int sync_debugfs_show(struct seq_file *s, void *unused) container_of(pos, struct sync_file, sync_file_list); sync_print_sync_file(s, sync_file); - seq_puts(s, "\n"); + seq_putc(s, '\n'); } spin_unlock_irqrestore(&sync_file_list_lock, flags); return 0; -- 2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Gustavo Padovan <gustavo@padovan.org> |
|---|---|
| Date | 2017-05-08 16:40 +0200 |
| Subject | Re: [PATCH 4/4] dma-buf: Use seq_putc() in two functions |
| Message-ID | <tERZo-55q-23@gated-at.bofh.it> |
| In reply to | #1637322 |
Hi Markus, Thank for your patches. 2017-05-08 SF Markus Elfring <elfring@users.sourceforge.net>: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Mon, 8 May 2017 10:55:42 +0200 > > Three single characters (line breaks) should be put into a sequence. > Thus use the corresponding function "seq_putc". > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> > --- > drivers/dma-buf/sync_debug.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com> Gustavo
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-08 11:20 +0200 |
| Subject | [PATCH 1/4] dma-buf: Combine two function calls into one in dma_buf_debug_show() |
| Message-ID | <tEMZI-1ZS-19@gated-at.bofh.it> |
| In reply to | #1637319 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 May 2017 10:32:44 +0200
A bit of data was put into a sequence by two separate function calls.
Print the same data by a single function call instead.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/dma-buf/dma-buf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 512bdbc23bbb..53257c166f4d 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -1122,9 +1122,7 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
attach_count = 0;
list_for_each_entry(attach_obj, &buf_obj->attachments, node) {
- seq_puts(s, "\t");
-
- seq_printf(s, "%s\n", dev_name(attach_obj->dev));
+ seq_printf(s, "\t%s\n", dev_name(attach_obj->dev));
attach_count++;
}
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Gustavo Padovan <gustavo@padovan.org> |
|---|---|
| Date | 2017-05-08 16:40 +0200 |
| Subject | Re: [PATCH 1/4] dma-buf: Combine two function calls into one in dma_buf_debug_show() |
| Message-ID | <tERZp-55q-31@gated-at.bofh.it> |
| In reply to | #1637323 |
2017-05-08 SF Markus Elfring <elfring@users.sourceforge.net>: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Mon, 8 May 2017 10:32:44 +0200 > > A bit of data was put into a sequence by two separate function calls. > Print the same data by a single function call instead. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> > --- > drivers/dma-buf/dma-buf.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com> Gustavo
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-08 11:20 +0200 |
| Subject | [PATCH 3/4] dma-buf: Adjust a null pointer check in dma_buf_attach() |
| Message-ID | <tEMZI-1ZS-15@gated-at.bofh.it> |
| In reply to | #1637319 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 8 May 2017 10:54:17 +0200 The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written "!attach" Thus adjust this expression. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/dma-buf/dma-buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 9887d72cf804..4a038dcf5361 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -559,7 +559,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, return ERR_PTR(-EINVAL); attach = kzalloc(sizeof(*attach), GFP_KERNEL); - if (attach == NULL) + if (!attach) return ERR_PTR(-ENOMEM); attach->dev = dev; -- 2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Gustavo Padovan <gustavo@padovan.org> |
|---|---|
| Date | 2017-05-08 16:40 +0200 |
| Subject | Re: [PATCH 3/4] dma-buf: Adjust a null pointer check in dma_buf_attach() |
| Message-ID | <tERZo-55q-21@gated-at.bofh.it> |
| In reply to | #1637324 |
2017-05-08 SF Markus Elfring <elfring@users.sourceforge.net>: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Mon, 8 May 2017 10:54:17 +0200 > > The script "checkpatch.pl" pointed information out like the following. > > Comparison to NULL could be written "!attach" > > Thus adjust this expression. > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> > --- > drivers/dma-buf/dma-buf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com> Gustavo
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-08 11:20 +0200 |
| Subject | [PATCH 2/4] dma-buf: Improve a size determination in dma_buf_attach() |
| Message-ID | <tEMZI-1ZS-21@gated-at.bofh.it> |
| In reply to | #1637319 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Mon, 8 May 2017 10:50:09 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/dma-buf/dma-buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 53257c166f4d..9887d72cf804 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -558,7 +558,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, if (WARN_ON(!dmabuf || !dev)) return ERR_PTR(-EINVAL); - attach = kzalloc(sizeof(struct dma_buf_attachment), GFP_KERNEL); + attach = kzalloc(sizeof(*attach), GFP_KERNEL); if (attach == NULL) return ERR_PTR(-ENOMEM); -- 2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Gustavo Padovan <gustavo@padovan.org> |
|---|---|
| Date | 2017-05-08 16:40 +0200 |
| Subject | Re: [PATCH 2/4] dma-buf: Improve a size determination in dma_buf_attach() |
| Message-ID | <tERZo-55q-25@gated-at.bofh.it> |
| In reply to | #1637325 |
2017-05-08 SF Markus Elfring <elfring@users.sourceforge.net>: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Mon, 8 May 2017 10:50:09 +0200 > > Replace the specification of a data structure by a pointer dereference > as the parameter for the operator "sizeof" to make the corresponding size > determination a bit safer according to the Linux coding style convention. > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> > --- > drivers/dma-buf/dma-buf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com> Gustavo
[toc] | [prev] | [next] | [standalone]
| From | Sumit Semwal <sumit.semwal@linaro.org> |
|---|---|
| Date | 2017-05-09 06:30 +0200 |
| Message-ID | <tF4WB-54x-1@gated-at.bofh.it> |
| In reply to | #1637319 |
Hello Markus, On 8 May 2017 at 14:40, SF Markus Elfring <elfring@users.sourceforge.net> wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Mon, 8 May 2017 11:05:05 +0200 > > A few update suggestions were taken into account > from static source code analysis. > > Markus Elfring (4): > Combine two function calls into one in dma_buf_debug_show() > Improve a size determination in dma_buf_attach() > Adjust a null pointer check in dma_buf_attach() > Use seq_putc() in two functions All queued up in drm-misc-next now. Thanks! > > drivers/dma-buf/dma-buf.c | 8 +++----- > drivers/dma-buf/sync_debug.c | 6 +++--- > 2 files changed, 6 insertions(+), 8 deletions(-) > > -- > 2.12.2 > Best regards, Sumit.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web