Received: by 10.223.164.202 with SMTP id h10csp503662wrb; Thu, 30 Nov 2017 14:07:29 -0800 (PST) X-Google-Smtp-Source: AGs4zMaMqof+fJ+59Lpj5lbJIy/Q6AJl3D6ko9wSyzTqYwQBgtP+vcK6He/B20Gg03A+ffRcMh8e X-Received: by 10.159.194.204 with SMTP id u12mr4061422plz.191.1512079649754; Thu, 30 Nov 2017 14:07:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512079649; cv=none; d=google.com; s=arc-20160816; b=p7eo/ua1R2zLAEssng7vFCiSIsLkPT1CZ+650UoM/6/Kop40GZvvkILs0Nf2Y3UMWN fxT3CVA6d2Gi5yWTNaBSYsv8wJqdM34/Dg3s+Snvg7XVV4i6xL7uuCZPtIErw/VSNhya IIM/oYSfE8ehOPfa8QUxu40ay+QIE3jJQFd4M4WtEm6s/TRLDcJL2yzWBuwLIo6dOYk2 8+Wpqn6EbDhSYmnD8/YdYGKtMw5n3RDr5tVFfphtx/DIuvoS93TrX24oIRDuuhwVg+sB MDqYDqSaRN+rEq0Bu0sr26ohgupml8POtt5xqJCksjynJB9Gg10MJyxdeWgOo+l8ZuhG jepA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=d3QwM6d6YhiMqvKHfmsP2TPXgrU3+EcRUZTsqMCIpqg=; b=TkBuCosjmH0cWcA9V/mjc8ywhow71Yma6lkNgp1gLG2vGFl5LBo5p7W3WefzFVmn2m KEIbZ7MEdAdFNk/GdouJ2/EuBEQtjvJk1k7WyWDPceKhuWzyiYJrniluLVVNDeTTuGbQ nSH5A2+aJ2FLVT2WoPE5a9Ouj3kl+K/cG6dDzDkRFmE5yF6kTQxC6u05RbdCVQ57kYGT +4X/dXXMV4gWBFBlQDVYtf34ty3oX046ZWCD8xci8pK/N6RWPaKZ6D2pUnn5QbZJVx61 ZZEZ9wh7KjQyoq9nBuO4IHo6YcDsUt9Jnx097l1eBiFbtSQK3OMnjj4DMvM9RqW037Bn TP8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NB0YI5KF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si3744409plo.833.2017.11.30.14.07.16; Thu, 30 Nov 2017 14:07:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NB0YI5KF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751497AbdK3WFl (ORCPT + 99 others); Thu, 30 Nov 2017 17:05:41 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:36132 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208AbdK3WFj (ORCPT ); Thu, 30 Nov 2017 17:05:39 -0500 Received: by mail-lf0-f68.google.com with SMTP id f20so9611532lfe.3; Thu, 30 Nov 2017 14:05:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=d3QwM6d6YhiMqvKHfmsP2TPXgrU3+EcRUZTsqMCIpqg=; b=NB0YI5KFrIH/maGIp54f5H+5Ch39YDjagtFZ5/5eb0IFen1So0KjxKfoDPeLpjtvt/ T1wRWwaHmg0USZDKFytMUDjTeF2Js5cKolJDGsYgBZHUwV5MNNDRrpEi1x2Noptu3Ahq yTdmTMsSIcyLsgi/e1Odr5ppa0pGAFchEAaxDL3h2LHdi5wm2cJWrohC6klfn33ocPe4 9y1xTSIictjsmCDHVM78Lq6QqZKFY6xqC4CjowcFB6FIgMqOI4HLOJdOuh56W3AZ2Xn4 k0wCaUcx1Ai4ZToWbhcYC4FT+JLUzG7xvAN6T+v9L0u1Q+ecDjNkguyvIYbs+xhNevNm UXJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=d3QwM6d6YhiMqvKHfmsP2TPXgrU3+EcRUZTsqMCIpqg=; b=Lv4skrFeD2aq4HjqYtxaQkoYVbxhoGVyZ0TOovJIBvT8jk78BymjZQqs8ltoosjCSr B5/rpEUsmdVPDtgQh+R/Rr0yqKToXvgEkYP+QYAGe/JVt2iEwaZaCSt8QnpPGdnoKC6N grLgvye78ls6/g19JVYOX9JinOhQ7yyJhFokM+2/XIV5TnOaKuUKs9Sho1YyLuv16eRL eS3ww+dTlFy2p2ErPCMR0ICc5ON92IvV1VSFCrdkfRR8P5TYy4rbMYo1iJLPQMFeHrYD suwmm+4TtmzNXDnddfTr8HxJSyNM6Gc8hfc3iZ8RtNL+Xgl31UotDdRNH16vQIUDoohf ybWA== X-Gm-Message-State: AJaThX5/Q8+JsCAYUF6qLnVYZ7c6F3C7k061nKbWCa9GGGqwclbtZfmc UU6U6PNAEBo58CbKhKjdxWE2mI4l X-Received: by 10.46.17.18 with SMTP id f18mr3661670lje.167.1512079538051; Thu, 30 Nov 2017 14:05:38 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id w17sm873244lff.88.2017.11.30.14.05.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Nov 2017 14:05:37 -0800 (PST) From: Vasyl Gomonovych To: linux-usb@vger.kernel.org Cc: Vasyl Gomonovych , Greg Kroah-Hartman , Thomas Gleixner , Mariusz Skamra , Alexey Dobriyan , Kuppuswamy Sathyanarayanan , "Gustavo A. R. Silva" , Romain Perier , linux-kernel@vger.kernel.org Subject: [PATCH] usb: host: fotg210: Use dma_pool_zalloc Date: Thu, 30 Nov 2017 23:05:24 +0100 Message-Id: <1512079527-22899-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replacing dma_pool_alloc and memset with a single call to dma_pool_zalloc Signed-off-by: Vasyl Gomonovych --- drivers/usb/host/fotg210-hcd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 62fc955085a1..f3e1e7df88a5 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -1865,11 +1865,9 @@ static struct fotg210_qh *fotg210_qh_alloc(struct fotg210_hcd *fotg210, qh = kzalloc(sizeof(*qh), GFP_ATOMIC); if (!qh) goto done; - qh->hw = (struct fotg210_qh_hw *) - dma_pool_alloc(fotg210->qh_pool, flags, &dma); + qh->hw = dma_pool_zalloc(fotg210->qh_pool, flags, &dma); if (!qh->hw) goto fail; - memset(qh->hw, 0, sizeof(*qh->hw)); qh->qh_dma = dma; INIT_LIST_HEAD(&qh->qtd_list); @@ -4121,7 +4119,7 @@ static int itd_urb_transaction(struct fotg210_iso_stream *stream, } else { alloc_itd: spin_unlock_irqrestore(&fotg210->lock, flags); - itd = dma_pool_alloc(fotg210->itd_pool, mem_flags, + itd = dma_pool_zalloc(fotg210->itd_pool, mem_flags, &itd_dma); spin_lock_irqsave(&fotg210->lock, flags); if (!itd) { @@ -4131,7 +4129,6 @@ static int itd_urb_transaction(struct fotg210_iso_stream *stream, } } - memset(itd, 0, sizeof(*itd)); itd->itd_dma = itd_dma; list_add(&itd->itd_list, &sched->td_list); } -- 1.9.1 From 1585531055843157262@xxx Thu Nov 30 22:17:25 +0000 2017 X-GM-THRID: 1585528713414404104 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread