Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1579553

Re: [PATCH 3/5] IB/hfi1: Adjust another size determination in hfi1_user_sdma_alloc_queues()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject Re: [PATCH 3/5] IB/hfi1: Adjust another size determination in hfi1_user_sdma_alloc_queues()
Date 2017-02-13 10:40 +0100
Message-ID <talgZ-1RY-7@gated-at.bofh.it> (permalink)
References <t9qC5-ha-13@gated-at.bofh.it> <t9qC6-ha-21@gated-at.bofh.it> <takXD-1L4-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> @@ -443,8 +442,8 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt, struct file *fp)
>>  	if (!cq)
>>  		goto cq_nomem;
>>  
>> -	memsize = PAGE_ALIGN(sizeof(*cq->comps) * hfi1_sdma_comp_ring_size);
>> -	cq->comps = vmalloc_user(memsize);
>> +	cq->comps = vmalloc_user(PAGE_ALIGN(sizeof(*cq->comps)
>> +				 * hfi1_sdma_comp_ring_size));
>>  	if (!cq->comps)
>>  		goto cq_comps_nomem;
>>  
>>
> 
> IMHO this makes readability worse.

How often does it really make sense to keep such a product in this local variable?


> What's the intention behind this patch?

I suggested just another simple omission of an extra variable.

Regards,
Markus

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] IB/hfi1: Fine-tuning for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-02-10 22:10 +0100
  [PATCH 1/5] IB/hfi1: Use kcalloc() in hfi1_user_exp_rcv_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-02-10 22:10 +0100
  [PATCH 4/5] IB/hfi1: Use memdup_user() rather than duplicating its  implementation in hfi1_user_sdma_process_request() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-02-10 22:10 +0100
    Re: [PATCH 4/5] IB/hfi1: Use memdup_user() rather than duplicating  its implementation in hfi1_user_sdma_process_request() Dennis Dalessandro <dennis.dalessandro@intel.com> - 2017-02-11 16:40 +0100
      Re: [PATCH 27/27] IB/hfi1: Code reuse with memdup_copy SF Markus Elfring <elfring@users.sourceforge.net> - 2017-02-13 11:00 +0100
      Re: [PATCH 4/5] IB/hfi1: Use memdup_user() rather than duplicating  its implementation in hfi1_user_sdma_process_request() Dan Carpenter <dan.carpenter@oracle.com> - 2017-02-13 12:00 +0100
        Re: IB/hfi1: Use memdup_user() rather than duplicating its  implementation in hfi1_user_sdma_process_request() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-02-13 12:20 +0100
          Re: IB/hfi1: Use memdup_user() rather than duplicating its  implementation in hfi1_user_sdma_process_request() Dan Carpenter <dan.carpenter@oracle.com> - 2017-02-13 15:10 +0100
  [PATCH 5/5] IB/hfi1: Improve another size determination in  hfi1_user_sdma_process_request() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-02-10 22:10 +0100
  [PATCH 3/5] IB/hfi1: Adjust another size determination in  hfi1_user_sdma_alloc_queues() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-02-10 22:10 +0100
    Re: [PATCH 3/5] IB/hfi1: Adjust another size determination in  hfi1_user_sdma_alloc_queues() Johannes Thumshirn <jthumshirn@suse.de> - 2017-02-13 10:20 +0100
      Re: [PATCH 3/5] IB/hfi1: Adjust another size determination in  hfi1_user_sdma_alloc_queues() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-02-13 10:40 +0100
        Re: [PATCH 3/5] IB/hfi1: Adjust another size determination in  hfi1_user_sdma_alloc_queues() Johannes Thumshirn <jthumshirn@suse.de> - 2017-02-13 11:00 +0100
          Re: IB/hfi1: Adjust another size determination in  hfi1_user_sdma_alloc_queues() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-02-13 11:40 +0100
            Re: IB/hfi1: Adjust another size determination in  hfi1_user_sdma_alloc_queues() Johannes Thumshirn <jthumshirn@suse.de> - 2017-02-13 11:50 +0100
  [PATCH 2/5] IB/hfi1: Use kcalloc() in hfi1_user_sdma_alloc_queues() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-02-10 22:10 +0100

csiph-web