On Mon, Aug 15, 2011 at 06:13:57PM +0200, Bart Van Assche wrote:
> On Sun, Jul 24, 2011 at 9:43 PM,  <rpear...@systemfabricworks.com> wrote:
> > +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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to