All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yishai Hadas <yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
Cc: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	lariel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH rdma-core 2/2] mlx5: Fix wrong bitmap table allocation size calculation
Date: Sun, 29 Oct 2017 23:31:41 +0200	[thread overview]
Message-ID: <92cb91f8-25eb-9894-cf60-5940fa0091bd@dev.mellanox.co.il> (raw)
In-Reply-To: <20171029173703.GB4488-uk2M96/98Pc@public.gmane.org>

On 10/29/2017 7:37 PM, Jason Gunthorpe wrote:
> On Sun, Oct 29, 2017 at 03:01:10PM +0200, Yishai Hadas wrote:
> 
>> diff --git a/providers/mlx5/buf.c b/providers/mlx5/buf.c
>> index 8196db6..0ba8188 100644
>> +++ b/providers/mlx5/buf.c
>> @@ -51,7 +51,7 @@ static int mlx5_bitmap_init(struct mlx5_bitmap *bitmap, uint32_t num,
>>   	bitmap->avail = num;
>>   	bitmap->mask = mask;
>>   	bitmap->avail = bitmap->max;
>> -	bitmap->table = calloc(BITS_TO_LONGS(bitmap->max), sizeof(uint32_t));
>> +	bitmap->table = calloc(BITS_TO_LONGS(bitmap->max), sizeof(long));
> 
> bitmap->table is sensibly set to a 'unsigned long' but here, and in
> several other related macros, 'long' is used instead.. Looks weird to
> mix and match the sigend and unsigned versions.
> 
> Generally, I prefer:
> 	bitmap->table = calloc(BITS_TO_LONGS(bitmap->max),
> 	                       sizeof(*bitmap->table));
> 

I'm fine with your suggestion, will use as part of V1.
--
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

  parent reply	other threads:[~2017-10-29 21:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-29 13:01 [PATCH rdma-core 0/2] mlx5 misc Yishai Hadas
     [not found] ` <1509282070-1391-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-29 13:01   ` [PATCH rdma-core 1/2] mlx5: Use non-cached mapping when Blueflame is not used Yishai Hadas
     [not found]     ` <1509282070-1391-2-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-29 17:33       ` Jason Gunthorpe
     [not found]         ` <20171029173344.GA4488-uk2M96/98Pc@public.gmane.org>
2017-10-29 21:26           ` Yishai Hadas
     [not found]             ` <6531033a-9d61-bbca-ac14-46b05973610c-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-10-30 14:57               ` Jason Gunthorpe
     [not found]                 ` <20171030145726.GB12392-uk2M96/98Pc@public.gmane.org>
2017-10-30 16:31                   ` Yishai Hadas
     [not found]                     ` <d8dc5ba0-2846-2052-9311-dc0273b4fbfb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-10-30 16:38                       ` Jason Gunthorpe
     [not found]                         ` <20171030163813.GB14731-uk2M96/98Pc@public.gmane.org>
2017-10-31  8:20                           ` Yishai Hadas
2017-10-29 13:01   ` [PATCH rdma-core 2/2] mlx5: Fix wrong bitmap table allocation size calculation Yishai Hadas
     [not found]     ` <1509282070-1391-3-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-29 17:37       ` Jason Gunthorpe
     [not found]         ` <20171029173703.GB4488-uk2M96/98Pc@public.gmane.org>
2017-10-29 21:31           ` Yishai Hadas [this message]
2017-10-30 12:45           ` Yishai Hadas

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=92cb91f8-25eb-9894-cf60-5940fa0091bd@dev.mellanox.co.il \
    --to=yishaih-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=jgg-uk2M96/98Pc@public.gmane.org \
    --cc=lariel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.