# This is a complete kludge to work around an optimization enhancement in gcc 3.4.x # compilers that causes a problem with 2.4 kernel compiles. If gcc 3.4.x sees an # sprintf(buffer,"%s",string) command, it silently converts it to a _call_ to # strcpy. This causes an unresolved external reference when the kernel gets linked. # So, to defeat this optimization (in this particular case), I changed the string # formatting from %s to %s%s. If it had been a simple sprintf call, I would have # changed it to a strcpy command myself (for which gcc would have inlined the code), # but since LCS_DBF_TEXT_ is defined to do multiple things, and is called from # multiple places, I didn't want to get too involved by writing another function, # or manually expanding the function in place. I didn't want to have to track any # possible future changes to the function itself. # Having a "%s%s" format string generates a compiler _warning_ that there are two # few arguments for the format, which I can live with in this case. # In any event, my apologies for the ugly code. # --- linux-2.4.33.3/drivers/s390/net/lcs.c.orig 2006-09-12 15:31:50.000000000 -0400 +++ linux-2.4.33.3/drivers/s390/net/lcs.c 2006-09-13 14:22:35.000000000 -0400 @@ -1953,7 +1953,7 @@ struct lcs_card *card; LCS_DBF_TEXT(2, trace, "opendev"); - LCS_DBF_TEXT_(3,trace,"%s",dev->name); + LCS_DBF_TEXT_(3,trace,"%s%s",dev->name); card = (struct lcs_card *) dev->priv; LCS_DBF_HEX(2, trace, &card, sizeof(void*)); /* initialize statistics */