lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 11 Nov 2020 14:40:11 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Dave Martin <Dave.Martin@....com>
Cc:     "leo.yan@...aro.org" <leo.yan@...aro.org>,
        Andre Przywara <Andre.Przywara@....com>,
        James Clark <James.Clark@....com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <Mark.Rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Al Grant <Al.Grant@....com>, Wei Li <liwei391@...wei.com>,
        John Garry <john.garry@...wei.com>,
        Will Deacon <will@...nel.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v8 06/22] perf arm-spe: Refactor printing string to buffer

Em Wed, Nov 11, 2020 at 03:58:27PM +0000, Dave Martin escreveu:
> On Wed, Nov 11, 2020 at 03:53:20PM +0000, Dave Martin wrote:
> > On Wed, Nov 11, 2020 at 07:11:33AM +0000, Leo Yan wrote:
> > > When outputs strings to the decoding buffer with function snprintf(),
> > > SPE decoder needs to detects if any error returns from snprintf() and if
> > > so needs to directly bail out.  If snprintf() returns success, it needs
> > > to update buffer pointer and reduce the buffer length so can continue to
> > > output the next string into the consequent memory space.
> > > 
> > > This complex logics are spreading in the function arm_spe_pkt_desc() so
> > > there has many duplicate codes for handling error detecting, increment
> > > buffer pointer and decrement buffer size.
> > > 
> > > To avoid the duplicate code, this patch introduces a new helper function
> > > arm_spe_pkt_snprintf() which is used to wrap up the complex logics, and
> > > it's used by the caller arm_spe_pkt_desc().
> > > 
> > > This patch also moves the variable 'blen' as the function's local
> > > variable, this allows to remove the unnecessary braces and improve the
> > > readability.
> > > 
> > > Suggested-by: Dave Martin <Dave.Martin@....com>
> > > Signed-off-by: Leo Yan <leo.yan@...aro.org>
> > > Reviewed-by: Andre Przywara <andre.przywara@....com>
> > 
> > Mostly looks fine to me now, thought there are a few potentionalu
> > issues -- comments below.
> 
> Hmm, looks like patch 7 anticipated some of my comments here.
> 
> Rather than fixing up patch 6, maybe it would be better to squash these
> patches together after all...  sorry!

I'll take a look and probably do that, as it is what Andre suggests.

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