From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: George Spelvin <lkml@sdf.org>
Cc: peterz@infradead.org, benh@kernel.crashing.org,
dchinner@redhat.com, linux-kernel@vger.kernel.org,
st5pub@yandex.ru, linux-mtd@lists.infradead.org, hpa@zytor.com,
jslaby@suse.cz, sfr@canb.auug.org.au, darrick.wong@oracle.com,
mpe@ellerman.id.au, mark@fasheh.com, x86@kernel.org,
mingo@redhat.com, naveen.n.rao@linux.vnet.ibm.com,
linux-snps-arc@lists.infradead.org, jannh@google.com,
bp@alien8.de, jlbec@evilplan.org, jpoimboe@redhat.com,
tglx@linutronix.de, ard.biesheuvel@linaro.org,
gregkh@linuxfoundation.org, dedekind1@gmail.com,
adrian.hunter@intel.com, vgupta@synopsys.com, richard@nod.at,
paulus@samba.org, linuxppc-dev@lists.ozlabs.org,
ocfs2-devel@oss.oracle.com
Subject: Re: [PATCH v2 5/5] Lib: sort.h: replace int size with size_t size in the swap function
Date: Mon, 1 Apr 2019 13:28:06 +0300 [thread overview]
Message-ID: <20190401102806.GE9224@smile.fi.intel.com> (raw)
In-Reply-To: <201904010956.x319u70q021113@sdf.org>
On Mon, Apr 01, 2019 at 09:56:07AM +0000, George Spelvin wrote:
> On Mon, 1 Apr 2019 at 12:35:55 +0300, Andy Shevchenko wrote:
> > Hmm... If (*swap)() is called recursively it means the change might increase
> > stack usage on 64-bit platforms.
> >
> > Am I missing something?
>
> Under what conceivable circumstance would someone write a recursive
> (*swap)() function?
>
> You're technically right, but the precondition is more fantastical
> than "if the U.K.'s parliament get their shit together before the
> 12th", so I have a hard time worrying about it.
>
> But you did make me think of something: the whole reason swap()
> takes a size argument is for the benefit of the (no longer existing)
> generic swap functions. All of the custom swap functions ignore
> it.
>
> So how about *deleting* the parameter instead? That simplifies
> everything.
I like this idea!
--
With Best Regards,
Andy Shevchenko
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2019-04-01 10:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-31 18:28 [PATCH v2 0/5] simple sort swap function improvements Andrey Abramov
2019-03-31 18:31 ` [PATCH v2 1/5] arch/arc: unwind.c: replace swap function with built-in one Andrey Abramov
2019-04-01 17:53 ` Vineet Gupta
2019-03-31 18:35 ` [PATCH v2 2/5] powerpc: module_[32|64].c: " Andrey Abramov
2019-04-01 11:08 ` Michael Ellerman
2019-03-31 18:42 ` [PATCH v2 3/5] ocfs2: dir, refcounttree, xattr: replace swap functions " Andrey Abramov
2019-03-31 18:47 ` [PATCH v2 4/5] ubifs: find.c: replace swap function " Andrey Abramov
2019-03-31 18:52 ` [PATCH v2 5/5] Lib: sort.h: replace int size with size_t size in the swap function Andrey Abramov
2019-04-01 9:35 ` Andy Shevchenko
2019-04-01 9:56 ` George Spelvin
2019-04-01 10:28 ` Andy Shevchenko [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=20190401102806.GE9224@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=adrian.hunter@intel.com \
--cc=ard.biesheuvel@linaro.org \
--cc=benh@kernel.crashing.org \
--cc=bp@alien8.de \
--cc=darrick.wong@oracle.com \
--cc=dchinner@redhat.com \
--cc=dedekind1@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=jannh@google.com \
--cc=jlbec@evilplan.org \
--cc=jpoimboe@redhat.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lkml@sdf.org \
--cc=mark@fasheh.com \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=richard@nod.at \
--cc=sfr@canb.auug.org.au \
--cc=st5pub@yandex.ru \
--cc=tglx@linutronix.de \
--cc=vgupta@synopsys.com \
--cc=x86@kernel.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