Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1464464pxa; Thu, 20 Aug 2020 11:59:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRB7suENfZNoxM2ovKywvaF1JWCRq3IV/0AFxSrO5RKCzbPLvbqIDjqi5S2ZMR82W8KpaQ X-Received: by 2002:a05:6402:3088:: with SMTP id de8mr5552edb.88.1597949999308; Thu, 20 Aug 2020 11:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597949999; cv=none; d=google.com; s=arc-20160816; b=Wi85eLxY+UKCVz5K9VWmQHi7zj80ZwJ+y86blWA9o/XfajGe4k4qV0qnT4+sxc6Ie6 2dTuBZdxoHEkt+Iq2JNc0fxsYgbGqloJ9khGTbbZc0L2TnC647otmHwDPdVYVU3Sw0sT /LgV5Q/98grijfipcujlX7hiQGupycTv64FACQzs4USXyHdZg2Suf0ejge7QlUnnXuwD 1ApLwG/vHuRNNpdibR9Liu03iS821sv0P0lROcE5VgWfSh2gPR5fOk4hdIuxLfHW/rLw qwEXxgKvX2eCWQ2MwAg6v0TCMOhI19t/PwCM3dx+u74In4rx678Jk91VXa9cjeKeLyP9 R4Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=D2knyK2NI/0zEQhqBEmeYzCiqIf2nh2bPQqBRntv250=; b=Qr4ufeLp6N+v1EpmNg8d/3CUy8ATr1Q8ZDkAeZjKSsI+hToQ31oWArQm5a5TlL3iT8 sPR/sTbwa8uCCHf6q21NJsUURRBE91d8KpZ2L1XYYcQSbup2bt964fl+b2gRMxeA/vR1 fBJTmr7WAahIVJLvH0k4APWvBenPkWxnRMR4WYBUun7YGkf7LP6ebdARO/qQaM+5EmE0 Rc7uHXgEw7scO+dcBb/nEqVM9XylFWfANNnRC9LvibQfgmadcjufaXZSp5/CU4RBle62 aceBgzG1FDqC9q9iIle+B8uu+4rzgPYyYSH5Ex21R+eZ8S1HtHXurAiqmykUQzTyk9NC iSOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L9rMDH8o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si1982030eda.489.2020.08.20.11.59.35; Thu, 20 Aug 2020 11:59:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L9rMDH8o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727882AbgHTS40 (ORCPT + 99 others); Thu, 20 Aug 2020 14:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbgHTS4Z (ORCPT ); Thu, 20 Aug 2020 14:56:25 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF83EC061385; Thu, 20 Aug 2020 11:56:24 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id l2so3147269wrc.7; Thu, 20 Aug 2020 11:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=D2knyK2NI/0zEQhqBEmeYzCiqIf2nh2bPQqBRntv250=; b=L9rMDH8oLiXXtnMRb71uBQEgwEYdT4SmnwHQx7cYgBlDWxuaTcQCVtpMEnl9uJS5qs LPkgzZ64LGJEEBiyQC5xuTQMTYWYfB3fKvXUM7QH5u5tvcs8r00h8W5HeZ20lkB2+Dyp 7PMtAj0ISWB8MSK9nrP2uGnmEebAf2wND8O9yOPRFxHbxGmqRNDjK0gJSkRtgQ+5OYXG xVAetHKQCXde5uZOlIhcl1ZGv4Xv+kQtX7yOtsbmSmiaiDHcILNlXvD1We2HVxQdgaof XUhactJxk2tEbs2EUqnGjg3SiSYb4v00kfkEDR9uCDRLKGB+iVR7v6A9cfcG39NyFsH+ LWpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=D2knyK2NI/0zEQhqBEmeYzCiqIf2nh2bPQqBRntv250=; b=pZ8tuHeWYBQAER+1YGt5VMoPikvVTjbF1eKaopUD6zUZldEGKHny30DicNorhQcXZz 1sNwnZ4GVgwXsUzJSiO6RO3k7tzGvA8p+47enfwrd2zWUzZ3qmuqqp0QjfJ80K26PeWZ a5Z0+EN9mUTQWaS/XDMwQFCB9vHAeGWSMY9gPSQabr860QZlMDqTTv61RKOBdXJoSVZR zRRmR5VzpZNjJBmz+lFnoe7gmroaZf4t0nEczEaZIF9qZmDG0TN66HieesdhrVDVejas tQAtJ5+eFHHlqTESHR6zDHiFmzWKQs62ZngHyqKd+X9iVU7s1KYXedQBwVCteYKBTG/c QJCQ== X-Gm-Message-State: AOAM530YW/i0bTEc/wgEXtaWZ8eQg8GWFWOPQZt7hP82+tZW7Y7Wsf5x 8G6uB/1fsSjqeCsCEhtvifxT1r4qYWMtPfT6 X-Received: by 2002:adf:fb87:: with SMTP id a7mr117350wrr.390.1597949783580; Thu, 20 Aug 2020 11:56:23 -0700 (PDT) Received: from medion (cpc83661-brig20-2-0-cust443.3-3.cable.virginm.net. [82.28.105.188]) by smtp.gmail.com with ESMTPSA id 124sm5800326wmd.31.2020.08.20.11.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 11:56:23 -0700 (PDT) From: Alex Dewar X-Google-Original-From: Alex Dewar Date: Thu, 20 Aug 2020 19:56:20 +0100 To: Joe Perches Cc: Alex Dewar , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: mptfusion: Remove unnecessarily casts Message-ID: <20200820185620.ysfdpzjj4qrquqbz@medion> References: <20200820180552.853289-1-alex.dewar90@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 20, 2020 at 11:53:58AM -0700, Joe Perches wrote: > On Thu, 2020-08-20 at 19:05 +0100, Alex Dewar wrote: > > In a number of places, the value returned from pci_alloc_consistent() is > > unnecessarily cast from void*. Remove these casts. > [] > > diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c > [] > > @@ -4975,7 +4975,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc) > > > > if (hdr.PageLength > 0) { > > data_sz = hdr.PageLength * 4; > > - ppage0_alloc = (LANPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); > > + ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); > > rc = -ENOMEM; > > if (ppage0_alloc) { > > memset((u8 *)ppage0_alloc, 0, data_sz); > > If you are removing unnecessary casts, it'd be better to remove > all of them in the same file or subsystem at once. > > Also this memset and cast isn't actually necessary any more > as pci_alloc_consistent already zeros memory. > > etc... > Good suggestion. Thanks for the feedback :-)