From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH rdma-core 2/5] utils: Create utils directory to put all common code and move min/max into it
Date: Mon, 26 Sep 2016 11:20:06 -0600 [thread overview]
Message-ID: <20160926172006.GB22965@obsidianresearch.com> (raw)
In-Reply-To: <1474786207-2149-3-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
On Sun, Sep 25, 2016 at 09:50:04AM +0300, Leon Romanovsky wrote:
> -#ifndef min
> -#define min(a, b) \
> - ({ typeof(a) _a = (a); \
> - typeof(b) _b = (b); \
> - _a < _b ? _a : _b; })
> -#endif
> -
> -#ifndef max
> -#define max(a, b) \
> - ({ typeof(a) _a = (a); \
> - typeof(b) _b = (b); \
> - _a > _b ? _a : _b; })
> -#endif
I'm not excited to replace the safer min above with the less safe min
below, that could actually break something.
> +/*
> + * This include contains all common mathematical functions
> + */
> +#ifndef min
> +#define min(a, b) (((a) < (b)) ? (a) : (b))
> +#endif
> +
> +#ifndef max
> +#define max(a, b) (((a) > (b)) ? (a) : (b))
> +#endif
> +#endif /* _RDMA_MATH_H_ */
Jason
--
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:[~2016-09-26 17:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-25 6:50 [PATCH rdma-core 0/5] Add directory to place common code and move trivial functions into it Leon Romanovsky
[not found] ` <1474786207-2149-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-25 6:50 ` [PATCH rdma-core 1/5] cmake: Update build instructions in CmakeList Leon Romanovsky
2016-09-25 6:50 ` [PATCH rdma-core 2/5] utils: Create utils directory to put all common code and move min/max into it Leon Romanovsky
[not found] ` <1474786207-2149-3-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-26 7:05 ` Leon Romanovsky
[not found] ` <20160926070520.GJ4088-2ukJVAZIZ/Y@public.gmane.org>
2016-09-26 17:17 ` Jason Gunthorpe
2016-09-26 17:20 ` Jason Gunthorpe [this message]
2016-09-25 6:50 ` [PATCH rdma-core 3/5] utils: Remove container_of and offset local declarations Leon Romanovsky
[not found] ` <1474786207-2149-4-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-26 15:32 ` Hefty, Sean
2016-09-26 17:27 ` Jason Gunthorpe
2016-09-25 6:50 ` [PATCH rdma-core 4/5] libocrdma: Move ocrdma's list implementation into common directory Leon Romanovsky
[not found] ` <1474786207-2149-5-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-25 14:41 ` Christoph Hellwig
[not found] ` <20160925144121.GA12246-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-09-25 16:13 ` Leon Romanovsky
[not found] ` <20160925161315.GD4088-2ukJVAZIZ/Y@public.gmane.org>
2016-09-25 16:22 ` Christoph Hellwig
[not found] ` <20160925162203.GA32434-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-09-25 17:50 ` Bart Van Assche
2016-09-26 17:40 ` Jason Gunthorpe
[not found] ` <20160926174057.GD22965-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-26 22:14 ` Christoph Hellwig
[not found] ` <20160926221440.GA5878-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-09-26 22:23 ` Jason Gunthorpe
[not found] ` <20160926222319.GA2358-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-27 16:14 ` Yishai Hadas
[not found] ` <ff764b75-19af-340b-7228-328462c524ae-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-09-27 18:03 ` Jason Gunthorpe
2016-09-25 22:05 ` Jason Gunthorpe
2016-09-25 6:50 ` [PATCH rdma-core 5/5] libmlx5: Convert libmlx5 to use common list implementation Leon Romanovsky
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=20160926172006.GB22965@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox