MFD: Adjustments for several function implementations
Subsystems (4)
v2 cover MFD: Adjustments for several function implementations
From: Markus Elfring <[email protected]>
Date: Fri, 9 Mar 2018 10:24:42 +0100
Several update suggestions were taken into account from static source code analysis.
Markus Elfring (17):
abx500-core: Adjustments for eight function implementations
si476x-i2c: Delete an error message for a failed memory allocation
in si476x_core_probe()
sm501: Adjustments for five function implementations
smsc-ece1099: Improve a size determination in smsc_i2c_probe()
ti_am335x_tscadc: Delete an error message for a failed memory allocation
in ti_tscadc_probe()
tps65090: Delete an error message for a failed memory allocation
in tps65090_i2c_probe()
tps6586x: Delete an error message for a failed memory allocation
in tps6586x_parse_dt()
tps65910: Adjustments for four function implementations
tps80031: Delete an error message for a failed memory allocation
in tps80031_probe()
twl6030-irq: Delete an error message for a failed memory allocation
in twl6030_init_irq() viperboard: Delete an error message for a failed memory allocation
in vprbrd_probe()
---
v2:
Lee Jones requested a resend for some of these patches. Thus several changes were rebased on source files from Linux next-20180308.
drivers/mfd/abx500-core.c | 25 +++++++++++-------------- drivers/mfd/si476x-i2c.c | 6 ++---- drivers/mfd/sm501.c | 30 +++++++++++++----------------- drivers/mfd/smsc-ece1099.c | 3 +-- drivers/mfd/ti_am335x_tscadc.c | 5 ++--- drivers/mfd/tps65090.c | 4 +--- drivers/mfd/tps6586x.c | 4 +--- drivers/mfd/tps65910.c | 18 ++++++++---------- drivers/mfd/tps80031.c | 4 +--- drivers/mfd/twl6030-irq.c | 4 +--- drivers/mfd/viperboard.c | 4 +--- 11 files changed, 42 insertions(+), 65 deletions(-)
Signature · 1 line
2.16.2
v2 cover mfd/abx500-core: Adjustments for eight function implementations
From: Markus Elfring <[email protected]>
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete an error message for a failed memory allocation
in abx500_register_ops()
Improve two size determinations in abx500_register_ops() Adjust 14 checks for null pointers
---
v2:
Lee Jones requested a resend for these patches. The changes were rebased on source files from Linux next-20180308.
drivers/mfd/abx500-core.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
Signature · 1 line
2.15.1
PATCH v2 1/3 mfd: abx500-core: Delete an error message for a failed memory allocation in abx500_register_ops()
From: Markus Elfring <[email protected]>
Date: Thu, 8 Mar 2018 11:44:33 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/abx500-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mfd/abx500-core.c +2 -3
@@ -40,10 +40,9 @@ int abx500_register_ops(struct device *dev, struct abx500_ops *ops) dev_entry =devm_kzalloc (dev,sizeof (struct abx500_device_entry ),GFP_KERNEL ); -if (!dev_entry) { -dev_err (dev,"register_ops kzalloc failed" ); +if (!dev_entry)return -ENOMEM ; - } + dev_entry->dev = dev;memcpy (&dev_entry->ops, ops,sizeof (struct abx500_ops ));
Signature · 1 line
2.16.2
PATCH v2 2/3 mfd: abx500-core: Improve two size determinations in abx500_register_ops()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Thu, 8 Mar 2018 12:46:47 +0100
Replace the specification of two data structures by pointer dereferences 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.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/abx500-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mfd/abx500-core.c +2 -4
@@ -37,14 +37,12 @@ int abx500_register_ops(struct device *dev, struct abx500_ops *ops) {struct abx500_device_entry *dev_entry; - dev_entry =devm_kzalloc (dev, -sizeof (struct abx500_device_entry ), -GFP_KERNEL ); + dev_entry =devm_kzalloc (dev,sizeof (*dev_entry),GFP_KERNEL );if (!dev_entry)return -ENOMEM ; dev_entry->dev = dev; -memcpy (&dev_entry->ops, ops,sizeof (struct abx500_ops )); +memcpy (&dev_entry->ops, ops,sizeof (*ops));list_add_tail (&dev_entry->list, &abx500_list);return 0 ;
Signature · 1 line
2.16.2
PATCH v2 3/3 mfd: abx500-core: Adjust 14 checks for null pointers
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Thu, 8 Mar 2018 12:50:12 +0100
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written …
Thus fix the affected source code places.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/abx500-core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/mfd/abx500-core.c +7 -7
@@ -65,7 +65,7 @@ int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,struct abx500_ops *ops;lookup_ops (dev->parent, &ops); -if ((ops !=NULL ) && (ops->set_register !=NULL )) +if (ops && ops->set_register)return ops->set_register (dev, bank, reg, value);else return -ENOTSUPP ;
@@ -78,7 +78,7 @@ int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg,struct abx500_ops *ops;lookup_ops (dev->parent, &ops); -if ((ops !=NULL ) && (ops->get_register !=NULL )) +if (ops && ops->get_register)return ops->get_register (dev, bank, reg, value);else return -ENOTSUPP ;
@@ -91,7 +91,7 @@ int abx500_get_register_page_interruptible(struct device *dev, u8 bank,struct abx500_ops *ops;lookup_ops (dev->parent, &ops); -if ((ops !=NULL ) && (ops->get_register_page !=NULL )) +if (ops && ops->get_register_page)return ops->get_register_page (dev, bank, first_reg, regvals, numregs);else
@@ -105,7 +105,7 @@ int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank,struct abx500_ops *ops;lookup_ops (dev->parent, &ops); -if ((ops !=NULL ) && (ops->mask_and_set_register !=NULL )) +if (ops && ops->mask_and_set_register)return ops->mask_and_set_register (dev, bank, reg, bitmask, bitvalues);else
@@ -118,7 +118,7 @@ int abx500_get_chip_id(struct device *dev)struct abx500_ops *ops;lookup_ops (dev->parent, &ops); -if ((ops !=NULL ) && (ops->get_chip_id !=NULL )) +if (ops && ops->get_chip_id)return ops->get_chip_id (dev);else return -ENOTSUPP ;
@@ -130,7 +130,7 @@ int abx500_event_registers_startup_state_get(struct device *dev, u8 *event)struct abx500_ops *ops;lookup_ops (dev->parent, &ops); -if ((ops !=NULL ) && (ops->event_registers_startup_state_get !=NULL )) +if (ops && ops->event_registers_startup_state_get)return ops->event_registers_startup_state_get (dev, event);else return -ENOTSUPP ;
@@ -142,7 +142,7 @@ int abx500_startup_irq_enabled(struct device *dev, unsigned int irq)struct abx500_ops *ops;lookup_ops (dev->parent, &ops); -if ((ops !=NULL ) && (ops->startup_irq_enabled !=NULL )) +if (ops && ops->startup_irq_enabled)return ops->startup_irq_enabled (dev, irq);else return -ENOTSUPP ;
Signature · 1 line
2.16.2
Re: [PATCH v2 0/3] mfd/abx500-core: Adjustments for eight function implementations
In reply to SF Markus ElfringQuoted 4 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Three update suggestions were taken into account
from static source code analysis.
The series:
Yours,
Linus Walleij
PATCH v2 4/17 mfd: si476x-i2c: Delete an error message for a failed memory allocation in si476x_core_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Thu, 8 Mar 2018 13:45:31 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/si476x-i2c.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mfd/si476x-i2c.c +2 -4
@@ -697,11 +697,9 @@ static int si476x_core_probe(struct i2c_client *client,int cell_num; core =devm_kzalloc (&client->dev,sizeof (*core),GFP_KERNEL ); -if (!core) { -dev_err (&client->dev, -"failed to allocate 'struct si476x_core'\n" ); +if (!core)return -ENOMEM ; - } + core->client = client; core->regmap =devm_regmap_init_si476x (core);
Signature · 1 line
2.16.2
v2 cover mfd/sm501: Adjustments for five function implementations
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Improve a size determination in two functions
Adjust 12 checks for null pointers
---
v2:
Lee Jones requested a resend for these patches. The changes were rebased on source files from Linux next-20180308.
drivers/mfd/sm501.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-)
Signature · 1 line
2.15.1
PATCH v2 1/2 mfd: sm501: Improve a size determination in two functions
From: Markus Elfring <[email protected]>
Date: Thu, 8 Mar 2018 14:05:41 +0100
Replace the specification of data structures by pointer dereferences 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.
---
v2:
Lee Jones requested a different source code layout for this transformation. The change was rebased on source files from Linux next-20180308.
drivers/mfd/sm501.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/sm501.c +2 -2
@@ -1383,7 +1383,7 @@ static int sm501_plat_probe(struct platform_device *dev)struct sm501_devdata *sm;int ret; - sm =kzalloc (sizeof (struct sm501_devdata ),GFP_KERNEL ); + sm =kzalloc (sizeof (*sm),GFP_KERNEL );if (sm =NULL ) { ret = -ENOMEM ; goto err1;
@@ -1572,7 +1572,7 @@ static int sm501_pci_probe(struct pci_dev *dev,struct sm501_devdata *sm;int err; - sm =kzalloc (sizeof (struct sm501_devdata ),GFP_KERNEL ); + sm =kzalloc (sizeof (*sm),GFP_KERNEL );if (sm =NULL ) { err = -ENOMEM ; goto err1;
Signature · 1 line
2.16.2
PATCH v2 2/2 mfd: sm501: Adjust 12 checks for null pointers
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Thu, 8 Mar 2018 14:20:06 +0100
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written …
Thus fix the affected source code places.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/sm501.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-)
drivers/mfd/sm501.c +11 -15
@@ -1050,13 +1050,13 @@ static int sm501_register_gpio(struct sm501_devdata *sm)spin_lock_init (&gpio->lock); gpio->regs_res =request_mem_region (iobase,0x20 ,"sm501-gpio" ); -if (gpio->regs_res =NULL ) { +if (!gpio->regs_res) {dev_err (sm->dev,"gpio: failed to request region\n" );return -ENXIO ; } gpio->regs =ioremap (iobase,0x20 ); -if (gpio->regs =NULL ) { +if (!gpio->regs) {dev_err (sm->dev,"gpio: failed to remap registers\n" ); ret = -ENXIO ; goto err_claimed;
@@ -1358,7 +1358,7 @@ static int sm501_init_dev(struct sm501_devdata *sm)sm501_register_gpio (sm); } -if (pdata && pdata->gpio_i2c !=NULL && pdata->gpio_i2c_nr >0 ) { +if (pdata && pdata->gpio_i2c && pdata->gpio_i2c_nr >0 ) {if (!sm501_gpio_isregistered (sm))dev_err (sm->dev,"no gpio available for i2c gpio.\n" );else
@@ -1384,7 +1384,7 @@ static int sm501_plat_probe(struct platform_device *dev)int ret; sm =kzalloc (sizeof (*sm),GFP_KERNEL ); -if (sm =NULL ) { +if (!sm) { ret = -ENOMEM ; goto err1; }
@@ -1402,8 +1402,7 @@ static int sm501_plat_probe(struct platform_device *dev) sm->io_res =platform_get_resource (dev,IORESOURCE_MEM ,1 ); sm->mem_res =platform_get_resource (dev,IORESOURCE_MEM ,0 ); - -if (sm->io_res =NULL || sm->mem_res =NULL ) { +if (!sm->io_res || !sm->mem_res) {dev_err (&dev->dev,"failed to get IO resource\n" ); ret = -ENOENT ; goto err_res;
@@ -1411,8 +1410,7 @@ static int sm501_plat_probe(struct platform_device *dev) sm->regs_claim =request_mem_region (sm->io_res->start,0x100 ,"sm501" ); - -if (sm->regs_claim =NULL ) { +if (!sm->regs_claim) {dev_err (&dev->dev,"cannot claim registers\n" ); ret = -EBUSY ; goto err_res;
@@ -1421,8 +1419,7 @@ static int sm501_plat_probe(struct platform_device *dev)platform_set_drvdata (dev, sm); sm->regs =ioremap (sm->io_res->start,resource_size (sm->io_res)); - -if (sm->regs =NULL ) { +if (!sm->regs) {dev_err (&dev->dev,"cannot remap registers\n" ); ret = -EIO ; goto err_claim;
@@ -1448,7 +1445,7 @@ static void sm501_set_power(struct sm501_devdata *sm, int on) {struct sm501_platdata *pd = sm->platdata; -if (pd =NULL ) +if (!pd)return ;if (pd->get_power) {
@@ -1573,7 +1570,7 @@ static int sm501_pci_probe(struct pci_dev *dev,int err; sm =kzalloc (sizeof (*sm),GFP_KERNEL ); -if (sm =NULL ) { +if (!sm) { err = -ENOMEM ; goto err1; }
@@ -1624,15 +1621,14 @@ static int sm501_pci_probe(struct pci_dev *dev, sm->regs_claim =request_mem_region (sm->io_res->start,0x100 ,"sm501" ); -if (sm->regs_claim =NULL ) { +if (!sm->regs_claim) {dev_err (&dev->dev,"cannot claim registers\n" ); err= -EBUSY ; goto err3; } sm->regs =pci_ioremap_bar (dev,1 ); - -if (sm->regs =NULL ) { +if (!sm->regs) {dev_err (&dev->dev,"cannot remap registers\n" ); err = -EIO ; goto err4;
Signature · 1 line
2.16.2
PATCH v2 7/17 mfd: smsc-ece1099: Improve a size determination in smsc_i2c_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Thu, 8 Mar 2018 15:05:16 +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.
---
v2:
Lee Jones requested a different source code layout for this transformation. The change was rebased on source files from Linux next-20180308.
drivers/mfd/smsc-ece1099.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mfd/smsc-ece1099.c +1 -2
@@ -37,8 +37,7 @@ static int smsc_i2c_probe(struct i2c_client *i2c,int devid, rev, venid_l, venid_h;int ret; - smsc =devm_kzalloc (&i2c->dev,sizeof (struct smsc ), -GFP_KERNEL ); + smsc =devm_kzalloc (&i2c->dev,sizeof (*smsc),GFP_KERNEL );if (!smsc)return -ENOMEM ;
Signature · 1 line
2.16.2
PATCH v2 8/17 mfd: ti_am335x_tscadc: Delete an error message for a failed memory allocation in ti_tscadc_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Thu, 8 Mar 2018 15:15:51 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/ti_am335x_tscadc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mfd/ti_am335x_tscadc.c +2 -3
@@ -169,10 +169,9 @@ static int ti_tscadc_probe(struct platform_device *pdev)/* Allocate memory for device */ tscadc =devm_kzalloc (&pdev->dev,sizeof (*tscadc),GFP_KERNEL ); -if (!tscadc) { -dev_err (&pdev->dev,"failed to allocate memory.\n" ); +if (!tscadc)return -ENOMEM ; - } + tscadc->dev = &pdev->dev; err =platform_get_irq (pdev,0 );
Signature · 1 line
2.16.2
PATCH v2 9/17 mfd: tps65090: Delete an error message for a failed memory allocation in tps65090_i2c_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Thu, 8 Mar 2018 15:25:58 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/tps65090.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mfd/tps65090.c +1 -3
@@ -192,10 +192,8 @@ static int tps65090_i2c_probe(struct i2c_client *client, irq_base = pdata->irq_base; tps65090 =devm_kzalloc (&client->dev,sizeof (*tps65090),GFP_KERNEL ); -if (!tps65090) { -dev_err (&client->dev,"mem alloc for tps65090 failed\n" ); +if (!tps65090)return -ENOMEM ; - } tps65090->dev = &client->dev;i2c_set_clientdata (client, tps65090);
Signature · 1 line
2.16.2
PATCH v2 10/17 mfd: tps6586x: Delete an error message for a failed memory allocation in tps6586x_parse_dt()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Thu, 8 Mar 2018 15:30:54 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/tps6586x.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mfd/tps6586x.c +1 -3
@@ -423,10 +423,8 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clienstruct tps6586x_platform_data *pdata; pdata =devm_kzalloc (&client->dev,sizeof (*pdata),GFP_KERNEL ); -if (!pdata) { -dev_err (&client->dev,"Memory allocation failed\n" ); +if (!pdata)return NULL ; - } pdata->num_subdevs =0 ; pdata->subdevs =NULL ;
Signature · 1 line
2.16.2
v2 cover mfd/tps65910: Adjustments for four function implementations
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (4):
Delete an error message for a failed memory allocation in tps65910_parse_dt() Delete an unnecessary variable initialisation in four functions Delete an unnecessary variable initialisation in tps65910_sleepinit() Move an assignment in tps65910_sleepinit()
---
v2:
Lee Jones requested a resend for these patches. The changes were rebased on source files from Linux next-20180308.
drivers/mfd/tps65910.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
Signature · 1 line
2.15.1
PATCH v2 11/17 mfd: tps65910: Delete an error message for a failed memory allocation in tps65910_parse_dt()
From: Markus Elfring <[email protected]>
Date: Fri, 9 Mar 2018 09:00:59 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/tps65910.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mfd/tps65910.c +1 -3
@@ -395,10 +395,8 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, board_info =devm_kzalloc (&client->dev,sizeof (*board_info),GFP_KERNEL ); -if (!board_info) { -dev_err (&client->dev,"Failed to allocate pdata\n" ); +if (!board_info)return NULL ; - } ret =of_property_read_u32 (np,"ti,vmbch-threshold" , &prop);if (!ret)
Signature · 1 line
2.16.2
PATCH v2 2/4 mfd: tps65910: Delete an unnecessary variable initialisation in four functions
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Fri, 9 Mar 2018 09:06:14 +0100
The local variable "ret" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/tps65910.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/tps65910.c +4 -4
@@ -229,7 +229,7 @@ static struct regmap_irq_chip tps65910_irq_chip = {static int tps65910_irq_init (struct tps65910 *tps65910,int irq,struct tps65910_platform_data *pdata) { -int ret =0 ; +int ret;static struct regmap_irq_chip *tps6591x_irqs_chip;if (!irq) {
@@ -313,7 +313,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910, struct tps65910_board *pmic_pdata) {struct device *dev =NULL ; -int ret =0 ; +int ret; dev = tps65910->dev;
@@ -383,7 +383,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,struct tps65910_board *board_info;unsigned int prop;const struct of_device_id *match; -int ret =0 ; +int ret; match =of_match_device (tps65910_of_match, &client->dev);if (!match) {
@@ -460,7 +460,7 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,struct tps65910_board *of_pmic_plat_data =NULL ;struct tps65910_platform_data *init_data;unsigned long chip_id = id->driver_data; -int ret =0 ; +int ret; pmic_plat_data =dev_get_platdata (&i2c->dev);
Signature · 1 line
2.16.2
PATCH v2 3/4 mfd: tps65910: Delete an unnecessary variable initialisation in tps65910_sleepinit()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Fri, 9 Mar 2018 09:10:09 +0100
The local variable "dev" will be reassigned by a following statement. Thus omit the explicit initialisation at the beginning.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/tps65910.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/tps65910.c +1 -1
@@ -312,7 +312,7 @@ static int tps65910_ck32k_init(struct tps65910 *tps65910,static int tps65910_sleepinit (struct tps65910 *tps65910,struct tps65910_board *pmic_pdata) { -struct device *dev =NULL ; +struct device *dev;int ret; dev = tps65910->dev;
Signature · 1 line
2.16.2
PATCH v2 4/4 mfd: tps65910: Move an assignment in tps65910_sleepinit()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Fri, 9 Mar 2018 09:19:42 +0100
Move the assignment for the local variable "dev" so that its setting will be performed after a configuration check by this function.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/tps65910.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/tps65910.c +2 -2
@@ -315,11 +315,11 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,struct device *dev;int ret; - dev = tps65910->dev; -if (!pmic_pdata->en_dev_slp)return 0 ; + dev = tps65910->dev; +/* enabling SLEEP device state */ ret =tps65910_reg_set_bits (tps65910,TPS65910_DEVCTRL ,DEVCTRL_DEV_SLP_MASK );
Signature · 1 line
2.16.2
Re: [PATCH v2 14/17 4/4] mfd: tps65910: Move an assignment in tps65910_sleepinit()
Quoted 6 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Fri, 9 Mar 2018 09:19:42 +0100Move the assignment for the local variable "dev" so that its setting will be performed after a configuration check by this function.
Quoted 6 lines
Signed-off-by Markus Elfring <[email protected]>---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
Thanks.
What happened here: [PATCH v2 14/17 4/4]
How have you managed to insert 4 patches into the x/17 thread?
It shouldn't matter for reviewing purposes. It just looks really odd.
Quoted 21 lines
drivers/mfd/tps65910.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mfd/tps65910.c +2
-2@@ -315,11 +315,11 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,struct device *dev;int ret; - dev = tps65910->dev; -if (!pmic_pdata->en_dev_slp)return 0 ; + dev = tps65910->dev; +/* enabling SLEEP device state */ ret =tps65910_reg_set_bits (tps65910,TPS65910_DEVCTRL ,DEVCTRL_DEV_SLP_MASK );
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [v2 14/17 4/4] mfd: tps65910: Checking patch structures
Quoted 1 line
How have you managed to insert 4 patches into the x/17 thread?
I dared to group the desired patch series into dedicated mail threads.
Regards,
Markus
Re: [v2 14/17 4/4] mfd: tps65910: Checking patch structures
Quoted 3 lines · SF Markus Elfring
Quoted 1 line
How have you managed to insert 4 patches into the x/17 thread?
I dared to group the desired patch series into dedicated mail threads.
Interesting. I've never seen that done before.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH v2 15/17 mfd: tps80031: Delete an error message for a failed memory allocation in tps80031_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Fri, 9 Mar 2018 09:45:13 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/tps80031.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mfd/tps80031.c +1 -3
@@ -431,10 +431,8 @@ static int tps80031_probe(struct i2c_client *client, } tps80031 =devm_kzalloc (&client->dev,sizeof (*tps80031),GFP_KERNEL ); -if (!tps80031) { -dev_err (&client->dev,"Malloc failed for tps80031\n" ); +if (!tps80031)return -ENOMEM ; - }for (i =0 ; i <TPS80031_NUM_SLAVES ; i++) {if (tps80031_slave_address[i] = client->addr)
Signature · 1 line
2.16.2
PATCH v2 16/17 mfd: twl6030-irq: Delete an error message for a failed memory allocation in twl6030_init_irq()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Fri, 9 Mar 2018 09:49:32 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/twl6030-irq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mfd/twl6030-irq.c +1 -3
@@ -392,10 +392,8 @@ int twl6030_init_irq(struct device *dev, int irq_num) nr_irqs =TWL6030_NR_IRQS ; twl6030_irq =devm_kzalloc (dev,sizeof (*twl6030_irq),GFP_KERNEL ); -if (!twl6030_irq) { -dev_err (dev,"twl6030_irq: Memory allocation failed\n" ); +if (!twl6030_irq)return -ENOMEM ; - } mask[0 ] =0xFF ; mask[1 ] =0xFF ;
Signature · 1 line
2.16.2
PATCH v2 17/17 mfd: viperboard: Delete an error message for a failed memory allocation in vprbrd_probe()
In reply to SF Markus ElfringFrom: Markus Elfring <[email protected]>
Date: Fri, 9 Mar 2018 09:56:31 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
---
v2:
Lee Jones requested a resend for this patch. The change was rebased on source files from Linux next-20180308.
drivers/mfd/viperboard.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mfd/viperboard.c +1 -3
@@ -59,10 +59,8 @@ static int vprbrd_probe(struct usb_interface *interface,/* allocate memory for our device state and initialize it */ vb =kzalloc (sizeof (*vb),GFP_KERNEL ); -if (vb =NULL ) { -dev_err (&interface->dev,"Out of memory\n" ); +if (!vb)return -ENOMEM ; - }mutex_init (&vb->lock);
Signature · 1 line
2.16.2
Quoted 5 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Fri, 9 Mar 2018 10:24:42 +0100Several update suggestions were taken into account from static source code analysis.
All applied, thanks.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog