From patchwork Wed Aug 15 09:33:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wang yanqing X-Patchwork-Id: 1325021 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id F2F58DFFED for ; Wed, 15 Aug 2012 09:34:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751815Ab2HOJeD (ORCPT ); Wed, 15 Aug 2012 05:34:03 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:47449 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751684Ab2HOJeC (ORCPT ); Wed, 15 Aug 2012 05:34:02 -0400 Received: by yhmm54 with SMTP id m54so1532361yhm.19 for ; Wed, 15 Aug 2012 02:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=LqVbADWKMtKOsoRbhyBDCn6CawA9TF3gdh0OU1Q3OHY=; b=wZxfgpbqradY30kIeA2pWMTq6qBm3YnOHlJLl3U2SVYga5Z1Fk4UWIY7swnKAq2Jtu ZcMkmfMJrwryhOrsBNVDFrpDx5kgYHw+sCQs1cmBbzfsSEZoTZnfo8k6AG97I9tDVHAP 2bGZchaPXWMD/KibCVVznnnvhaPGaa7vR29NxRBP7jK13jBiZulmEljJPElqCvViAPMC JHkX4GLD0pWjUAnSLN6BZEDiui0nHrxRQSzgdjsHJ04eMQTr2gjDU8+MgPp8uya+I5I2 DHW6RpXA3oDG9KDEKQIYp/RwVubWGyW0OIP9KnnEuv6nouU07SdBDcqT2SDLS3UqkFmk KI0Q== Received: by 10.68.193.196 with SMTP id hq4mr25842933pbc.32.1345023240696; Wed, 15 Aug 2012 02:34:00 -0700 (PDT) Received: from udknight.localhost ([61.131.64.2]) by mx.google.com with ESMTPS id gv1sm417478pbc.38.2012.08.15.02.33.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Aug 2012 02:34:00 -0700 (PDT) Received: from udknight.localhost (udknight.localhost [127.0.0.1]) by udknight.localhost (8.14.4/8.14.4) with ESMTP id q7F9XwE2032745; Wed, 15 Aug 2012 17:34:13 +0800 Received: (from root@localhost) by udknight.localhost (8.14.4/8.14.4/Submit) id q7F9Xqqk032708; Wed, 15 Aug 2012 17:33:52 +0800 Date: Wed, 15 Aug 2012 17:33:52 +0800 From: Wang YanQing To: FlorianSchandinat@gmx.de Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, spock@gentoo.org Subject: [PATCH] video:uvesafb: reduce the double check Message-ID: <20120815093352.GA32425@udknight> Mail-Followup-To: Wang YanQing , FlorianSchandinat@gmx.de, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, spock@gentoo.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org uvesafb_open had checked the par->vbe_state_size, so we don't need to check it again in uvesafb_vbe_state_save, this patch just can reduce a few lines of code. Signed-off-by: Wang YanQing --- drivers/video/uvesafb.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index 2f8f82d..b064a3e 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -357,9 +357,6 @@ static u8 *uvesafb_vbe_state_save(struct uvesafb_par *par) u8 *state; int err; - if (!par->vbe_state_size) - return NULL; - state = kmalloc(par->vbe_state_size, GFP_KERNEL); if (!state) return ERR_PTR(-ENOMEM);