Linux-EDAC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] EDAC/altera:Use platform_get_irq_optional()
@ 2020-04-02 11:27 Tang Bin
  2020-04-02 12:30 ` Robert Richter
  0 siblings, 1 reply; 7+ messages in thread
From: Tang Bin @ 2020-04-02 11:27 UTC (permalink / raw)
  To: thor.thayer, bp
  Cc: mchehab, tony.luck, james.morse, rrichter, linux-edac,
	linux-kernel, Tang Bin

In order to simply code,because platform_get_irq() already has
dev_err() message.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 drivers/edac/altera_edac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index e91cf1147..e12bad148 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -2099,7 +2099,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	edac->sb_irq = platform_get_irq(pdev, 0);
+	edac->sb_irq = platform_get_irq_optional(pdev, 0);
 	if (edac->sb_irq < 0) {
 		dev_err(&pdev->dev, "No SBERR IRQ resource\n");
 		return edac->sb_irq;
@@ -2134,7 +2134,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
 		}
 	}
 #else
-	edac->db_irq = platform_get_irq(pdev, 1);
+	edac->db_irq = platform_get_irq_optional(pdev, 1);
 	if (edac->db_irq < 0) {
 		dev_err(&pdev->dev, "No DBERR IRQ resource\n");
 		return edac->db_irq;
-- 
2.20.1.windows.1




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] EDAC/altera:Use platform_get_irq_optional()
  2020-04-02 11:27 [PATCH] EDAC/altera:Use platform_get_irq_optional() Tang Bin
@ 2020-04-02 12:30 ` Robert Richter
       [not found]   ` <202004022106312118022@cmss.chinamobile.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Richter @ 2020-04-02 12:30 UTC (permalink / raw)
  To: Tang Bin
  Cc: thor.thayer, bp, mchehab, tony.luck, james.morse, linux-edac,
	linux-kernel

On 02.04.20 19:27:40, Tang Bin wrote:
> In order to simply code,because platform_get_irq() already has
> dev_err() message.

I don't see a difference other than hiding a -EPROBE_DEFER error
message. If that is your intention, please update subject and
description accordingly.

Thanks,

-Robert

> 
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> ---
>  drivers/edac/altera_edac.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
> index e91cf1147..e12bad148 100644
> --- a/drivers/edac/altera_edac.c
> +++ b/drivers/edac/altera_edac.c
> @@ -2099,7 +2099,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	}
>  
> -	edac->sb_irq = platform_get_irq(pdev, 0);
> +	edac->sb_irq = platform_get_irq_optional(pdev, 0);
>  	if (edac->sb_irq < 0) {
>  		dev_err(&pdev->dev, "No SBERR IRQ resource\n");
>  		return edac->sb_irq;
> @@ -2134,7 +2134,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
>  		}
>  	}
>  #else
> -	edac->db_irq = platform_get_irq(pdev, 1);
> +	edac->db_irq = platform_get_irq_optional(pdev, 1);
>  	if (edac->db_irq < 0) {
>  		dev_err(&pdev->dev, "No DBERR IRQ resource\n");
>  		return edac->db_irq;
> -- 
> 2.20.1.windows.1
> 
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] EDAC/altera:Use platform_get_irq_optional()
       [not found]   ` <202004022106312118022@cmss.chinamobile.com>
@ 2020-04-08  7:10     ` Robert Richter
       [not found]       ` <2020040819334451781313@cmss.chinamobile.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Richter @ 2020-04-08  7:10 UTC (permalink / raw)
  To: tangbin
  Cc: thor.thayer, bp, mchehab, tony.luck, james.morse, linux-edac,
	linux-kernel

On 02.04.20 21:06:32, tangbin@cmss.chinamobile.com wrote:
>         Thank you for you replay,what I want to say is:We don't need dev_err()
> message because when something goes wrong, platform_get_irq() has print an
> error message itself, so we could remove duplicate dev_err() here , or use 
> platform_get_irq_optional() instead. Thank you very much!

Please, do not top-post. See Boris' link in his footer:

 https://people.kernel.org/tglx/notes-about-netiquette

See, now your answer is out of context.

What is wrong having 2 error messages? You want to know of the error
as early as possible and see the causal chain of the error. Hiding it
makes an analysis harder. Errors should happen rarely, so why save a
line in dmesg here? In your case, the irq is not optional, it is
required. So something is wrong if it fails.

Thanks,

-Robert

