* [PATCH 0/3] Pinctrl-Rockchip: Adjustments for six functions
@ 2017-12-23 21:36 SF Markus Elfring
2017-12-23 21:38 ` [PATCH 1/3] pinctrl: rockchip: Delete error messages for a failed memory allocation in two functions SF Markus Elfring
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: SF Markus Elfring @ 2017-12-23 21:36 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 23 Dec 2017 22:33:44 +0100
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete error messages for a failed memory allocation in two functions
Improve a size determination in rockchip_pinctrl_probe()
Fix a typo in four comment lines
drivers/pinctrl/pinctrl-rockchip.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
--
2.15.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] pinctrl: rockchip: Delete error messages for a failed memory allocation in two functions
2017-12-23 21:36 [PATCH 0/3] Pinctrl-Rockchip: Adjustments for six functions SF Markus Elfring
@ 2017-12-23 21:38 ` SF Markus Elfring
2018-01-02 8:46 ` Linus Walleij
2017-12-23 21:40 ` [PATCH 2/3] pinctrl: rockchip: Improve a size determination in rockchip_pinctrl_probe() SF Markus Elfring
2017-12-23 21:42 ` [PATCH 3/3] pinctrl: rockchip: Fix a typo in four comment lines SF Markus Elfring
2 siblings, 1 reply; 7+ messages in thread
From: SF Markus Elfring @ 2017-12-23 21:38 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 23 Dec 2017 22:02:47 +0100
Omit extra messages for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/pinctrl/pinctrl-rockchip.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 2ba17548ad5b..285169170eb2 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -2400,18 +2400,14 @@ static int rockchip_pinctrl_parse_dt(struct platform_device *pdev,
info->functions = devm_kzalloc(dev, info->nfunctions *
sizeof(struct rockchip_pmx_func),
GFP_KERNEL);
- if (!info->functions) {
- dev_err(dev, "failed to allocate memory for function list\n");
+ if (!info->functions)
return -EINVAL;
- }
info->groups = devm_kzalloc(dev, info->ngroups *
sizeof(struct rockchip_pin_group),
GFP_KERNEL);
- if (!info->groups) {
- dev_err(dev, "failed allocate memory for ping group list\n");
+ if (!info->groups)
return -EINVAL;
- }
i = 0;
@@ -2447,10 +2443,9 @@ static int rockchip_pinctrl_register(struct platform_device *pdev,
pindesc = devm_kzalloc(&pdev->dev, sizeof(*pindesc) *
info->ctrl->nr_pins, GFP_KERNEL);
- if (!pindesc) {
- dev_err(&pdev->dev, "mem alloc for pin descriptors failed\n");
+ if (!pindesc)
return -ENOMEM;
- }
+
ctrldesc->pins = pindesc;
ctrldesc->npins = info->ctrl->nr_pins;
--
2.15.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] pinctrl: rockchip: Improve a size determination in rockchip_pinctrl_probe()
2017-12-23 21:36 [PATCH 0/3] Pinctrl-Rockchip: Adjustments for six functions SF Markus Elfring
2017-12-23 21:38 ` [PATCH 1/3] pinctrl: rockchip: Delete error messages for a failed memory allocation in two functions SF Markus Elfring
@ 2017-12-23 21:40 ` SF Markus Elfring
2018-01-02 8:47 ` Linus Walleij
2017-12-23 21:42 ` [PATCH 3/3] pinctrl: rockchip: Fix a typo in four comment lines SF Markus Elfring
2 siblings, 1 reply; 7+ messages in thread
From: SF Markus Elfring @ 2017-12-23 21:40 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 23 Dec 2017 22:07:30 +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/pinctrl/pinctrl-rockchip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 285169170eb2..5e76a6d8a1cb 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -3158,7 +3158,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
return -ENODEV;
}
- info = devm_kzalloc(dev, sizeof(struct rockchip_pinctrl), GFP_KERNEL);
+ info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
--
2.15.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] pinctrl: rockchip: Fix a typo in four comment lines
2017-12-23 21:36 [PATCH 0/3] Pinctrl-Rockchip: Adjustments for six functions SF Markus Elfring
2017-12-23 21:38 ` [PATCH 1/3] pinctrl: rockchip: Delete error messages for a failed memory allocation in two functions SF Markus Elfring
2017-12-23 21:40 ` [PATCH 2/3] pinctrl: rockchip: Improve a size determination in rockchip_pinctrl_probe() SF Markus Elfring
@ 2017-12-23 21:42 ` SF Markus Elfring
2018-01-02 8:48 ` Linus Walleij
2 siblings, 1 reply; 7+ messages in thread
From: SF Markus Elfring @ 2017-12-23 21:42 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 23 Dec 2017 22:22:54 +0100
Adjust words in these descriptions.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/pinctrl/pinctrl-rockchip.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 5e76a6d8a1cb..1cd85411e906 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -136,7 +136,7 @@ struct rockchip_drv {
* @iomux: array describing the 4 iomux sources of the bank
* @drv: array describing the 4 drive strength sources of the bank
* @pull_type: array describing the 4 pull type sources of the bank
- * @valid: are all necessary informations present
+ * @valid: is all necessary information present
* @of_node: dt node of this bank
* @drvdata: common pinctrl basedata
* @domain: irqdomain of the gpio bank
@@ -1988,7 +1988,7 @@ static int rockchip_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,
info->functions[selector].name, info->groups[group].name);
/*
- * for each pin in the pin group selected, program the correspoding pin
+ * for each pin in the pin group selected, program the corresponding
* pin function number in the config register.
*/
for (cnt = 0; cnt < info->groups[group].npins; cnt++) {
@@ -2527,7 +2527,7 @@ static int rockchip_gpio_get(struct gpio_chip *gc, unsigned offset)
/*
* gpiolib gpio_direction_input callback function. The setting of the pin
- * mux function as 'gpio input' will be handled by the pinctrl susbsystem
+ * mux function as 'gpio input' will be handled by the pinctrl subsystem
* interface.
*/
static int rockchip_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
@@ -2537,7 +2537,7 @@ static int rockchip_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
/*
* gpiolib gpio_direction_output callback function. The setting of the pin
- * mux function as 'gpio output' will be handled by the pinctrl susbsystem
+ * mux function as 'gpio output' will be handled by the pinctrl subsystem
* interface.
*/
static int rockchip_gpio_direction_output(struct gpio_chip *gc,
--
2.15.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/3] pinctrl: rockchip: Delete error messages for a failed memory allocation in two functions
2017-12-23 21:38 ` [PATCH 1/3] pinctrl: rockchip: Delete error messages for a failed memory allocation in two functions SF Markus Elfring
@ 2018-01-02 8:46 ` Linus Walleij
0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2018-01-02 8:46 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Dec 23, 2017 at 10:38 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 23 Dec 2017 22:02:47 +0100
>
> Omit extra messages for a memory allocation failure in these functions.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] pinctrl: rockchip: Improve a size determination in rockchip_pinctrl_probe()
2017-12-23 21:40 ` [PATCH 2/3] pinctrl: rockchip: Improve a size determination in rockchip_pinctrl_probe() SF Markus Elfring
@ 2018-01-02 8:47 ` Linus Walleij
0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2018-01-02 8:47 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Dec 23, 2017 at 10:40 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 23 Dec 2017 22:07:30 +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>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] pinctrl: rockchip: Fix a typo in four comment lines
2017-12-23 21:42 ` [PATCH 3/3] pinctrl: rockchip: Fix a typo in four comment lines SF Markus Elfring
@ 2018-01-02 8:48 ` Linus Walleij
0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2018-01-02 8:48 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Dec 23, 2017 at 10:42 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 23 Dec 2017 22:22:54 +0100
>
> Adjust words in these descriptions.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-01-02 8:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-23 21:36 [PATCH 0/3] Pinctrl-Rockchip: Adjustments for six functions SF Markus Elfring
2017-12-23 21:38 ` [PATCH 1/3] pinctrl: rockchip: Delete error messages for a failed memory allocation in two functions SF Markus Elfring
2018-01-02 8:46 ` Linus Walleij
2017-12-23 21:40 ` [PATCH 2/3] pinctrl: rockchip: Improve a size determination in rockchip_pinctrl_probe() SF Markus Elfring
2018-01-02 8:47 ` Linus Walleij
2017-12-23 21:42 ` [PATCH 3/3] pinctrl: rockchip: Fix a typo in four comment lines SF Markus Elfring
2018-01-02 8:48 ` Linus Walleij
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).