Revision 471a567144b91c8f2b7a71a1cf8babe7331590b1 authored by Dave Jones on 28 February 2007, 20:41:39 UTC, committed by Jeff Garzik on 03 March 2007, 01:16:10 UTC
Commit 908b637fe793165b6aecdc875cdca67c4959a1ad removed ETH_DMA_ALIGN
but missed a usage of it in a macro, which broke the build.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
1 parent 63f7792
Raw File
bin2hex.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main( int argc, const char * argv [] )
{
    const char * varname;
    int i = 0;
    int c;
    int id = 0;

    if(argv[1] && strcmp(argv[1],"-i")==0)
    {
    	argv++;
    	argc--;
    	id=1;
    }
    	
    if(argc==1)
    {
    	fprintf(stderr, "bin2hex: [-i] firmware\n");
    	exit(1);
    }
    
    varname = argv[1];
    printf( "/* automatically generated by bin2hex */\n" );
    printf( "static unsigned char %s [] %s =\n{\n", varname , id?"__initdata":"");

    while ( ( c = getchar( ) ) != EOF )
    {
	if ( i != 0 && i % 10 == 0 )
	    printf( "\n" );
	printf( "0x%02lx,", c & 0xFFl );
	i++;
    }

    printf( "};\nstatic int %sLen =  %d;\n", varname, i );
    return 0;
}
back to top