[haiku-commits] haiku: hrev46171 - in src/add-ons: kernel/drivers/network/pegasus kernel/bus_managers/ps2 kernel accelerants/neomagic/engine

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 4 Oct 2013 16:07:01 +0200 (CEST)

hrev46171 adds 6 changesets to branch 'master'
old head: 38fa81bf8f0ccc37a615a9f5bd333f9b781322b3
new head: f0d09d4925c304099c45c2404da7945b72ce812b
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=f0d09d4+%5E38fa81b

----------------------------------------------------------------------------

b449921: pegasus: cleanup

fa49d97: neomagic: fixed a warning about an uninitialized variable.

da9508d: rtf: fixed a warning about an uninitialized variable.

6eb9729: tty: fixed warnings about an uninitialized variable.

df6c32e: ps2: disable elantech support until it's more functional

f0d09d4: ps2: rename a constant also used in pads

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

9 files changed, 86 insertions(+), 84 deletions(-)
src/add-ons/accelerants/neomagic/engine/nm_dac.c |   8 +-
src/add-ons/kernel/bus_managers/ps2/ps2_alps.cpp |   2 +-
src/add-ons/kernel/bus_managers/ps2/ps2_defs.h   |   2 +-
src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp  |   2 +
.../kernel/bus_managers/ps2/ps2_keyboard.cpp     |   6 +-
.../kernel/drivers/network/pegasus/driver.c      | 144 +++++++++----------
src/add-ons/kernel/drivers/tty/tty.cpp           |   2 +-
src/add-ons/kernel/generic/tty/tty.cpp           |   2 +-
src/add-ons/translators/rtf/convert.cpp          |   2 +-

############################################################################

Commit:      b449921515eab2b4ef6c4f56eefb8dd4941fab47
URL:         http://cgit.haiku-os.org/haiku/commit/?id=b449921
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Thu Oct  3 15:15:32 2013 UTC

pegasus: cleanup

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/drivers/network/pegasus/driver.c 
b/src/add-ons/kernel/drivers/network/pegasus/driver.c
index 8398bbd..6009a2b 100644
--- a/src/add-ons/kernel/drivers/network/pegasus/driver.c
+++ b/src/add-ons/kernel/drivers/network/pegasus/driver.c
@@ -1,13 +1,13 @@
 /*
  * Pegasus BeOS Driver
- * 
+ *
  * Copyright 2006, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
  *             Jérôme Duval
  */
- 
+
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -175,13 +175,13 @@ create_device(const usb_device dev, const 
usb_interface_info *ii, uint16 ifno)
 {
        pegasus_dev *device = NULL;
        sem_id sem;
-       
+
        ASSERT(usb != NULL && dev != 0);
 
        device = malloc(sizeof(pegasus_dev));
        if (device == NULL)
                return NULL;
-               
+
        memset(device, 0, sizeof(pegasus_dev));
 
        device->sem_lock = sem = create_sem(1, DRIVER_NAME "_lock");
@@ -190,7 +190,7 @@ create_device(const usb_device dev, const 
usb_interface_info *ii, uint16 ifno)
                free(device);
                return NULL;
        }
-       
+
        device->rx_sem = sem = create_sem(1, DRIVER_NAME"_receive");
        if (sem < B_OK) {
                DPRINTF_ERR("create_sem() failed 0x%" B_PRIx32 "\n", sem);
@@ -219,7 +219,7 @@ create_device(const usb_device dev, const 
usb_interface_info *ii, uint16 ifno)
                return NULL;
        }
        set_sem_owner(device->tx_sem, B_SYSTEM_TEAM);
-       
+
        device->tx_sem_cb = sem = create_sem(0, DRIVER_NAME"_transmit_cb");
        if (sem < B_OK) {
                delete_sem(device->sem_lock);
@@ -230,7 +230,7 @@ create_device(const usb_device dev, const 
usb_interface_info *ii, uint16 ifno)
                return NULL;
        }
        set_sem_owner(device->tx_sem_cb, B_SYSTEM_TEAM);
-               
+
        device->number = sDeviceNumber++;
        device->cookieMagic = PEGASUS_COOKIE_MAGIC;
        sprintf(device->name, "%s%d", kBaseName, device->number);
