Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ip2main.c warning fixes

With Eric's "i386: Add a temporary to make put_user more type safe" patch we
get a pile of warnings out of ip2m1in.c:

drivers/char/ip2main.c: In function `ip2_ipl_ioctl':
drivers/char/ip2main.c:2910: warning: assignment makes integer from pointer without a cast
drivers/char/ip2main.c:2911: warning: assignment makes integer from pointer without a cast
drivers/char/ip2main.c:2912: warning: assignment makes integer from pointer without a cast
etc.

This ioctl is copying the kernel virtual address of a large number of
functions out to userspace. Heaven knows why.

Rather than fixing the warnings, I think we'll just nuke that code.

The patch also fixes a couple of `defined but not used' warnings.

Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Andrew Morton and committed by
Linus Torvalds
def9391c 6d94074f

+9 -59
-1
drivers/char/ip2/i2cmd.c
··· 139 139 //static UCHAR ct86[]={ 2, BTH, 0x56,0 }; // RCV_ENABLE 140 140 static UCHAR ct87[] = { 1, BYP, 0x57 }; // HW_TEST 141 141 //static UCHAR ct88[]={ 3, BTH, 0x58,0,0 }; // RCV_THRESHOLD 142 - static UCHAR ct89[]={ 1, BYP, 0x59 }; // DSS_NOW 143 142 //static UCHAR ct90[]={ 3, BYP, 0x5A,0,0 }; // Set SILO 144 143 //static UCHAR ct91[]={ 2, BYP, 0x5B,0 }; // timed break 145 144
+9 -58
drivers/char/ip2main.c
··· 2906 2906 rc = -EINVAL; 2907 2907 break; 2908 2908 case 3: // Trace device 2909 - if ( cmd == 1 ) { 2910 - rc = put_user(iiSendPendingMail, pIndex++ ); 2911 - rc = put_user(i2InitChannels, pIndex++ ); 2912 - rc = put_user(i2QueueNeeds, pIndex++ ); 2913 - rc = put_user(i2QueueCommands, pIndex++ ); 2914 - rc = put_user(i2GetStatus, pIndex++ ); 2915 - rc = put_user(i2Input, pIndex++ ); 2916 - rc = put_user(i2InputFlush, pIndex++ ); 2917 - rc = put_user(i2Output, pIndex++ ); 2918 - rc = put_user(i2FlushOutput, pIndex++ ); 2919 - rc = put_user(i2DrainWakeup, pIndex++ ); 2920 - rc = put_user(i2DrainOutput, pIndex++ ); 2921 - rc = put_user(i2OutputFree, pIndex++ ); 2922 - rc = put_user(i2StripFifo, pIndex++ ); 2923 - rc = put_user(i2StuffFifoBypass, pIndex++ ); 2924 - rc = put_user(i2StuffFifoFlow, pIndex++ ); 2925 - rc = put_user(i2StuffFifoInline, pIndex++ ); 2926 - rc = put_user(i2ServiceBoard, pIndex++ ); 2927 - rc = put_user(serviceOutgoingFifo, pIndex++ ); 2928 - // rc = put_user(ip2_init, pIndex++ ); 2929 - rc = put_user(ip2_init_board, pIndex++ ); 2930 - rc = put_user(find_eisa_board, pIndex++ ); 2931 - rc = put_user(set_irq, pIndex++ ); 2932 - rc = put_user(ip2_interrupt, pIndex++ ); 2933 - rc = put_user(ip2_poll, pIndex++ ); 2934 - rc = put_user(service_all_boards, pIndex++ ); 2935 - rc = put_user(do_input, pIndex++ ); 2936 - rc = put_user(do_status, pIndex++ ); 2937 - #ifndef IP2DEBUG_OPEN 2938 - rc = put_user(0, pIndex++ ); 2939 - #else 2940 - rc = put_user(open_sanity_check, pIndex++ ); 2941 - #endif 2942 - rc = put_user(ip2_open, pIndex++ ); 2943 - rc = put_user(ip2_close, pIndex++ ); 2944 - rc = put_user(ip2_hangup, pIndex++ ); 2945 - rc = put_user(ip2_write, pIndex++ ); 2946 - rc = put_user(ip2_putchar, pIndex++ ); 2947 - rc = put_user(ip2_flush_chars, pIndex++ ); 2948 - rc = put_user(ip2_write_room, pIndex++ ); 2949 - rc = put_user(ip2_chars_in_buf, pIndex++ ); 2950 - rc = put_user(ip2_flush_buffer, pIndex++ ); 2951 - 2952 - //rc = put_user(ip2_wait_until_sent, pIndex++ ); 2953 - rc = put_user(0, pIndex++ ); 2954 - 2955 - rc = put_user(ip2_throttle, pIndex++ ); 2956 - rc = put_user(ip2_unthrottle, pIndex++ ); 2957 - rc = put_user(ip2_ioctl, pIndex++ ); 2958 - rc = put_user(0, pIndex++ ); 2959 - rc = put_user(get_serial_info, pIndex++ ); 2960 - rc = put_user(set_serial_info, pIndex++ ); 2961 - rc = put_user(ip2_set_termios, pIndex++ ); 2962 - rc = put_user(ip2_set_line_discipline, pIndex++ ); 2963 - rc = put_user(set_params, pIndex++ ); 2964 - } else { 2909 + /* 2910 + * akpm: This used to write a whole bunch of function addresses 2911 + * to userspace, which generated lots of put_user() warnings. 2912 + * I killed it all. Just return "success" and don't do 2913 + * anything. 2914 + */ 2915 + if (cmd == 1) 2916 + rc = 0; 2917 + else 2965 2918 rc = -EINVAL; 2966 - } 2967 - 2968 2919 break; 2969 2920 2970 2921 default: