From patchwork Fri Oct 23 20:03:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: punit vara X-Patchwork-Id: 7478411 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7D89BBEEA4 for ; Fri, 23 Oct 2015 20:04:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A33EE20A1B for ; Fri, 23 Oct 2015 20:04:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D268C20A18 for ; Fri, 23 Oct 2015 20:04:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752410AbbJWUEY (ORCPT ); Fri, 23 Oct 2015 16:04:24 -0400 Received: from mail-wi0-f193.google.com ([209.85.212.193]:35183 "EHLO mail-wi0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752073AbbJWUEX (ORCPT ); Fri, 23 Oct 2015 16:04:23 -0400 Received: by wicuv6 with SMTP id uv6so7174786wic.2; Fri, 23 Oct 2015 13:04:22 -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:in-reply-to:references; bh=cUbk2JaqiFPUPPCgs46dc325O9uH3tgxQrmpc5PukzE=; b=h7yQU9Yv+PM6GvI9pE1NfohZbHBqjyTD1ljthSHnzUO0VaJEaXJI0ApB1urVsBotRk Ed7XCAitXH+DmhtbxZNdtMV+OlogL0aNSwe5uqq8RltLXgAuku5So6Rbt2fTtnOr6OFD h8O1/qZAMvNtN36iGhkkPFcdjMfpxArNfQOcQHwIynAI20Am9oUz8nJYU3qH+IuHCSHa j9WQDBtCS/9GCPAu4UVGFIb7hBa28WdzkRXaB2KwDd4BD0qUirxCl2r07ScGptBBGHTA 6kMYxkyM4o3iJ1x+VMTEkY77TtFVJASdo7rxZPtBlLvbBF8D2Ip8b1aCJzrvCgLQzTAg vJfQ== X-Received: by 10.180.208.82 with SMTP id mc18mr6176082wic.85.1445630662058; Fri, 23 Oct 2015 13:04:22 -0700 (PDT) Received: from localhost.localdomain ([163.47.14.14]) by smtp.gmail.com with ESMTPSA id i10sm4107408wij.9.2015.10.23.13.04.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Oct 2015 13:04:21 -0700 (PDT) From: Punit Vara To: JBottomley@odin.com Cc: don.brace@pmcs.com, storagedev@pmcs.com, iss_storagedev@hp.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Punit Vara Subject: [PATCH 2/2] scsi: remove useless casting value returned by kmalloc to structure Date: Sat, 24 Oct 2015 01:33:53 +0530 Message-Id: <1445630633-14209-3-git-send-email-punitvara@gmail.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1445630633-14209-1-git-send-email-punitvara@gmail.com> References: <1445630633-14209-1-git-send-email-punitvara@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, 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 hpsa.c file that resolves following warning reported by coccicheck: WARNING: casting value returned by memory allocation function to (BIG_IOCTL_Command_struct *) is useless. Signed-off-by: Punit Vara Reviewed-by: Matthew R. Ochs --- drivers/scsi/hpsa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 40669f8..8d971b3 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -6027,8 +6027,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp) return -EINVAL; if (!capable(CAP_SYS_RAWIO)) return -EPERM; - ioc = (BIG_IOCTL_Command_struct *) - kmalloc(sizeof(*ioc), GFP_KERNEL); + ioc = kmalloc(sizeof(*ioc), GFP_KERNEL); if (!ioc) { status = -ENOMEM; goto cleanup1;