@@ -241,7 +241,7 @@ create_device(const usb_device dev, const 
usb_interface_info *ii, uint16 ifno)
        device->aue_dying = false;
        device->flags = 0;
        device->maxframesize = 1514; // XXX is MAXIMUM_ETHERNET_FRAME_SIZE = 
1518 too much?
-               
+
        return device;
 }
 
@@ -255,7 +255,7 @@ remove_device(pegasus_dev *device)
        delete_sem(device->tx_sem);
        delete_sem(device->rx_sem_cb);
        delete_sem(device->tx_sem_cb);
-               
+
        delete_sem(device->sem_lock);
 
        free(device);
@@ -265,7 +265,7 @@ remove_device(pegasus_dev *device)
 /**
        \fn:
 */
-static status_t 
+static status_t
 setup_endpoints(const usb_interface_info *uii, pegasus_dev *dev)
 {
        size_t epts[3] = { -1, -1, -1 };
@@ -285,17 +285,17 @@ setup_endpoints(const usb_interface_info *uii, 
pegasus_dev *dev)
                                epts[2] = ep;
                }
        }
-       
+
        dev->pipe_in = uii->endpoint[epts[0]].handle;
        dev->pipe_out = uii->endpoint[epts[1]].handle;
        dev->pipe_intr = uii->endpoint[epts[2]].handle;
        DPRINTF_INFO("endpoint:%lx %lx %lx\n", dev->pipe_in, dev->pipe_out, 
dev->pipe_intr);
-       
+
        return ((epts[0] > -1) && (epts[1] > -1) && (epts[2] > -1)) ? B_OK : 
B_ENTRY_NOT_FOUND;
 }
 
 
-static void 
+static void
 pegasus_rx_callback(void *cookie, status_t status, void *data, size_t 
actual_len)
 {
        pegasus_dev *dev = (pegasus_dev *)cookie;
@@ -306,7 +306,7 @@ pegasus_rx_callback(void *cookie, status_t status, void 
*data, size_t actual_len
                DPRINTF_ERR("pegasus_rx_callback() cancelled\n");
                return;
        }
-       
+
        ASSERT(cookie != NULL);
        dev->rx_actual_length = actual_len;
        dev->rx_status = status;        /* B_USB_STATUS_* */
@@ -315,22 +315,22 @@ pegasus_rx_callback(void *cookie, status_t status, void 
*data, size_t actual_len
 }
 
 
-static void 
+static void
 pegasus_tx_callback(void *cookie, status_t status, void *data, size_t 
actual_len)
 {
        pegasus_dev *dev = (pegasus_dev *)cookie;
-       
+
        DPRINTF_INFO("pegasus_tx_callback() %ld %ld\n", status, actual_len);
        if (status == B_CANCELED) {
                /* cancelled: device is unplugged */
                DPRINTF_ERR("pegasus_tx_callback() cancelled\n");
                return;
        }
-                       
+
        ASSERT(cookie != NULL);
        dev->tx_actual_length = actual_len;
        dev->tx_status = status;        /* B_USB_STATUS_* */
-       release_sem(dev->tx_sem_cb);    
+       release_sem(dev->tx_sem_cb);
        DPRINTF_INFO("pegasus_tx_callback release sem %ld\n", dev->tx_sem_cb);
 }
 
@@ -348,7 +348,7 @@ pegasus_device_added(const usb_device dev, void **cookie)
        status_t status;
        uint16 ifno;
        int i;
-       
+
        ASSERT(dev != 0 && cookie != NULL);
        DPRINTF_INFO("device_added()\n");
 
@@ -357,12 +357,12 @@ pegasus_device_added(const usb_device dev, void **cookie)
        DPRINTF_INFO("vendor ID 0x%04X, product ID 0x%04X\n", 
dev_desc->vendor_id,
                dev_desc->product_id);
 
-       if ((conf = usb->get_nth_configuration(dev, DEFAULT_CONFIGURATION)) 
+       if ((conf = usb->get_nth_configuration(dev, DEFAULT_CONFIGURATION))
                == NULL) {
                DPRINTF_ERR("cannot get default configuration\n");
                return B_ERROR;
        }
-       
+
        ifno = AUE_IFACE_IDX;
        intf = conf->interface [ifno].active;
 
@@ -372,36 +372,36 @@ pegasus_device_added(const usb_device dev, void **cookie)
                DPRINTF_ERR("set_configuration() failed %s\n", 
strerror(status));
                return B_ERROR;
        }
-       
+
        if ((device = create_device(dev, intf, ifno)) == NULL) {
                DPRINTF_ERR("create_device() failed\n");
                return B_ERROR;
        }
-       
+
        device->aue_vendor = dev_desc->vendor_id;
        device->aue_product = dev_desc->product_id;
-       
+
        for (i=0; i < sizeof(aue_devs) / sizeof(struct aue_type); i++)
                if (aue_devs[i].aue_dev.vendor == dev_desc->vendor_id
                        && aue_devs[i].aue_dev.product == dev_desc->product_id) 
{
-                       device->aue_flags = aue_devs[i].aue_flags;              
+                       device->aue_flags = aue_devs[i].aue_flags;
                        break;
                }
-               
+
        /* Find endpoints. */
        setup_endpoints(intf, device);
-       
+
        aue_attach(device);
 
        DPRINTF_INFO("MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
                device->macaddr[0], device->macaddr[1], device->macaddr[2],
                device->macaddr[3], device->macaddr[4], device->macaddr[5]);
-       
+
        aue_init(device);
 
        /* create a port */
        add_device_info(device);
-       
+
        *cookie = device;
        DPRINTF_INFO("added %s\n", device->name);
        return B_OK;
@@ -418,7 +418,7 @@ pegasus_device_removed(void *cookie)
        DPRINTF_INFO("device_removed(%s)\n", device->name);
 
        aue_uninit(device);
-       
+
        usb->cancel_queued_transfers(device->pipe_in);
        usb->cancel_queued_transfers(device->pipe_out);
        usb->cancel_queued_transfers(device->pipe_intr);
@@ -437,14 +437,14 @@ pegasus_device_removed(void *cookie)
 }
 
 
