Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1444899 > unrolled thread

[PATCH] s390/pci: Delete an unnecessary check before the function call "pci_dev_put"

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2016-07-16 20:50 +0200
Last post2016-07-18 09:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] s390/pci: Delete an unnecessary check before the function  call "pci_dev_put" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-16 20:50 +0200
    Re: [PATCH] s390/pci: Delete an unnecessary check before the  function call "pci_dev_put" Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-07-18 09:10 +0200

#1444899 — [PATCH] s390/pci: Delete an unnecessary check before the function call "pci_dev_put"

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-07-16 20:50 +0200
Subject[PATCH] s390/pci: Delete an unnecessary check before the function call "pci_dev_put"
Message-ID<rVCP0-7iw-17@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Jul 2016 20:15:17 +0200

The pci_dev_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/s390/pci/pci_event.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c
index fb2a9a5..c2b27ad 100644
--- a/arch/s390/pci/pci_event.c
+++ b/arch/s390/pci/pci_event.c
@@ -145,8 +145,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
 	default:
 		break;
 	}
-	if (pdev)
-		pci_dev_put(pdev);
+	pci_dev_put(pdev);
 }
 
 void zpci_event_availability(void *data)
-- 
2.9.1

[toc] | [next] | [standalone]


#1445260 — Re: [PATCH] s390/pci: Delete an unnecessary check before the function call "pci_dev_put"

FromMartin Schwidefsky <schwidefsky@de.ibm.com>
Date2016-07-18 09:10 +0200
SubjectRe: [PATCH] s390/pci: Delete an unnecessary check before the function call "pci_dev_put"
Message-ID<rWaQG-352-27@gated-at.bofh.it>
In reply to#1444899
On Sat, 16 Jul 2016 20:40:23 +0200
SF Markus Elfring <elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 16 Jul 2016 20:15:17 +0200
> 
> The pci_dev_put() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the call is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  arch/s390/pci/pci_event.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c
> index fb2a9a5..c2b27ad 100644
> --- a/arch/s390/pci/pci_event.c
> +++ b/arch/s390/pci/pci_event.c
> @@ -145,8 +145,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
>  	default:
>  		break;
>  	}
> -	if (pdev)
> -		pci_dev_put(pdev);
> +	pci_dev_put(pdev);
>  }
> 
>  void zpci_event_availability(void *data)

Applied,  thanks.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web