linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: tangbin <tangbin@cmss.chinamobile.com>
Cc: Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de,
	pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ad7768-1: Fix the right interrupt interfacecalls
Date: Wed, 12 May 2021 11:21:52 +0200	[thread overview]
Message-ID: <41d9dc0f-2e65-075f-9b57-740f31081860@metafoo.de> (raw)
In-Reply-To: <5dd97e8f-8a52-c79c-2b00-7e6b807990ed@cmss.chinamobile.com>

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);
}



      reply	other threads:[~2021-05-12  9:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 15:31 [PATCH] iio: adc: ad7768-1: Fix the right interrupt interface calls Tang Bin
2021-05-11 16:29 ` Lars-Peter Clausen
2021-05-12  8:39   ` [PATCH] iio: adc: ad7768-1: Fix the right interrupt interfacecalls tangbin
2021-05-12  9:21     ` Lars-Peter Clausen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41d9dc0f-2e65-075f-9b57-740f31081860@metafoo.de \
    --to=lars@metafoo.de \
    --cc=Michael.Hennerich@analog.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=tangbin@cmss.chinamobile.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).