> 
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> tangbin@cmss.chinamobile.com
> 
>      
>     From: Robert Richter
>     Date: 2020-04-02 20:30
>     To: Tang Bin
>     CC: thor.thayer@linux.intel.com; bp@alien8.de; mchehab@kernel.org;
>     tony.luck@intel.com; james.morse@arm.com; linux-edac@vger.kernel.org;
>     linux-kernel@vger.kernel.org
>     Subject: Re: [PATCH] EDAC/altera:Use platform_get_irq_optional()
>     On 02.04.20 19:27:40, Tang Bin wrote:
>     > In order to simply code,because platform_get_irq() already has
>     > dev_err() message.
>      
>     I don't see a difference other than hiding a -EPROBE_DEFER error
>     message. If that is your intention, please update subject and
>     description accordingly.
>      
>     Thanks,
>      
>     -Robert
>      
>     >
>     > Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
>     > ---
>     >  drivers/edac/altera_edac.c | 4 ++--
>     >  1 file changed, 2 insertions(+), 2 deletions(-)
>     >
>     > diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
>     > index e91cf1147..e12bad148 100644
>     > --- a/drivers/edac/altera_edac.c
>     > +++ b/drivers/edac/altera_edac.c
>     > @@ -2099,7 +2099,7 @@ static int altr_edac_a10_probe(struct
>     platform_device *pdev)
>     >  return -ENOMEM;
>     >  }
>     > 
>     > - edac->sb_irq = platform_get_irq(pdev, 0);
>     > + edac->sb_irq = platform_get_irq_optional(pdev, 0);
>     >  if (edac->sb_irq < 0) {
>     >  dev_err(&pdev->dev, "No SBERR IRQ resource\n");
>     >  return edac->sb_irq;
>     > @@ -2134,7 +2134,7 @@ static int altr_edac_a10_probe(struct
>     platform_device *pdev)
>     >  }
>     >  }
>     >  #else
>     > - edac->db_irq = platform_get_irq(pdev, 1);
>     > + edac->db_irq = platform_get_irq_optional(pdev, 1);
>     >  if (edac->db_irq < 0) {
>     >  dev_err(&pdev->dev, "No DBERR IRQ resource\n");
>     >  return edac->db_irq;
>     > --
>     > 2.20.1.windows.1
>     >
>     >
>     >
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re: [PATCH] EDAC/altera:Use platform_get_irq_optional()
       [not found]       ` <2020040819334451781313@cmss.chinamobile.com>
@ 2020-04-08 11:36         ` Borislav Petkov
  2020-04-10  8:25           ` Tang Bin
  0 siblings, 1 reply; 7+ messages in thread
From: Borislav Petkov @ 2020-04-08 11:36 UTC (permalink / raw)
  To: Tang Bin
  Cc: rrichter, thor.thayer, mchehab, tony.luck, james.morse,
	linux-edac, linux-kernel

On Wed, Apr 08, 2020 at 07:33:44PM +0800, Tang Bin wrote:
>   I know what you mean, Thanks.

I don't think you do because you still top-post.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] EDAC/altera:Use platform_get_irq_optional()
  2020-04-08 11:36         ` Borislav Petkov
@ 2020-04-10  8:25           ` Tang Bin
  2020-04-10  9:52             ` Borislav Petkov
  0 siblings, 1 reply; 7+ messages in thread
From: Tang Bin @ 2020-04-10  8:25 UTC (permalink / raw)
  To: Borislav Petkov, rrichter
  Cc: thor.thayer, mchehab, tony.luck, james.morse, linux-edac, linux-kernel

Hi Borislav & Robert:

On 2020/4/8 19:36, Borislav Petkov wrote:
> On Wed, Apr 08, 2020 at 07:33:44PM +0800, Tang Bin wrote:
>>    I know what you mean, Thanks.
> I don't think you do because you still top-post.
>
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
>
> A: No.
> Q: Should I include quotations after my reply?
>
> http://daringfireball.net/2007/07/on_top

I am sorry for the previous writing mistake(top-post). I have consulted 
others and hope it's right this time. Sorry again and thanks for 
teaching. I hope to continuously improve myself and regulate myself 
under your guidance.

Thanks.

Tang Bin




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] EDAC/altera:Use platform_get_irq_optional()
  2020-04-10  8:25           ` Tang Bin
@ 2020-04-10  9:52             ` Borislav Petkov
  2020-04-10 10:07               ` Tang Bin
  0 siblings, 1 reply; 7+ messages in thread
From: Borislav Petkov @ 2020-04-10  9:52 UTC (permalink / raw)
  To: Tang Bin
  Cc: rrichter, thor.thayer, mchehab, tony.luck, james.morse,
	linux-edac, linux-kernel

On Fri, Apr 10, 2020 at 04:25:24PM +0800, Tang Bin wrote:
> I am sorry for the previous writing mistake(top-post). I have consulted
> others and hope it's right this time. Sorry again and thanks for teaching. I
> hope to continuously improve myself and regulate myself under your guidance.

That looks better, thanks!

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] EDAC/altera:Use platform_get_irq_optional()
  2020-04-10  9:52             ` Borislav Petkov
@ 2020-04-10 10:07               ` Tang Bin
  0 siblings, 0 replies; 7+ messages in thread
From: Tang Bin @ 2020-04-10 10:07 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: rrichter, thor.thayer, mchehab, tony.luck, james.morse,
	linux-edac, linux-kernel

Hi Borislav:

On 2020/4/10 17:52, Borislav Petkov wrote:
> On Fri, Apr 10, 2020 at 04:25:24PM +0800, Tang Bin wrote:
>> I am sorry for the previous writing mistake(top-post). I have consulted
>> others and hope it's right this time. Sorry again and thanks for teaching. I
>> hope to continuously improve myself and regulate myself under your guidance.
> That looks better, thanks!

Thanks for your patienct, thank you.

Tang Bin




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 11:27 [PATCH] EDAC/altera:Use platform_get_irq_optional() Tang Bin
2020-04-02 12:30 ` Robert Richter
     [not found]   ` <202004022106312118022@cmss.chinamobile.com>
2020-04-08  7:10     ` Robert Richter
     [not found]       ` <2020040819334451781313@cmss.chinamobile.com>
2020-04-08 11:36         ` Borislav Petkov
2020-04-10  8:25           ` Tang Bin
2020-04-10  9:52             ` Borislav Petkov
2020-04-10 10:07               ` Tang Bin

Linux-EDAC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-edac/0 linux-edac/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-edac linux-edac/ https://lore.kernel.org/linux-edac \
		linux-edac@vger.kernel.org
	public-inbox-index linux-edac

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-edac


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git