kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: andreabenelli77@gmail.com (Andrea Benelli)
To: kernelnewbies@lists.kernelnewbies.org
Subject: What is the point of this function?
Date: Thu, 23 Jun 2016 09:58:27 +0200	[thread overview]
Message-ID: <CAPQXMLGM7F9xQQMEoGWRP8+drqKC9-eE3-EY_UZ2qxeyT2jJWg@mail.gmail.com> (raw)
In-Reply-To: <CAF3SDA5e+KdtviNtwoYZbPSdQjvYocZpKky6xs_P4S+7gp97UQ@mail.gmail.com>

Ok, thank you!
Il 22 giu 2016 3:08 PM, "Daniel." <danielhilst@gmail.com> ha scritto:

> The function body you see will be use only when CONFIG_SMP is not
> present. Take a look at
> https://www.kernel.org/doc/Documentation/CodingStyle
> Chapter 20: Conditional Compilation
>
> Regards,
>
> 2016-06-21 8:56 GMT-03:00 Andrea Benelli <andreabenelli77@gmail.com>:
> > So, it's just an override?
> > Why return true and not false?
> >
> > Il 21 giu 2016 4:32 AM, "Nathan Williams" <ngwilliams@gmail.com> ha
> scritto:
> >>
> >> On Tue, 2016-06-21 at 00:48 +0200, Andrea Benelli wrote:
> >> > Hello, i was looking at the linux/sched.h (kernel version 4.6.2)
> >> > source code and i found this function at line 1174:
> >> >
> >> > static inline bool cpus_share_cache(int this_cpu, int that_cpu)
> >> > {
> >> >         return true;
> >> > }
> >> >
> >> > I'm not able to understand the utility of a function that just return
> >> > a true value.
> >> > i've noticed that there are a lot of functions like this (function
> >> > that just return a constant).
> >>
> >> Hi Andrea,
> >>
> >> That's the case for when CONFIG_SMP isn't defined. What happens when
> >> CONFIG_SMP is defined?
> >>
> >> I suggest having a look through the code with a Linux cross reference:
> >>
> >> http://lxr.free-electrons.com/ident?v=4.6;i=cpus_share_cache
> >>
> >> Regards,
> >> Nathan
> >>
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>
>
>
> --
> "Do or do not. There is no try"
>   Yoda Master
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160623/da155a5e/attachment.html 

      reply	other threads:[~2016-06-23  7:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAPQXMLHzXhKzZyZx_0YWZMkr6MdPNDdd38Fh=vabGcRMcKXXjw@mail.gmail.com>
2016-06-20 22:48 ` What is the point of this function? Andrea Benelli
2016-06-21  2:31   ` Nathan Williams
2016-06-21 11:56     ` Andrea Benelli
2016-06-22 13:08       ` Daniel.
2016-06-23  7:58         ` Andrea Benelli [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=CAPQXMLGM7F9xQQMEoGWRP8+drqKC9-eE3-EY_UZ2qxeyT2jJWg@mail.gmail.com \
    --to=andreabenelli77@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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).