Thread (1 message) 1 message, 1 author, 2011-08-15

Re: [patch v2 21/37] add rxe_qp.c

From: Jason Gunthorpe <hidden>
Date: 2011-08-15 16:58:26

On Mon, Aug 15, 2011 at 06:13:57PM +0200, Bart Van Assche wrote:
On Sun, Jul 24, 2011 at 9:43 PM,  [off-list ref] wrote:
quoted
+char *rxe_qp_state_name[] = {
+	[QP_STATE_RESET]	= "RESET",
+	[QP_STATE_INIT]		= "INIT",
+	[QP_STATE_READY]	= "READY",
+	[QP_STATE_DRAIN]	= "DRAIN",
+	[QP_STATE_DRAINED]	= "DRAINED",
+	[QP_STATE_ERROR]	= "ERROR",
+};
Doesn't the compiler complain about assigning const char* to char* for
the above array definition ? And since this array is only used in this
source file, I think it can be declared static.
Best would be:

 static const char * const rxe_qp_state_name[]

To put as much as possible in .rodata.

Be sure to run size and nm on your .o files and check that the stuff
in .data actually needs to be writeable..

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help