Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1725578 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-09-02 22:50 +0200 |
| Last post | 2017-09-02 22:50 +0200 |
| Articles | 4 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/7] [media] Mantis: Adjustments for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-02 22:50 +0200
[PATCH 6/7] [media] Mantis: Improve a size determination in mantis_pci_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-02 22:50 +0200
[PATCH 2/7] [media] Hopper: Improve a size determination in hopper_pci_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-02 22:50 +0200
[PATCH 4/7] [media] Hopper: Delete an unnecessary variable initialisation in hopper_pci_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-02 22:50 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-02 22:50 +0200 |
| Subject | [PATCH 0/7] [media] Mantis: Adjustments for three function implementations |
| Message-ID | <ulnwC-7AM-3@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Sat, 2 Sep 2017 22:18:22 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (7): Delete an error message for a failed memory allocation in hopper_pci_probe() Improve a size determination in hopper_pci_probe() Adjust a null pointer check in two functions Delete an unnecessary variable initialisation in hopper_pci_probe() Delete an error message for a failed memory allocation in mantis_pci_probe() Improve a size determination in mantis_pci_probe() Delete an unnecessary variable initialisation in mantis_pci_probe() drivers/media/pci/mantis/hopper_cards.c | 9 ++++----- drivers/media/pci/mantis/mantis_cards.c | 8 +++----- 2 files changed, 7 insertions(+), 10 deletions(-) -- 2.14.1
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-02 22:50 +0200 |
| Subject | [PATCH 6/7] [media] Mantis: Improve a size determination in mantis_pci_probe() |
| Message-ID | <ulnwC-7AM-13@gated-at.bofh.it> |
| In reply to | #1725578 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Sat, 2 Sep 2017 21:56:07 +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. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/media/pci/mantis/mantis_cards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/mantis/mantis_cards.c b/drivers/media/pci/mantis/mantis_cards.c index 56a01f6f84c7..6182ae44dd23 100644 --- a/drivers/media/pci/mantis/mantis_cards.c +++ b/drivers/media/pci/mantis/mantis_cards.c @@ -173,5 +173,5 @@ static int mantis_pci_probe(struct pci_dev *pdev, struct mantis_hwconfig *config; int err = 0; - mantis = kzalloc(sizeof(struct mantis_pci), GFP_KERNEL); + mantis = kzalloc(sizeof(*mantis), GFP_KERNEL); if (!mantis) -- 2.14.1
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-02 22:50 +0200 |
| Subject | [PATCH 2/7] [media] Hopper: Improve a size determination in hopper_pci_probe() |
| Message-ID | <ulnwC-7AM-15@gated-at.bofh.it> |
| In reply to | #1725578 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 2 Sep 2017 21:21:22 +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.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/pci/mantis/hopper_cards.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c
index cc1bb04d8cb4..fe7b40c306f7 100644
--- a/drivers/media/pci/mantis/hopper_cards.c
+++ b/drivers/media/pci/mantis/hopper_cards.c
@@ -163,7 +163,7 @@ static int hopper_pci_probe(struct pci_dev *pdev,
struct mantis_hwconfig *config;
int err = 0;
- mantis = kzalloc(sizeof(struct mantis_pci), GFP_KERNEL);
+ mantis = kzalloc(sizeof(*mantis), GFP_KERNEL);
if (mantis == NULL) {
err = -ENOMEM;
goto fail0;
--
2.14.1
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-02 22:50 +0200 |
| Subject | [PATCH 4/7] [media] Hopper: Delete an unnecessary variable initialisation in hopper_pci_probe() |
| Message-ID | <ulnwC-7AM-17@gated-at.bofh.it> |
| In reply to | #1725578 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Sat, 2 Sep 2017 21:50:55 +0200 The variable "err" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/media/pci/mantis/hopper_cards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c index 88e5b2a97005..3826be19c156 100644 --- a/drivers/media/pci/mantis/hopper_cards.c +++ b/drivers/media/pci/mantis/hopper_cards.c @@ -161,6 +161,6 @@ static int hopper_pci_probe(struct pci_dev *pdev, struct mantis_pci_drvdata *drvdata; struct mantis_pci *mantis; struct mantis_hwconfig *config; - int err = 0; + int err; mantis = kzalloc(sizeof(*mantis), GFP_KERNEL); -- 2.14.1
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web