ACK: [PATCH 02/13] lib: fwts_cpu: minor fwts coding style changes
ivanhu
ivan.hu at canonical.com
Thu Aug 16 09:02:31 UTC 2018
On 08/14/2018 07:24 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Just some minor clean ups in style, no functional change
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/src/fwts_cpu.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/src/lib/src/fwts_cpu.c b/src/lib/src/fwts_cpu.c
> index e79f5b0a..18ff7823 100644
> --- a/src/lib/src/fwts_cpu.c
> +++ b/src/lib/src/fwts_cpu.c
> @@ -77,7 +77,7 @@ int fwts_cpu_readmsr(const int cpu, const uint32_t reg, uint64_t *val)
>
> *val = value;
>
> - if (ret<0)
> + if (ret < 0)
> return FWTS_ERROR;
>
> return FWTS_OK;
> @@ -373,7 +373,7 @@ static int perf_start_counter(int fd)
> int rc;
>
> rc = ioctl(fd, PERF_EVENT_IOC_ENABLE);
> - return rc == 0 ? FWTS_OK : FWTS_ERROR;
> + return (rc == 0) ? FWTS_OK : FWTS_ERROR;
> }
>
> static int perf_stop_counter(int fd)
> @@ -381,7 +381,7 @@ static int perf_stop_counter(int fd)
> int rc;
>
> rc = ioctl(fd, PERF_EVENT_IOC_DISABLE);
> - return rc == 0 ? FWTS_OK : FWTS_ERROR;
> + return (rc == 0) ? FWTS_OK : FWTS_ERROR;
> }
>
> static int perf_read_counter(int fd, unsigned long long *result)
> @@ -424,7 +424,7 @@ int fwts_cpu_benchmark(
> if (ncpus == FWTS_ERROR)
> return FWTS_ERROR;
>
> - if (cpu < 0 || cpu > ncpus)
> + if ((cpu < 0) || (cpu > ncpus))
> return FWTS_ERROR;
>
> /* setup perf counter */
> @@ -580,7 +580,7 @@ int fwts_cpu_consume(const int seconds)
> if (fwts_cpu_consume_start() != FWTS_OK)
> return FWTS_ERROR;
>
> - sleep(seconds);
> + (void)sleep(seconds);
>
> fwts_cpu_consume_complete();
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/28c7ada2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/28c7ada2/attachment-0001.sig>
More information about the fwts-devel
mailing list