[PATCH v3 1/2] acpi: Fix proper return code for function acpi_gsi_to_irq

Tuan Phan tphan at apm.com
Tue Jan 12 10:26:04 PST 2016


On Tue, Jan 12, 2016 at 6:36 AM, Borislav Petkov <bp at alien8.de> wrote:
> On Mon, Jan 11, 2016 at 02:41:41PM -0800, Tuan Phan wrote:
>> It will be problem because irq number can be 0 on X86?
>
> tglx says not really but historically irq 0 has been the timer irq.
>
> How about returning a negative value on error and positive or 0 for an
> IRQ?
>

That's exactly the patch tries to do:
int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
@@ -56,7 +56,7 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
         * *irq == 0 means no mapping, that should
         * be reported as a failure
         */
-       return (*irq > 0) ? *irq : -EINVAL;
+       return (*irq > 0) ? 0 : -EINVAL;
 }

So are you good with it?

-- 
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is 
for the sole use of the intended recipient(s) and contains information that 
is confidential and proprietary to Applied Micro Circuits Corporation or 
its subsidiaries. It is to be used solely for the purpose of furthering the 
parties' business relationship. All unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended recipient, please 
contact the sender by reply e-mail and destroy all copies of the original 
message.



More information about the linux-arm-kernel mailing list