lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <41d9dc0f-2e65-075f-9b57-740f31081860@metafoo.de>
Date:   Wed, 12 May 2021 11:21:52 +0200
From:   Lars-Peter Clausen <lars@...afoo.de>
To:     tangbin <tangbin@...s.chinamobile.com>
Cc:     Michael.Hennerich@...log.com, jic23@...nel.org, knaack.h@....de,
        pmeerw@...erw.net, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: adc: ad7768-1: Fix the right interrupt
 interfacecalls

On 5/12/21 10:39 AM, tangbin wrote:
> Hi Lars-Peter:
>
>         Thanks for you reply!
>
>> Hi,
>>
>> Thanks for the patch. Aren't those two expressions equivalent? Are 
>> you seeing an issue with the current code? If so can you include that 
>> in the commit message?
>>
>> - Lars
>>
>>
>        When submitting this patch, I actually thought about it for a 
> while, but finally decided to submit it, my reason is as follows:
>
>         In numerical data of address, &ad7768_interrupt is equal to 
> ad7768_interrupt, and the compilation can pass. But I think they are 
> not the same, ad7768_interrupt is the first
>
> address of the function, and its type is irqreturn_t, 
> &ad7768_interrupt represents the address of an object that points to 
> the function ad7768_interrupt().
>
>         So I think they are not the same, For previous experience with 
> devm_request_irq(), I send this patch. If I'm wrong, I'm sorry to 
> bother you.
>
Have a look at 
https://stackoverflow.com/questions/6893285/why-do-function-pointer-definitions-work-with-any-number-of-ampersands-or-as 
for some background on this.

You can also easily verify that they are the same with a simple test program

static void foo(void) {}

int main(void) {
     printf("%p %p %d\n", foo, &foo, foo == &foo);
}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