-static status_t 
+static status_t
 pegasus_device_open(const char *name, uint32 flags,
        driver_cookie **out_cookie)
 {
        driver_cookie *cookie;
        pegasus_dev *device;
        status_t err;
-       
+
        ASSERT(name != NULL);
        ASSERT(out_cookie != NULL);
        DPRINTF_INFO("open(%s)\n", name);
@@ -458,28 +458,28 @@ pegasus_device_open(const char *name, uint32 flags,
                free(cookie);
                return err;
        }
-       device->nonblocking = (flags & O_NONBLOCK) ? true : false;
-       
+       device->nonblocking = (flags & O_NONBLOCK) != 0;
+
        cookie->device = device;
        cookie->next = device->open_fds;
        device->open_fds = cookie;
        device->open++;
        release_sem(device->sem_lock);
-       
+
        *out_cookie = cookie;
        DPRINTF_INFO("device %s open (%d)\n", name, device->open);
        return B_OK;
 }
 
 
-static status_t 
+static status_t
 pegasus_device_read(driver_cookie *cookie, off_t position, void *buffer, 
size_t *_length)
 {
        pegasus_dev *dev;
        status_t status;
        int32 blockFlag;
        size_t size;
-       
+
        DPRINTF_INFO("device %p read\n", cookie);
 
        if (pegasus_checkdeviceinfo(dev = cookie->device) != B_OK) {
@@ -508,12 +508,12 @@ pegasus_device_read(driver_cookie *cookie, off_t 
position, void *buffer, size_t
 
        // queue new request
        status = usb->queue_bulk(dev->pipe_in, dev->rx_buffer, MAX_FRAME_SIZE, 
&pegasus_rx_callback, dev);
-       
+
        if (status != B_OK) {
                DPRINTF_ERR("queue_bulk:failed:%08" B_PRIx32 "\n", status);
                goto rx_done;
        }
-       
+
        // block until data is available (if blocking is allowed)
        if ((status = acquire_sem_etc(dev->rx_sem_cb, 1, B_CAN_INTERRUPT | 
blockFlag, 0)) != B_NO_ERROR) {
                DPRINTF_ERR("cannot acquire read sem: %" B_PRIx32 ", %s\n", 
status, strerror(status));
@@ -522,14 +522,14 @@ pegasus_device_read(driver_cookie *cookie, off_t 
position, void *buffer, size_t
 #endif
                goto rx_done;
        }
-       
+
        if (dev->rx_status != B_OK) {
                status = usb->clear_feature(dev->pipe_in, 
USB_FEATURE_ENDPOINT_HALT);
                if (status != B_OK)
                        DPRINTF_ERR("clear_feature() error %s\n", 
strerror(status));
                goto rx_done;
        }
-       
+
        // copy buffer
        size = dev->rx_actual_length;
        if (size > MAX_FRAME_SIZE || (size - 2) > *_length) {
@@ -539,7 +539,7 @@ pegasus_device_read(driver_cookie *cookie, off_t position, 
void *buffer, size_t
                *_length = size - 2;
 
        memcpy(buffer, dev->rx_buffer, size);
-       
+
        DPRINTF_INFO("read done %ld\n", *_length);
 
 rx_done:
@@ -548,7 +548,7 @@ rx_done:
 }
 
 
-static status_t 
+static status_t
 pegasus_device_write(driver_cookie *cookie, off_t position,    const void 
*buffer, size_t *_length)
 {
        pegasus_dev *dev;
@@ -564,7 +564,7 @@ pegasus_device_write(driver_cookie *cookie, off_t position, 
const void *buffer,
 
        if (dev->aue_dying)
                return B_DEVICE_NOT_FOUND;              /* already unplugged */
-       
+
                // block until a free tx descriptor is available
        if ((status = acquire_sem_etc(dev->tx_sem, 1, B_TIMEOUT, 
ETHER_TRANSMIT_TIMEOUT)) < B_NO_ERROR) {
                DPRINTF_ERR("write: acquiring sem failed: %" B_PRIx32 ", %s\n", 
status, strerror(status));
@@ -576,10 +576,10 @@ pegasus_device_write(driver_cookie *cookie, off_t 
position,       const void *buffer,
                *_length = MAX_FRAME_SIZE;
 
        frameSize = *_length;
-       
+
        /* Copy data to tx buffer */
        memcpy(dev->tx_buffer+2, buffer, frameSize);
-       
+
        /*
         * The ADMtek documentation says that the packet length is
         * supposed to be specified in the first two bytes of the
@@ -588,16 +588,16 @@ pegasus_device_write(driver_cookie *cookie, off_t 
position,       const void *buffer,
         */
        dev->tx_buffer[0] = (uint8)frameSize;
        dev->tx_buffer[1] = (uint8)(frameSize >> 8);
-       
+
        // queue new request, bulk length is one more if size is a multiple of 
64
-       status = usb->queue_bulk(dev->pipe_out, dev->tx_buffer, ((frameSize + 
2) & 0x3f) ? frameSize + 2 : frameSize + 3, 
+       status = usb->queue_bulk(dev->pipe_out, dev->tx_buffer, ((frameSize + 
2) & 0x3f) ? frameSize + 2 : frameSize + 3,
                &pegasus_tx_callback, dev);
-       
+
        if (status != B_OK){
                DPRINTF_ERR("queue_bulk:failed:%08" B_PRIx32 "\n", status);
                goto tx_done;
-       }       
-       
+       }
+
        // block until data is sent (if blocking is allowed)
        if ((status = acquire_sem_etc(dev->tx_sem_cb, 1, B_CAN_INTERRUPT, 0)) 
!= B_NO_ERROR) {
                DPRINTF_ERR("cannot acquire write done sem: %" B_PRIx32 ", 
%s\n", status, strerror(status));
@@ -613,7 +613,7 @@ pegasus_device_write(driver_cookie *cookie, off_t position, 
const void *buffer,
                        DPRINTF_ERR("clear_feature() error %s\n", 
strerror(status));
                goto tx_done;
        }
-       
+
        *_length = frameSize;
 
 tx_done:
@@ -622,7 +622,7 @@ tx_done:
 }
 
 
-static status_t 
+static status_t
 pegasus_device_control(driver_cookie *cookie, uint32 op,
                void *arg, size_t len)
 {
@@ -641,12 +641,12 @@ pegasus_device_control(driver_cookie *cookie, uint32 op,
                case ETHER_INIT:
                        DPRINTF_INFO("control() ETHER_INIT\n");
                        return B_OK;
-               
+
                case ETHER_GETADDR:
                        DPRINTF_INFO("control() ETHER_GETADDR\n");
                        memcpy(arg, &device->macaddr, sizeof(device->macaddr));
                        return B_OK;
-                       
+
                case ETHER_NONBLOCK:
                        if (*(int32 *)arg) {
                                DPRINTF_INFO("non blocking mode on\n");
@@ -660,11 +660,11 @@ pegasus_device_control(driver_cookie *cookie, uint32 op,
                case ETHER_ADDMULTI:
                        DPRINTF_INFO("control() ETHER_ADDMULTI\n");
                        break;
-               
+
                case ETHER_REMMULTI:
                        DPRINTF_INFO("control() ETHER_REMMULTI\n");
                        return B_OK;
-               
+
                case ETHER_SETPROMISC:
                        if (*(int32 *)arg) {
                                DPRINTF_INFO("control() ETHER_SETPROMISC on\n");
@@ -677,17 +677,17 @@ pegasus_device_control(driver_cookie *cookie, uint32 op,
                        DPRINTF_INFO("control() ETHER_GETFRAMESIZE, framesize = 
%ld (MTU = %ld)\n", device->maxframesize,  device->maxframesize - 
ENET_HEADER_SIZE);
                        *(uint32*)arg = device->maxframesize;
                        return B_OK;
-                       
+
                default:
                        DPRINTF_INFO("control() Invalid command\n");
                        break;
        }
-       
+
        return err;
 }
 
 
-static status_t 
+static status_t
 pegasus_device_close(driver_cookie *cookie)
 {
        pegasus_dev *device;
@@ -717,7 +717,7 @@ pegasus_device_close(driver_cookie *cookie)
 }
 
 
-static status_t 
+static status_t
 pegasus_device_free(driver_cookie *cookie)
 {
        pegasus_dev *device;
@@ -746,14 +746,14 @@ pegasus_device_free(driver_cookie *cookie)
 ** to receive device added and removed events
 */
 
-static usb_notify_hooks notify_hooks = 
+static usb_notify_hooks notify_hooks =
 {
        &pegasus_device_added,
        &pegasus_device_removed
 };
 
 
-status_t 
+status_t
 init_hardware(void)
 {
        return B_OK;
@@ -764,7 +764,7 @@ status_t
 init_driver(void)
 {
        DPRINTF_INFO("init_driver(), built %s %s\n", __DATE__, __TIME__);
-       
+
 #if DEBUG_DRIVER
        if (load_driver_symbols(drivername) == B_OK) {
                DPRINTF_INFO("loaded symbols\n");
@@ -772,21 +772,21 @@ init_driver(void)
                DPRINTF_INFO("no symbols for you!\n");
        }
 #endif
-                       
+
        if (get_module(B_USB_MODULE_NAME, (module_info**) &usb) != B_OK) {
                DPRINTF_INFO("cannot get module \"%s\"\n", B_USB_MODULE_NAME);
                return B_ERROR;
-       } 
-       
+       }
+
        if ((gDeviceListLock = create_sem(1, "dev_list_lock")) < 0) {
                put_module(B_USB_MODULE_NAME);
                return gDeviceListLock;
        }
-       
-       usb->register_driver(kDriverName, supported_devices, 
+
+       usb->register_driver(kDriverName, supported_devices,
                sizeof(supported_devices)/sizeof(usb_support_descriptor), NULL);
        usb->install_notify(kDriverName, &notify_hooks);
-       
+
        return B_OK;
 }
 
@@ -795,7 +795,7 @@ void
 uninit_driver(void)
 {
        DPRINTF_INFO("uninit_driver()\n");
-       
+
        usb->uninstall_notify(kDriverName);
        delete_sem(gDeviceListLock);
        put_module(B_USB_MODULE_NAME);
@@ -830,7 +830,7 @@ find_device(const char* name)
                (device_write_hook)pegasus_device_write,
                NULL
        };
-       
+
        if (search_device_info(name) != NULL)
                return &hooks;
        return NULL;

############################################################################

Commit:      fa49d9714d157e270df065b5e7048f26d017e180
URL:         http://cgit.haiku-os.org/haiku/commit/?id=fa49d97
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Thu Oct  3 15:16:28 2013 UTC

neomagic: fixed a warning about an uninitialized variable.

----------------------------------------------------------------------------

diff --git a/src/add-ons/accelerants/neomagic/engine/nm_dac.c 
b/src/add-ons/accelerants/neomagic/engine/nm_dac.c
index e396eeb..db54be4 100644
--- a/src/add-ons/accelerants/neomagic/engine/nm_dac.c
+++ b/src/add-ons/accelerants/neomagic/engine/nm_dac.c
@@ -118,7 +118,7 @@ if (1)
                G = (ISARB(PALDATA) << 2);
                B = (ISARB(PALDATA) << 2);
                /* only compare the most significant 6 bits */
-               if (((r[i] & 0xfc) != R) || ((g[i] & 0xfc) != G) || ((b[i] & 
0xfc) != B)) 
+               if (((r[i] & 0xfc) != R) || ((g[i] & 0xfc) != G) || ((b[i] & 
0xfc) != B))
                        LOG(1,("DAC palette %d: w %x %x %x, r %x %x %x\n", i, 
r[i], g[i], b[i], R, G, B)); // apsed
        }
  }
@@ -147,7 +147,7 @@ status_t nm_dac_set_pix_pll(display_mode target)
        {
                return result;
        }
-       
+
        /*reprogram (disable,select,wait for stability,enable)*/
 //unknown on Neomagic?:
 //     DXIW(PIXCLKCTRL,(DXIR(PIXCLKCTRL)&0x0F)|0x04);  /*disable the PIXPLL*/
@@ -179,7 +179,7 @@ status_t nm_dac_set_pix_pll(display_mode target)
                time++;
                snooze(1);
        }
-       
+
        if (time > 2000)
                LOG(2,("DAC: PIX PLL frequency not locked!\n"));
        else
@@ -205,7 +205,7 @@ status_t nm_dac_pix_pll_find
 {
        int m = 0, n = 0, p = 0, n_max, m_max;
        float error, error_best = 999999999;
-       int best[2]; 
+       int best[2] = { 0, 0 };
        float f_vco, max_pclk;
        float req_pclk = target.timing.pixel_clock/1000.0;
 

############################################################################

Commit:      da9508d5e3fd0a06c6cf2458cb0ffdd84c1ef17f
URL:         http://cgit.haiku-os.org/haiku/commit/?id=da9508d
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Thu Oct  3 15:17:21 2013 UTC

rtf: fixed a warning about an uninitialized variable.

----------------------------------------------------------------------------

diff --git a/src/add-ons/translators/rtf/convert.cpp 
b/src/add-ons/translators/rtf/convert.cpp
index ea897e6..f198476 100644
--- a/src/add-ons/translators/rtf/convert.cpp
+++ b/src/add-ons/translators/rtf/convert.cpp
@@ -411,7 +411,7 @@ TextOutput::GroupEnd(RTF::Group *group)
        if (!fProcessRuns)
                return;
 
-       text_run *last;
+       text_run *last = NULL;
        fGroupStack.Pop(&last);
 
        // has the style been changed?

############################################################################

Commit:      6eb9729145a303905294be0e32978b7c67643cea
URL:         http://cgit.haiku-os.org/haiku/commit/?id=6eb9729
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Thu Oct  3 15:17:58 2013 UTC

tty: fixed warnings about an uninitialized variable.

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/drivers/tty/tty.cpp 
b/src/add-ons/kernel/drivers/tty/tty.cpp
index 4cc10d1..02b713d 100644
--- a/src/add-ons/kernel/drivers/tty/tty.cpp
+++ b/src/add-ons/kernel/drivers/tty/tty.cpp
@@ -1348,7 +1348,7 @@ tty_write_to_tty_master_unsafe(tty_cookie* sourceCookie, 
const char* data,
                // If in echo mode, we do the output conversion and need to 
update
                // the needed bytes count.
                char echoBuffer[3];
-               size_t echoBytes;
+               size_t echoBytes = 0;
                if (echo) {
                        process_output_char(source, c, echoBuffer, &echoBytes, 
true);
                        if (echoBytes > bytesNeeded)
diff --git a/src/add-ons/kernel/generic/tty/tty.cpp 
b/src/add-ons/kernel/generic/tty/tty.cpp
index 2d8cc68..7d978e2 100644
--- a/src/add-ons/kernel/generic/tty/tty.cpp
+++ b/src/add-ons/kernel/generic/tty/tty.cpp
@@ -1062,7 +1062,7 @@ tty_write_to_tty_master_unsafe(tty_cookie* sourceCookie, 
const char* data,
                // If in echo mode, we do the output conversion and need to 
update
                // the needed bytes count.
                char echoBuffer[3];
-               size_t echoBytes;
+               size_t echoBytes = 0;
                if (echo) {
                        process_output_char(source, c, echoBuffer, &echoBytes, 
true);
                        if (echoBytes > bytesNeeded)

############################################################################

Commit:      df6c32e882d142e780c546ff8817b79c7bee9029
URL:         http://cgit.haiku-os.org/haiku/commit/?id=df6c32e
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Fri Oct  4 14:04:25 2013 UTC

ps2: disable elantech support until it's more functional

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp 
b/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp
index 4f7137b..b625320 100644
--- a/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp
+++ b/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp
@@ -89,11 +89,13 @@ ps2_dev_detect_pointing(ps2_dev *dev, device_hooks **hooks)
                goto dev_found;
        }
 
+#if 0
        status = probe_elantech(dev);
        if (status == B_OK) {
                *hooks = &gElantechDeviceHooks;
                goto dev_found;
        }
+#endif
 
        // reset the mouse for the case that the previous probes leaf the mouse 
in
        // a undefined state

############################################################################

Revision:    hrev46171
Commit:      f0d09d4925c304099c45c2404da7945b72ce812b
URL:         http://cgit.haiku-os.org/haiku/commit/?id=f0d09d4
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Fri Oct  4 14:05:59 2013 UTC

ps2: rename a constant also used in pads

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_alps.cpp 
b/src/add-ons/kernel/bus_managers/ps2/ps2_alps.cpp
index 31affc9..0bc1dec 100644
--- a/src/add-ons/kernel/bus_managers/ps2/ps2_alps.cpp
+++ b/src/add-ons/kernel/bus_managers/ps2/ps2_alps.cpp
@@ -331,7 +331,7 @@ switch_hardware_tab(ps2_dev* dev, bool on)
        uint8 command = PS2_CMD_MOUSE_SET_RES;
        if (on) {
                arg = 0x0A;
-               command = PS2_CMD_KEYBOARD_SET_TYPEMATIC;
+               command = PS2_CMD_SET_TYPEMATIC;
        }
        if (ps2_dev_command(dev, PS2_CMD_MOUSE_GET_INFO, NULL, 0, val, 3) != 
B_OK
                || ps2_dev_command(dev, PS2_CMD_DISABLE, NULL, 0, NULL, 0) != 
B_OK
diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_defs.h 
b/src/add-ons/kernel/bus_managers/ps2/ps2_defs.h
index 25fbf1a..4ca02ce 100644
--- a/src/add-ons/kernel/bus_managers/ps2/ps2_defs.h
+++ b/src/add-ons/kernel/bus_managers/ps2/ps2_defs.h
@@ -55,7 +55,7 @@
 #define PS2_CMD_MOUSE_SET_STREAM               0xea
 #define PS2_CMD_KEYBOARD_SET_LEDS              0xed
 #define PS2_CMD_MOUSE_SET_POLL                 0xf0
-#define PS2_CMD_KEYBOARD_SET_TYPEMATIC 0xf3
+#define PS2_CMD_SET_TYPEMATIC                  0xf3
 #define PS2_CMD_ECHO                                   0xee
 #define PS2_CMD_TEST_PASSED                            0xaa
 #define PS2_CMD_GET_DEVICE_ID                  0xf2
diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp 
b/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp
index 06a6049..b41fdea 100644
--- a/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp
+++ b/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.cpp
@@ -113,7 +113,7 @@ set_typematic(int32 rate, bigtime_t delay)
                value |= 0 << 5;
 
        return ps2_dev_command(&ps2_device[PS2_DEVICE_KEYB],
-               PS2_CMD_KEYBOARD_SET_TYPEMATIC, &value, 1, NULL, 0);
+               PS2_CMD_SET_TYPEMATIC, &value, 1, NULL, 0);
 }
 
 
@@ -309,10 +309,10 @@ probe_keyboard(void)
                                B_PRIx32 "\n", cmdbyte, status);
                }
        }
-       
+
        status = ps2_dev_command(&ps2_device[PS2_DEVICE_KEYB],
                        PS2_CMD_GET_DEVICE_ID, NULL, 0, sKeyboardIds, 
sizeof(sKeyboardIds));
-       
+
        if (status != B_OK) {
                INFO("ps2: cannot read keyboard device id:%#08" B_PRIx32 "\n", 
status);
        }


Other related posts:

  • » [haiku-commits] haiku: hrev46171 - in src/add-ons: kernel/drivers/network/pegasus kernel/bus_managers/ps2 kernel accelerants/neomagic/engine - korli