Re: [PATCH 1/2] pinctrl: core: Remove unnecessary test for desc->name
On Mon, Aug 19, 2013 at 4:06 AM, Axel Lin wrote: > The implementation in pinctrl_register_one_pin() ensures pindesc->name is > always > not NULL before insert the pindesc to radix tree. > If the desc return from pin_desc_get is not NULL, desc->name is always not > NULL. > > Signed-off-by: Axel Lin Good point. Patch applied. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] pinctrl: core: Remove unnecessary test for desc-name
On Mon, Aug 19, 2013 at 4:06 AM, Axel Lin axel@ingics.com wrote: The implementation in pinctrl_register_one_pin() ensures pindesc-name is always not NULL before insert the pindesc to radix tree. If the desc return from pin_desc_get is not NULL, desc-name is always not NULL. Signed-off-by: Axel Lin axel@ingics.com Good point. Patch applied. Yours, Linus Walleij -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] pinctrl: core: Remove unnecessary test for desc->name
The implementation in pinctrl_register_one_pin() ensures pindesc->name is always not NULL before insert the pindesc to radix tree. If the desc return from pin_desc_get is not NULL, desc->name is always not NULL. Signed-off-by: Axel Lin --- drivers/pinctrl/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 4adef2f..53c40d9 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -153,9 +153,7 @@ int pin_get_from_name(struct pinctrl_dev *pctldev, const char *name) pin = pctldev->desc->pins[i].number; desc = pin_desc_get(pctldev, pin); /* Pin space may be sparse */ - if (desc == NULL) - continue; - if (desc->name && !strcmp(name, desc->name)) + if (desc && !strcmp(name, desc->name)) return pin; } -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] pinctrl: core: Remove unnecessary test for desc-name
The implementation in pinctrl_register_one_pin() ensures pindesc-name is always not NULL before insert the pindesc to radix tree. If the desc return from pin_desc_get is not NULL, desc-name is always not NULL. Signed-off-by: Axel Lin axel@ingics.com --- drivers/pinctrl/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 4adef2f..53c40d9 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -153,9 +153,7 @@ int pin_get_from_name(struct pinctrl_dev *pctldev, const char *name) pin = pctldev-desc-pins[i].number; desc = pin_desc_get(pctldev, pin); /* Pin space may be sparse */ - if (desc == NULL) - continue; - if (desc-name !strcmp(name, desc-name)) + if (desc !strcmp(name, desc-name)) return pin; } -- 1.8.1.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/