From patchwork Sat Aug 4 07:10:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Salil Kapur X-Patchwork-Id: 10555609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E30F13B4 for ; Sat, 4 Aug 2018 07:10:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E4F12ABF0 for ; Sat, 4 Aug 2018 07:10:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10DD72ABFA; Sat, 4 Aug 2018 07:10:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B34662ABF0 for ; Sat, 4 Aug 2018 07:10:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726947AbeHDJKD (ORCPT ); Sat, 4 Aug 2018 05:10:03 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:40440 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbeHDJKD (ORCPT ); Sat, 4 Aug 2018 05:10:03 -0400 Received: by mail-pl0-f66.google.com with SMTP id s17-v6so3511524plp.7; Sat, 04 Aug 2018 00:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=yf61xEva5q+UDmzb0Gn7V4uPpAtWDH7iwpCQV4qx7vs=; b=B82J4QqdDBlslu1FZ2lCm8TrEYnadCroZNsldoWSLeq2/56fyXC+DV1gnoZcA0QLIC /WLh9DkMDjQ+8NTqpMImDmQNy7g+BPWg8258Yxc5nLRL0pMc1QQu5qkZp56PXi5J2LTO EQ8LvrkO5RRRWtr07jILtJ6uqXYQ+G2K2nUJvMvaxDcxyfkkktUgc5bN4ordoOTO49fF ZoV+W4e5LbOeJ4DY7pPYAea75mk4Xr8YEwa2NiDVw2pDgxpWT+RBD3td26rTD/01CJ8Q fSDuZTpBepLmuOR4CSTW2kSijxhnhZKI5sS1TmhozynDWaLEehnJuRX8EPZ28VZwxfg+ /SKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=yf61xEva5q+UDmzb0Gn7V4uPpAtWDH7iwpCQV4qx7vs=; b=fNJTdz5ngNtafyFwb0BQDAkhXzDU+3Key50iEEvNRXadBYaGliUx/TuaKAtZBc4pll EZVKCfYnsndhN0DBdw2fD9hfeRFuqGKZXdKbZB+3S8h0q4FWF93bcLZdxx2cOPaiX8YW qucIWD+lXc5EvO3zTtL7k8PYSQiT+aNWLAS/qmVXvRIy+tzK8iJoxmzrfMyo6JA4Zg/x q3nIO2pQ/NNNd8pHti6J9TIehGpePIf0K5mcG/63fFzYkJRzEH5VZ6A9MA0TSjUGrw7G gNzrMwngPgm5HzQABtfOOKw3F9zotH/p78gvhCC6j9bIWFlnk+iAY3DVNLIugqKJRYWa 4Dsw== X-Gm-Message-State: AOUpUlGYs+/tsQ0OMO8Y087wU6ep62TB43lNwa8cBus5vrnymRnUA/WT rphqfkHbAE4NiBDqFU30BCGIag3s X-Google-Smtp-Source: AAOMgpfVxBJgI+XN8cnal5cRPY+7J0YWMpygCozxqVy9/iweTS0CqCncSLaXZfiIxVUyQtHiD4jGTQ== X-Received: by 2002:a17:902:1c8:: with SMTP id b66-v6mr6375453plb.273.1533366623700; Sat, 04 Aug 2018 00:10:23 -0700 (PDT) Received: from Salils-MacBook-Air.local ([2601:600:a27f:d810:d077:b4f0:b680:ad6b]) by smtp.gmail.com with ESMTPSA id a11-v6sm11499988pfl.66.2018.08.04.00.10.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Aug 2018 00:10:22 -0700 (PDT) To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org From: Salil Kapur Subject: [PATCH] USB: Removing NULL check for pool since dma_pool_destroy is safe Message-ID: Date: Sat, 4 Aug 2018 00:10:22 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Removing NULL check for pool since dma_pool_destroy is safe Signed-off-by: Salil Kapur ---  drivers/usb/core/buffer.c | 8 ++------  1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c index 77eef8acff94..f641342cdec0 100644 --- a/drivers/usb/core/buffer.c +++ b/drivers/usb/core/buffer.c @@ -101,12 +101,8 @@ void hcd_buffer_destroy(struct usb_hcd *hcd)          return;        for (i = 0; i < HCD_BUFFER_POOLS; i++) { -        struct dma_pool *pool = hcd->pool[i]; - -        if (pool) { -            dma_pool_destroy(pool); -            hcd->pool[i] = NULL; -        } +        dma_pool_destroy(hcd->pool[i]); +        hcd->pool[i] = NULL;      }  }