From owner-p4-projects@FreeBSD.ORG Thu May 4 20:01:19 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7928016A414; Thu, 4 May 2006 20:01:19 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3DF7416A404 for ; Thu, 4 May 2006 20:01:19 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0852A43D48 for ; Thu, 4 May 2006 20:01:19 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k44K1ItM069925 for ; Thu, 4 May 2006 20:01:18 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k44K1IAV069903 for perforce@freebsd.org; Thu, 4 May 2006 20:01:18 GMT (envelope-from imp@freebsd.org) Date: Thu, 4 May 2006 20:01:18 GMT Message-Id: <200605042001.k44K1IAV069903@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 96664 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2006 20:01:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=96664 Change 96664 by imp@imp_hammer on 2006/05/04 20:00:28 Slim down by about 160 bytes: a little better code and eliminate the get ID command, since it is unused. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.c#10 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.c#10 (text+ko) ==== @@ -73,14 +73,10 @@ static char GetFlashStatus(void) { - + p_memset((char *)&spi_command, 0, sizeof(spi_command)); p_memset(tx_commandBuffer, 0, 8); tx_commandBuffer[0] = STATUS_REGISTER_READ; p_memset(rx_commandBuffer, 0, 8); - spi_command.tx_data_size = 0; - spi_command.tx_data = 0; - spi_command.rx_data_size = 0; - spi_command.rx_data = 0; spi_command.tx_cmd = tx_commandBuffer; spi_command.rx_cmd = rx_commandBuffer; spi_command.rx_cmd_size = 2; @@ -89,26 +85,6 @@ return (rx_commandBuffer[1]); } -void -SPI_GetId(unsigned *id) -{ - - p_memset(tx_commandBuffer, 0, 8); - tx_commandBuffer[0] = 0x9f; - p_memset(rx_commandBuffer, 0, 8); - spi_command.tx_data_size = 0; - spi_command.tx_data = 0; - spi_command.rx_data_size = 0; - spi_command.rx_data = 0; - spi_command.tx_cmd = tx_commandBuffer; - spi_command.rx_cmd = rx_commandBuffer; - spi_command.rx_cmd_size = 5; - spi_command.tx_cmd_size = 5; - SendCommand(&spi_command); - *id = rx_commandBuffer[1] | (rx_commandBuffer[2] << 8) | - (rx_commandBuffer[3] << 16); -} - /* * .KB_C_FN_DEFINITION_START * void WaitForDeviceReady(void)