linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Tudor Ambarus <Tudor.Ambarus@microchip.com>,
	Pratyush Yadav <p.yadav@ti.com>,
	 Michael Walle <michael@walle.cc>,
	MTD Maling List <linux-mtd@lists.infradead.org>,
	 Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH] mtd: Introduce an expert mode for forensics and debugging purposes
Date: Thu, 27 Jan 2022 12:57:06 +0100	[thread overview]
Message-ID: <CAMuHMdUG+FNUmxi2eSiCeyjr-a1ZHoBi4BFVGuFczq4E0Hjd3g@mail.gmail.com> (raw)
In-Reply-To: <20220127121851.68d1c91e@xps13>

Hi Miquel,

On Thu, Jan 27, 2022 at 12:18 PM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
> geert@linux-m68k.org wrote on Thu, 27 Jan 2022 12:07:31 +0100:
> > On Thu, Jan 27, 2022 at 11:46 AM Miquel Raynal
> > <miquel.raynal@bootlin.com> wrote:
> > > > What about letting drivers/mtd/mtdcore.c export a simple function
> > > > mtd_check_expert_analysis_mode() that calls the WARN_ONCE(...) if
> > > > CONFIG_DEBUG_FS=y, else providing a dummy?
> > > > The backtrace will identify the caller anyway.
> > >
> > > I took the time to address your comments. You're right a single exported
> > > function is better.
> > >
> > > However I don't see the need for a CONFIG_DEBUG_FS check here, if unset
> > > the boolean will stay false forever, I believe we don't need to bother
> > > with it.
> >
> > If CONFIG_DEBUG_FS=n, there is no need for the code or the export,
> > so the check can become a dummy.
>
> Agreed, but I truly don't like using #ifdefs when I can skip these, I
> think they darken the code and prevent good build coverage.
>
> Using if (IS_ENABLED()) is an option but would not bring the memory
> savings that we could expect with an #ifdef, so I don't see the point
> here.
>
> Should we use unlikely() to give branch predictors a clue about what is
> going to happen?

That will be thwarted by the out-of-line call to the exported symbol.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2022-01-27 11:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 11:46 [PATCH] mtd: Introduce an expert mode for forensics and debugging purposes Miquel Raynal
2021-12-03 13:37 ` Miquel Raynal
2022-01-10 13:15 ` Geert Uytterhoeven
2022-01-10 14:41   ` Miquel Raynal
2022-01-10 14:57     ` Geert Uytterhoeven
2022-01-10 15:01       ` Miquel Raynal
2022-01-27 10:46   ` Miquel Raynal
2022-01-27 11:07     ` Geert Uytterhoeven
2022-01-27 11:18       ` Miquel Raynal
2022-01-27 11:57         ` Geert Uytterhoeven [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=CAMuHMdUG+FNUmxi2eSiCeyjr-a1ZHoBi4BFVGuFczq4E0Hjd3g@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=p.yadav@ti.com \
    --cc=richard@nod.at \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vigneshr@ti.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).