From patchwork Sat Oct 24 12:09:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: punit vara X-Patchwork-Id: 7480181 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 624A19F37F for ; Sat, 24 Oct 2015 12:10:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FD81208C1 for ; Sat, 24 Oct 2015 12:10:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7595420776 for ; Sat, 24 Oct 2015 12:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751848AbbJXMKH (ORCPT ); Sat, 24 Oct 2015 08:10:07 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:34619 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751543AbbJXMKH (ORCPT ); Sat, 24 Oct 2015 08:10:07 -0400 Received: by wikq8 with SMTP id q8so108183932wik.1; Sat, 24 Oct 2015 05:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=cyeyNOZaAbgg9LxXoBJCQhS/dMC7tl64gfqZ3Y0M4yc=; b=OUnR/W/vY6WDGQRBZZJ594AG+qQRhfvleDX7wDCL93Q2q8wMVL7JzTewPpbpw6ByMo f7xAbx1kB2E50BP0vF9BP17Fe5f77i422Af/COdScRGpIH/HzKRvv6Wg3eLdPc9FRR3c Q26wp+/ns8ywj/XqEGjD9Nk5KIAWMJV5SkyzzwZVHKyUpd8TXhSsPm87z22KU2PLZTBU 0TBwPMmvUFmZprBwkPWO2FjhpZKOPY68mKj2LvI4Feks+ptVFryOhQD8tCpinC9eTn7i j7++n9rQO2t/szEZrnzgCkwvoY7QARBPzspxByYJJEEbm2p8pPex0tdNlTTPBmPN7V9R iEhQ== X-Received: by 10.180.86.202 with SMTP id r10mr10436631wiz.32.1445688604771; Sat, 24 Oct 2015 05:10:04 -0700 (PDT) Received: from localhost.localdomain ([163.47.14.16]) by smtp.gmail.com with ESMTPSA id pb4sm27816619wjb.8.2015.10.24.05.10.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 24 Oct 2015 05:10:04 -0700 (PDT) From: Punit Vara To: don.brace@pmcs.com Cc: iss_storagedev@hp.com, storagedev@pmcs.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Punit Vara Subject: [PATCH] block: remove useless casting value returned by kmalloc to structure Date: Sat, 24 Oct 2015 17:39:49 +0530 Message-Id: <1445688589-5856-1-git-send-email-punitvara@gmail.com> X-Mailer: git-send-email 2.5.3 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 This is the patch to the cciss_scsi.c file that resolves following warning reported by coccicheck: WARNING: casting value returned by memory allocation function to (struct cciss_scsi_adapter_data_t *) is useless. Signed-off-by: Punit Vara Reviewed-by: Matthew R. Ochs --- drivers/block/cciss_scsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 1537302..4c27032 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c @@ -703,8 +703,7 @@ cciss_scsi_setup(ctlr_info_t *h) struct cciss_scsi_adapter_data_t * shba; ccissscsi[h->ctlr].ndevices = 0; - shba = (struct cciss_scsi_adapter_data_t *) - kmalloc(sizeof(*shba), GFP_KERNEL); + shba = kmalloc(sizeof(*shba), GFP_KERNEL); if (shba == NULL) return; shba->scsi_host = NULL;