From patchwork Wed Sep 4 12:35:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Winkler, Tomas" X-Patchwork-Id: 2853636 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6E105C0AB5 for ; Wed, 4 Sep 2013 12:36:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 54E9020303 for ; Wed, 4 Sep 2013 12:36:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0D8B20207 for ; Wed, 4 Sep 2013 12:36:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762376Ab3IDMgy (ORCPT ); Wed, 4 Sep 2013 08:36:54 -0400 Received: from mga14.intel.com ([143.182.124.37]:53236 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755625Ab3IDMgy (ORCPT ); Wed, 4 Sep 2013 08:36:54 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 04 Sep 2013 05:36:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,1021,1367996400"; d="scan'208";a="290697370" Received: from twinkler-dhg.jer.intel.com ([10.12.87.116]) by AZSMGA002.ch.intel.com with ESMTP; 04 Sep 2013 05:36:45 -0700 From: Tomas Winkler To: gregkh@linuxfoundation.org Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Tomas Winkler , Randy Dunlap Subject: [char-misc-next] hpet: remove useless check if fixmem32 is NULL Date: Wed, 4 Sep 2013 15:35:52 +0300 Message-Id: <1378298152-30765-1-git-send-email-tomas.winkler@intel.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fixmem32 is assigned to address of res->data member so the address is always valid Actually since we are not checking for res != NULL static analyzing is complaining about referencing the pointer and consequent check for null. The code snippet looks confusing also for human eyes. Cc: Randy Dunlap Signed-off-by: Tomas Winkler --- drivers/char/hpet.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 448ce5e..c8f4329 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -971,8 +971,6 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data) struct acpi_resource_fixed_memory32 *fixmem32; fixmem32 = &res->data.fixed_memory32; - if (!fixmem32) - return AE_NO_MEMORY; hdp->hd_phys_address = fixmem32->address; hdp->hd_address = ioremap(fixmem32->address,