From: SF Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
To: Johannes Thumshirn <jthumshirn-l3A5Bk7waGM@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Dennis Dalessandro
<dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Hal Rosenstock
<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Mike Marciniszyn
<mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: IB/hfi1: Adjust another size determination in hfi1_user_sdma_alloc_queues()
Date: Mon, 13 Feb 2017 11:37:19 +0100 [thread overview]
Message-ID: <8ec653df-9d73-3c94-9559-7a732417e578@users.sourceforge.net> (raw)
In-Reply-To: <9ce8c7b1-1ae5-fe15-2740-b4f7653555c4-l3A5Bk7waGM@public.gmane.org>
>> How often does it really make sense to keep such a product in this local variable?
>
> It depends. Lets take it the other way round. If I this in a review I'd
> suggest the submitter to create a local variable for the multiplication
> to get rid of the line break. It's avoidable.
I imagine that there are further possibilities to improve the involved
programming for various arrays.
> And again, the compiler will optimize it away.
>
> Apart from the fact that you haven't tested your patch at all:
This is true in principle as I could compile the source code adjustment at least.
> jthumshirn@linux-x5ow:linux (test)$ git am ~/\[PATCH\ 3_5\]\ IB_hfi1\:\
> Adjust\ another\ size\ determination\ in\
> hfi1_user_sdma_alloc_queues\(\).eml
> Applying: IB/hfi1: Adjust another size determination in
> hfi1_user_sdma_alloc_queues()
> jthumshirn@linux-x5ow:linux (test)$ make
> drivers/infiniband/hw/hfi1/user_sdma.o CHK
> include/config/kernel.release
> CHK include/generated/uapi/linux/version.h
> CHK include/generated/utsrelease.h
> CHK include/generated/bounds.h
> CHK include/generated/timeconst.h
> CHK include/generated/asm-offsets.h
> CALL scripts/checksyscalls.sh
> CC drivers/infiniband/hw/hfi1/user_sdma.o
> drivers/infiniband/hw/hfi1/user_sdma.c: In function
> ‘hfi1_user_sdma_alloc_queues’:
> drivers/infiniband/hw/hfi1/user_sdma.c:402:2: error: ‘memsize’
> undeclared (first use in this function)
> memsize = sizeof(*pq->reqs) * hfi1_sdma_comp_ring_size;
> ^
How do you think about to apply also the previous update step like “[PATCH 2/5] IB/hfi1:
Use kcalloc() in hfi1_user_sdma_alloc_queues()”?
> So to sum up: there is no evident improvement in the resulting binary
There might not be a remarkable difference with the default software build parameters.
> and you introduce a stylistic glitch (the new line break in a function call).
There are different opinions about this implementation detail, aren't there?
Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-02-13 10:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-10 21:00 [PATCH 0/5] IB/hfi1: Fine-tuning for three function implementations SF Markus Elfring
[not found] ` <8a997282-09c7-0f9f-645e-d7c6e8c79e67-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-02-10 21:01 ` [PATCH 1/5] IB/hfi1: Use kcalloc() in hfi1_user_exp_rcv_init() SF Markus Elfring
2017-02-10 21:03 ` [PATCH 3/5] IB/hfi1: Adjust another size determination in hfi1_user_sdma_alloc_queues() SF Markus Elfring
2017-02-13 9:10 ` Johannes Thumshirn
[not found] ` <fc714096-8534-2231-17fd-8e3ca3f7a87b-l3A5Bk7waGM@public.gmane.org>
2017-02-13 9:32 ` SF Markus Elfring
[not found] ` <4dca91c1-488d-120d-bd25-74f400242bd2-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-02-13 9:51 ` Johannes Thumshirn
[not found] ` <9ce8c7b1-1ae5-fe15-2740-b4f7653555c4-l3A5Bk7waGM@public.gmane.org>
2017-02-13 10:37 ` SF Markus Elfring [this message]
[not found] ` <8ec653df-9d73-3c94-9559-7a732417e578-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-02-13 10:49 ` Johannes Thumshirn
2017-02-10 21:05 ` [PATCH 5/5] IB/hfi1: Improve another size determination in hfi1_user_sdma_process_request() SF Markus Elfring
2017-04-20 20:29 ` [PATCH 0/5] IB/hfi1: Fine-tuning for three function implementations Doug Ledford
2017-02-10 21:02 ` [PATCH 2/5] IB/hfi1: Use kcalloc() in hfi1_user_sdma_alloc_queues() SF Markus Elfring
2017-02-10 21:04 ` [PATCH 4/5] IB/hfi1: Use memdup_user() rather than duplicating its implementation in hfi1_user_sdma_process_request() SF Markus Elfring
[not found] ` <b19e44b3-601f-c642-b8d3-12c000511ce2-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-02-11 15:32 ` Dennis Dalessandro
[not found] ` <477c8499-93ad-253d-aa2b-8f209ecfad62-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-02-13 9:50 ` [PATCH 27/27] IB/hfi1: Code reuse with memdup_copy SF Markus Elfring
2017-02-13 10:53 ` [PATCH 4/5] IB/hfi1: Use memdup_user() rather than duplicating its implementation in hfi1_user_sdma_process_request() Dan Carpenter
2017-02-13 11:12 ` SF Markus Elfring
[not found] ` <4094dc04-bb2c-a74e-8d4d-8879ac4e7761-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2017-02-13 14:01 ` Dan Carpenter
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=8ec653df-9d73-3c94-9559-7a732417e578@users.sourceforge.net \
--to=elfring-rn4veauk+akrv+lv9mx5uipxlwaovq5f@public.gmane.org \
--cc=dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=jthumshirn-l3A5Bk7waGM@public.gmane.org \
--cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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