* [PATCH 0/2] sn/ioc3: Adjustments for ioc3_probe()
@ 2017-12-13 19:05 SF Markus Elfring
2017-12-13 19:07 ` [PATCH 1/2] sn/ioc3: Delete an error message for a failed memory allocation in ioc3_probe() SF Markus Elfring
2017-12-13 19:08 ` [PATCH 2/2] sn/ioc3: Improve a size determination " SF Markus Elfring
0 siblings, 2 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-12-13 19:05 UTC (permalink / raw)
To: kernel-janitors; +Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 13 Dec 2017 20:03:45 +0100
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Delete an error message for a failed memory allocation
Improve a size determination
drivers/sn/ioc3.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--
2.15.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] sn/ioc3: Delete an error message for a failed memory allocation in ioc3_probe()
2017-12-13 19:05 [PATCH 0/2] sn/ioc3: Adjustments for ioc3_probe() SF Markus Elfring
@ 2017-12-13 19:07 ` SF Markus Elfring
2017-12-13 19:08 ` [PATCH 2/2] sn/ioc3: Improve a size determination " SF Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-12-13 19:07 UTC (permalink / raw)
To: kernel-janitors; +Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 13 Dec 2017 19:39:18 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/sn/ioc3.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c
index fb7ea0d9a734..2e6e0514d8f7 100644
--- a/drivers/sn/ioc3.c
+++ b/drivers/sn/ioc3.c
@@ -631,9 +631,6 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
/* Set up per-IOC3 data */
idd = kzalloc(sizeof(struct ioc3_driver_data), GFP_KERNEL);
if (!idd) {
- printk(KERN_WARNING
- "%s: Failed to allocate IOC3 data for pci_dev %s.\n",
- __func__, pci_name(pdev));
ret = -ENODEV;
goto out_idd;
}
--
2.15.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] sn/ioc3: Improve a size determination in ioc3_probe()
2017-12-13 19:05 [PATCH 0/2] sn/ioc3: Adjustments for ioc3_probe() SF Markus Elfring
2017-12-13 19:07 ` [PATCH 1/2] sn/ioc3: Delete an error message for a failed memory allocation in ioc3_probe() SF Markus Elfring
@ 2017-12-13 19:08 ` SF Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-12-13 19:08 UTC (permalink / raw)
To: kernel-janitors; +Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 13 Dec 2017 19:53:18 +0100
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/sn/ioc3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c
index 2e6e0514d8f7..1cacc6178e6f 100644
--- a/drivers/sn/ioc3.c
+++ b/drivers/sn/ioc3.c
@@ -629,7 +629,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
#endif
/* Set up per-IOC3 data */
- idd = kzalloc(sizeof(struct ioc3_driver_data), GFP_KERNEL);
+ idd = kzalloc(sizeof(*idd), GFP_KERNEL);
if (!idd) {
ret = -ENODEV;
goto out_idd;
--
2.15.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-13 19:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-13 19:05 [PATCH 0/2] sn/ioc3: Adjustments for ioc3_probe() SF Markus Elfring
2017-12-13 19:07 ` [PATCH 1/2] sn/ioc3: Delete an error message for a failed memory allocation in ioc3_probe() SF Markus Elfring
2017-12-13 19:08 ` [PATCH 2/2] sn/ioc3: Improve a size determination " SF Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome