All of lore.kernel.org
 help / color / mirror / Atom feed
* some questions about  rte_memcpy
@ 2015-01-22  3:39 Linhaifeng
       [not found] ` <54C070DF.1050006-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Linhaifeng @ 2015-01-22  3:39 UTC (permalink / raw)
  To: dev-VfR2kkLFssw

#define rte_memcpy(dst, src, n)              \
	((__builtin_constant_p(n)) ?          \
	memcpy((dst), (src), (n)) :          \
	rte_memcpy_func((dst), (src), (n)))


Why call memcpy when n is constant variable?
Can i change them to the follow codes?

#define rte_memcpy(dst, src, n)              \
    {   \
        int num = n;    \
	rte_memcpy_func((dst), (src), (num)))   \
    }


-- 
Regards,
Haifeng

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-01-23  2:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22  3:39 some questions about rte_memcpy Linhaifeng
     [not found] ` <54C070DF.1050006-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-01-22  4:45   ` Matthew Hall
     [not found]     ` <20150122044531.GA13230-Hv3ogNYU3JfZZajBQzqCxQ@public.gmane.org>
2015-01-22  5:32       ` Linhaifeng
     [not found]         ` <54C08B54.50700-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-01-22  7:35           ` Matthew Hall
     [not found]             ` <20150122073526.GA14800-Hv3ogNYU3JfZZajBQzqCxQ@public.gmane.org>
2015-01-22 10:23               ` Tetsuya Mukawa
     [not found]                 ` <54C0CFB5.909-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>
2015-01-22 11:34                   ` Bruce Richardson
2015-01-22 12:53                     ` Linhaifeng
     [not found]                       ` <54C0F2B9.7050006-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-01-22 15:21                         ` Bruce Richardson
2015-01-23  2:58                           ` Linhaifeng

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.