* Re: [PATCH v1] md: Convert to use int_pow() [not found] <20190723204155.71531-1-andriy.shevchenko@linux.intel.com> @ 2019-07-26 16:48 ` Andy Shevchenko 2019-07-26 17:18 ` Song Liu 0 siblings, 1 reply; 4+ messages in thread From: Andy Shevchenko @ 2019-07-26 16:48 UTC (permalink / raw) To: Shaohua Li, linux-raid Cc: Jens Axboe, Mike Snitzer, Coly Li, Mikulas Patocka, Song Liu, linux-kernel On Tue, Jul 23, 2019 at 11:41:55PM +0300, Andy Shevchenko wrote: > Instead of linear approach to calculate power of 10, use generic int_pow() > which does it better. I took into Cc drivers/dm guys as they might have known something about md raid state of affairs. Sorry if I mistakenly added somebody. Who is doing this? Should it be orphaned? (I got a bounce from Shaohua address) > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/md/md.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/md/md.c b/drivers/md/md.c > index 24638ccedce4..3f1252440ad0 100644 > --- a/drivers/md/md.c > +++ b/drivers/md/md.c > @@ -3664,11 +3664,7 @@ int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale) > return -EINVAL; > if (decimals < 0) > decimals = 0; > - while (decimals < scale) { > - result *= 10; > - decimals ++; > - } > - *res = result; > + *res = result * int_pow(10, scale - decimals); > return 0; > } > > -- > 2.20.1 > -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] md: Convert to use int_pow() 2019-07-26 16:48 ` [PATCH v1] md: Convert to use int_pow() Andy Shevchenko @ 2019-07-26 17:18 ` Song Liu 2019-07-26 18:58 ` Andy Shevchenko 0 siblings, 1 reply; 4+ messages in thread From: Song Liu @ 2019-07-26 17:18 UTC (permalink / raw) To: Andy Shevchenko Cc: Shaohua Li, linux-raid@vger.kernel.org, Jens Axboe, Mike Snitzer, Coly Li, Mikulas Patocka, linux-kernel@vger.kernel.org > On Jul 26, 2019, at 9:48 AM, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > On Tue, Jul 23, 2019 at 11:41:55PM +0300, Andy Shevchenko wrote: >> Instead of linear approach to calculate power of 10, use generic int_pow() >> which does it better. > > I took into Cc drivers/dm guys as they might have known something about md raid > state of affairs. Sorry if I mistakenly added somebody. > > Who is doing this? > Should it be orphaned? > > (I got a bounce from Shaohua address) I process the patch. Sorry for the delay. Song > >> >> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> >> --- >> drivers/md/md.c | 6 +----- >> 1 file changed, 1 insertion(+), 5 deletions(-) >> >> diff --git a/drivers/md/md.c b/drivers/md/md.c >> index 24638ccedce4..3f1252440ad0 100644 >> --- a/drivers/md/md.c >> +++ b/drivers/md/md.c >> @@ -3664,11 +3664,7 @@ int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale) >> return -EINVAL; >> if (decimals < 0) >> decimals = 0; >> - while (decimals < scale) { >> - result *= 10; >> - decimals ++; >> - } >> - *res = result; >> + *res = result * int_pow(10, scale - decimals); >> return 0; >> } >> >> -- >> 2.20.1 >> > > -- > With Best Regards, > Andy Shevchenko > > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] md: Convert to use int_pow() 2019-07-26 17:18 ` Song Liu @ 2019-07-26 18:58 ` Andy Shevchenko 2019-07-26 20:28 ` Song Liu 0 siblings, 1 reply; 4+ messages in thread From: Andy Shevchenko @ 2019-07-26 18:58 UTC (permalink / raw) To: Song Liu Cc: Shaohua Li, linux-raid@vger.kernel.org, Jens Axboe, Mike Snitzer, Coly Li, Mikulas Patocka, linux-kernel@vger.kernel.org On Fri, Jul 26, 2019 at 05:18:09PM +0000, Song Liu wrote: > > > > On Jul 26, 2019, at 9:48 AM, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > > > On Tue, Jul 23, 2019 at 11:41:55PM +0300, Andy Shevchenko wrote: > >> Instead of linear approach to calculate power of 10, use generic int_pow() > >> which does it better. > > > > I took into Cc drivers/dm guys as they might have known something about md raid > > state of affairs. Sorry if I mistakenly added somebody. > > > > Who is doing this? > > Should it be orphaned? > > > > (I got a bounce from Shaohua address) > > I process the patch. Sorry for the delay. Ah, no problem, thanks! Perhaps someone can update MAINTAINERS data base? -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] md: Convert to use int_pow() 2019-07-26 18:58 ` Andy Shevchenko @ 2019-07-26 20:28 ` Song Liu 0 siblings, 0 replies; 4+ messages in thread From: Song Liu @ 2019-07-26 20:28 UTC (permalink / raw) To: Andy Shevchenko Cc: Song Liu, Shaohua Li, linux-raid@vger.kernel.org, Jens Axboe, Mike Snitzer, Coly Li, Mikulas Patocka, linux-kernel@vger.kernel.org On Fri, Jul 26, 2019 at 12:50 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > On Fri, Jul 26, 2019 at 05:18:09PM +0000, Song Liu wrote: > > > > > > > On Jul 26, 2019, at 9:48 AM, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > > > > > On Tue, Jul 23, 2019 at 11:41:55PM +0300, Andy Shevchenko wrote: > > >> Instead of linear approach to calculate power of 10, use generic int_pow() > > >> which does it better. > > > > > > I took into Cc drivers/dm guys as they might have known something about md raid > > > state of affairs. Sorry if I mistakenly added somebody. > > > > > > Who is doing this? > > > Should it be orphaned? > > > > > > (I got a bounce from Shaohua address) > > > > I process the patch. Sorry for the delay. > > Ah, no problem, thanks! > > Perhaps someone can update MAINTAINERS data base? I will discuss this with Jens. I applied this patch to my local branch. It will go to Jens' tree for 5.4. Thanks, Song ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-07-26 20:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20190723204155.71531-1-andriy.shevchenko@linux.intel.com>
2019-07-26 16:48 ` [PATCH v1] md: Convert to use int_pow() Andy Shevchenko
2019-07-26 17:18 ` Song Liu
2019-07-26 18:58 ` Andy Shevchenko
2019-07-26 20:28 ` Song Liu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox