* [PATCH] acpi: remove pointless checks for NULL pointer
@ 2014-12-24 20:16 Eugene Korenevsky
2015-01-30 0:05 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Eugene Korenevsky @ 2014-12-24 20:16 UTC (permalink / raw)
To: linux-acpi, Rafael J. Wysocki, Len Brown
A trivial fix. No need to check `p` for NULL.
`resource` pointer is valid therefore `p` is also valid.
Signed-off-by: Eugene Korenevsky <ekorenevsky@gmail.com>
---
drivers/acpi/pci_link.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index cfd7581..6379186 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -111,7 +111,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
case ACPI_RESOURCE_TYPE_IRQ:
{
struct acpi_resource_irq *p = &resource->data.irq;
- if (!p || !p->interrupt_count) {
+ if (!p->interrupt_count) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Blank _PRS IRQ resource\n"));
return AE_OK;
@@ -137,7 +137,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
{
struct acpi_resource_extended_irq *p =
&resource->data.extended_irq;
- if (!p || !p->interrupt_count) {
+ if (!p->interrupt_count) {
printk(KERN_WARNING PREFIX
"Blank _PRS EXT IRQ resource\n");
return AE_OK;
@@ -198,7 +198,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
case ACPI_RESOURCE_TYPE_IRQ:
{
struct acpi_resource_irq *p = &resource->data.irq;
- if (!p || !p->interrupt_count) {
+ if (!p->interrupt_count) {
/*
* IRQ descriptors may have no IRQ# bits set,
* particularly those those w/ _STA disabled
@@ -214,7 +214,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
{
struct acpi_resource_extended_irq *p =
&resource->data.extended_irq;
- if (!p || !p->interrupt_count) {
+ if (!p->interrupt_count) {
/*
* extended IRQ descriptors must
* return at least 1 IRQ
--
2.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] acpi: remove pointless checks for NULL pointer
2014-12-24 20:16 [PATCH] acpi: remove pointless checks for NULL pointer Eugene Korenevsky
@ 2015-01-30 0:05 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2015-01-30 0:05 UTC (permalink / raw)
To: Eugene Korenevsky; +Cc: linux-acpi, Len Brown
On Wednesday, December 24, 2014 11:16:48 PM Eugene Korenevsky wrote:
> A trivial fix. No need to check `p` for NULL.
> `resource` pointer is valid therefore `p` is also valid.
>
> Signed-off-by: Eugene Korenevsky <ekorenevsky@gmail.com>
Queued up for 3.20, thanks!
> ---
> drivers/acpi/pci_link.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
> index cfd7581..6379186 100644
> --- a/drivers/acpi/pci_link.c
> +++ b/drivers/acpi/pci_link.c
> @@ -111,7 +111,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
> case ACPI_RESOURCE_TYPE_IRQ:
> {
> struct acpi_resource_irq *p = &resource->data.irq;
> - if (!p || !p->interrupt_count) {
> + if (!p->interrupt_count) {
> ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> "Blank _PRS IRQ resource\n"));
> return AE_OK;
> @@ -137,7 +137,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
> {
> struct acpi_resource_extended_irq *p =
> &resource->data.extended_irq;
> - if (!p || !p->interrupt_count) {
> + if (!p->interrupt_count) {
> printk(KERN_WARNING PREFIX
> "Blank _PRS EXT IRQ resource\n");
> return AE_OK;
> @@ -198,7 +198,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
> case ACPI_RESOURCE_TYPE_IRQ:
> {
> struct acpi_resource_irq *p = &resource->data.irq;
> - if (!p || !p->interrupt_count) {
> + if (!p->interrupt_count) {
> /*
> * IRQ descriptors may have no IRQ# bits set,
> * particularly those those w/ _STA disabled
> @@ -214,7 +214,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
> {
> struct acpi_resource_extended_irq *p =
> &resource->data.extended_irq;
> - if (!p || !p->interrupt_count) {
> + if (!p->interrupt_count) {
> /*
> * extended IRQ descriptors must
> * return at least 1 IRQ
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-29 23:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-24 20:16 [PATCH] acpi: remove pointless checks for NULL pointer Eugene Korenevsky
2015-01-30 0:05 ` Rafael J. Wysocki
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).