Bug 1123553 - Fix -Wuninitialized warning in GonkDisplayJB.cpp by removing unnecessary error check. r=mwu
authorChris Peterson <cpeterson@mozilla.com>
Mon, 19 Jan 2015 21:44:27 -0800
changeset 251963 48409acb6e9847f9f007e95d112b08bbe1914d8a
parent 251962 aff44058c7992c1075b8e865e08d60ff30f62348
child 251964 38d39b4c3023a79e6bc47982a4e7ff38304bc9b7
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwu
bugs1123553
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1123553 - Fix -Wuninitialized warning in GonkDisplayJB.cpp by removing unnecessary error check. r=mwu
widget/gonk/libdisplay/GonkDisplayJB.cpp
--- a/widget/gonk/libdisplay/GonkDisplayJB.cpp
+++ b/widget/gonk/libdisplay/GonkDisplayJB.cpp
@@ -100,54 +100,52 @@ GonkDisplayJB::GonkDisplayJB()
     err = hw_get_module(POWER_HARDWARE_MODULE_ID,
                                            (hw_module_t const**)&mPowerModule);
     if (!err)
         mPowerModule->init(mPowerModule);
     ALOGW_IF(err, "Couldn't load %s module (%s)", POWER_HARDWARE_MODULE_ID, strerror(-err));
 
     mAlloc = new GraphicBufferAlloc();
 
-    status_t error;
 #if ANDROID_VERSION >= 21
     sp<IGraphicBufferProducer> producer;
     sp<IGraphicBufferConsumer> consumer;
     BufferQueue::createBufferQueue(&producer, &consumer, mAlloc);
 #elif ANDROID_VERSION >= 19
     sp<BufferQueue> consumer = new BufferQueue(mAlloc);
     sp<IGraphicBufferProducer> producer = consumer;
 #elif ANDROID_VERSION >= 18
     sp<BufferQueue> consumer = new BufferQueue(true, mAlloc);
     sp<IGraphicBufferProducer> producer = consumer;
 #else
     sp<BufferQueue> consumer = new BufferQueue(true, mAlloc);
 #endif
+
     mFBSurface = new FramebufferSurface(0, mWidth, mHeight, surfaceformat, consumer);
 
 #if ANDROID_VERSION == 17
     sp<SurfaceTextureClient> stc = new SurfaceTextureClient(
         static_cast<sp<ISurfaceTexture> >(mFBSurface->getBufferQueue()));
 #else
     sp<Surface> stc = new Surface(producer);
 #endif
+
     mSTClient = stc;
     mSTClient->perform(mSTClient.get(), NATIVE_WINDOW_SET_BUFFER_COUNT, 2);
     mSTClient->perform(mSTClient.get(), NATIVE_WINDOW_SET_USAGE,
                                         GRALLOC_USAGE_HW_FB |
                                         GRALLOC_USAGE_HW_RENDER |
                                         GRALLOC_USAGE_HW_COMPOSER);
 
     mList = (hwc_display_contents_1_t *)malloc(sizeof(*mList) + (sizeof(hwc_layer_1_t)*2));
     if (mHwc)
         mHwc->blank(mHwc, HWC_DISPLAY_PRIMARY, 0);
 
-    if (error == NO_ERROR) {
-        ALOGI("Starting bootanimation with (%d) format framebuffer", surfaceformat);
-        StartBootAnimation();
-    } else
-        ALOGW("Couldn't show bootanimation (%s)", strerror(-error));
+    ALOGI("Starting bootanimation with (%d) format framebuffer", surfaceformat);
+    StartBootAnimation();
 }
 
 GonkDisplayJB::~GonkDisplayJB()
 {
     if (mHwc)
         hwc_close_1(mHwc);
     if (mFBDevice)
         framebuffer_close(mFBDevice);