kernels/linux-2.4.0/drivers/scsi/3w-xxxx.c
/* This function is called by tw_scsi_proc_info */
This function is called by tw_scsi_proc_info
This function is called by tw_scsi_proc_info
static void tw_copy_mem_info(TW_Info *info, char *data, int len)
{
	if (info->position + len > info->length)
		len = info->length - info->position;
	if (info->position + len < info->offset) {
		info->position += len;
		return;
	}
	if (info->position < info->offset) {
		data += (info->offset - info->position);
		len  -= (info->offset - info->position);
	}
	if (len > 0) {
		memcpy(info->buffer + info->position, data, len);
		info->position += len;
	}
}
static void tw_copy_mem_info ( TW_Info * info , char * data , int len ) { if ( info -> position + len > info -> length ) len = info -> length - info -> position ; if ( info -> position + len < info -> offset ) { info -> position += len ; return ; } if ( info -> position < info -> offset ) { data += ( info -> offset - info -> position ) ; len -= ( info -> offset - info -> position ) ; } if ( len > 0 ) { memcpy ( info -> buffer + info -> position , data , len ) ; info -> position += len ; } }
This function is called by tw_scsi_proc_info
This function is called by tw_scsi_proc_info