From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F814C04E53 for ; Wed, 15 May 2019 13:16:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 324F220843 for ; Wed, 15 May 2019 13:16:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557926178; bh=1TxEXFah2M9u43FIIA78oBJ2DyOsfI9FRsah6e17zWM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=oaoVv1IamrxaAKmVDlMt1ztEdqr6yC/ZuDHpoTT7yljrT1wuFinubNMHi3EUfuKvF gWovVJgeaQsLoFVgcTVY+XkWYslcM9FBSA5d5EeWjhzovCpjR1Mc7keHcE4TcAnK6J FJsOQt+321Ep6HiKblEyFnkaOIg0S7XhAw1iz6h8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727561AbfEONQR (ORCPT ); Wed, 15 May 2019 09:16:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:42002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726752AbfEONQQ (ORCPT ); Wed, 15 May 2019 09:16:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C8B020862; Wed, 15 May 2019 13:16:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557926175; bh=1TxEXFah2M9u43FIIA78oBJ2DyOsfI9FRsah6e17zWM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KlEjSZvgMb3mBU3d3OJfPt+KqQQR5m6rieM6xRBDwBt9z9EGW+lLJ1jNxpcYrmmM5 GA+0mmOCJb4GciqwsvWO9j45gqEPK9EC8633dI7lgS6K4juUP0v4tU8Gx/UVbL6D6i VsGDrFKXtmJZsG4g6tic8bOV4F8AtUsEMKGPC3bs= Date: Wed, 15 May 2019 15:16:13 +0200 From: Greg Kroah-Hartman To: kbuild test robot Cc: Matt Sickler , kbuild-all@01.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: kpc2000: fix alloc_cast.cocci warnings Message-ID: <20190515131613.GA23302@kroah.com> References: <201905152009.JVEMePDb%lkp@intel.com> <20190515121615.GA52823@lkp-kbuild04> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190515121615.GA52823@lkp-kbuild04> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 15, 2019 at 08:16:15PM +0800, kbuild test robot wrote: > From: kbuild test robot > > drivers/staging/kpc2000/kpc_dma/fileops.c:60:8-26: WARNING: casting value returned by memory allocation function to (struct aio_cb_data *) is useless. > > Remove casting the values returned by memory allocation functions > like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc. > > Semantic patch information: > This makes an effort to find cases of casting of values returned by > kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc, > kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes > the casting as it is not required. The result in the patch case may > need some reformatting. > > Generated by: scripts/coccinelle/api/alloc/alloc_cast.cocci > > Fixes: 7df95299b94a ("staging: kpc2000: Add DMA driver") > CC: Matt Sickler > Signed-off-by: kbuild test robot > --- > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 5ac94332248ee017964ba368cdda4ce647e3aba7 > commit: 7df95299b94a63ec67a6389fc02dc25019a80ee8 staging: kpc2000: Add DMA driver > > fileops.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/drivers/staging/kpc2000/kpc_dma/fileops.c > +++ b/drivers/staging/kpc2000/kpc_dma/fileops.c > @@ -57,7 +57,7 @@ int kpc_dma_transfer(struct dev_private > > dev_dbg(&priv->ldev->pldev->dev, "kpc_dma_transfer(priv = [%p], kcb = [%p], iov_base = [%p], iov_len = %ld) ldev = [%p]\n", priv, kcb, (void*)iov_base, iov_len, ldev); > > - acd = (struct aio_cb_data *) kzalloc(sizeof(struct aio_cb_data), GFP_KERNEL); > + acd = kzalloc(sizeof(struct aio_cb_data), GFP_KERNEL); > if (!acd){ > dev_err(&priv->ldev->pldev->dev, "Couldn't kmalloc space for for the aio data\n"); > return -ENOMEM; Already fixed in my staging-testing branch, thanks. greg k-h