Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp762680pxb; Tue, 12 Apr 2022 12:48:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMDfIJ1I5nXUbf02B2iTuN/xcpnHxMUJMGpwV/hvQGBx/mnHFd+6betY5/ByLz0zdinjw/ X-Received: by 2002:a63:485d:0:b0:39d:8ebf:9acf with SMTP id x29-20020a63485d000000b0039d8ebf9acfmr4579283pgk.351.1649792891693; Tue, 12 Apr 2022 12:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649792891; cv=none; d=google.com; s=arc-20160816; b=newc/zh/YFF7QUD7Yx4BP85fwqz29BigLFnWVbpW0o1OUvEvwRtY1g7Cr9TW/6Ojiz BN6Hb71RgUvLccMo2kb7eCVPMk85UAgIN44IEh31Vq/GTR7Mhbn5uyY0Dfs8H0n1Bwwk PXpbNrkxg+7DqQc8hkxWZyBHFPn94+4VucaGAFDl0n17w0kqIfcJ+6RVWE+vIRZdCSq+ ltONWrviWI6tdlLmRgG3VIwCpwm5G/9I7p6S/1cFaEVX9W49X0U4hB6wgcGMJ4U3jn64 WhdTihu58m+zIapbiGJQYd1kar+rB2qHyi7O5GT2nasZB0mXQltmDK6F+ROx2IEYmNkZ +LTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TVXrBloFtORkonGCujGmdgK1BPi5/BKdnl6pJMRy7hs=; b=c19YeC2x5mghpV5H7XeB1/Pn1agTM5lIVQhHFbD2FdkEQTCpAVY+OK02j7ukC/1PuE +tNKQQ28LMZShhfMFlhqAQhqs6+Ko+/nAY4/8t5MhGMjW7k+9czD5MWUvC3ey805Fy9V 4Lnb5snERhKPSIHjD+Kp/XUc0mR4tt7NDPeK25roB4VVgqxCaU7j82el3oxiYwWghoqx JNN/v7PS3XG/yCzF5U3bs9e0uuj3frQhtiOjHzUwh4Z8TmLSNCN8CfTBTsZHXdLKcnCT P012kGNpAvY0Ly+Q8Z4LQxqIzf83+NdHW4ArhwWctU0XbL+C5SuHrlG8BOmhzakegfTP RXVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Q40Tkt7p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c7-20020a656747000000b0039d3482d602si4048292pgu.54.2022.04.12.12.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 12:48:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Q40Tkt7p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 180CD1261F; Tue, 12 Apr 2022 12:44:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345445AbiDKK0I (ORCPT + 99 others); Mon, 11 Apr 2022 06:26:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345442AbiDKKZb (ORCPT ); Mon, 11 Apr 2022 06:25:31 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D73E345061 for ; Mon, 11 Apr 2022 03:22:20 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id bo5so14211281pfb.4 for ; Mon, 11 Apr 2022 03:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TVXrBloFtORkonGCujGmdgK1BPi5/BKdnl6pJMRy7hs=; b=Q40Tkt7prSxfeUG0mZFUtG9SRNWCCsWmxBgoXKMlowy/nXoUagFtxhayjTlYcgKWjh ozjjM9ZwuzkhlR+/XhGWKToKJf+deAihW7QXvFDeYp75aNXAPDLS0p8pNiR+l4H+qfgC 1L8/QuPPUlszG1+VO3fnsdkM9xIf2TeSMFSGEhv1UnpzESEMblVaLuDF8CaOUyksMLPj byiXEqP3nA+hME6WWe/jRXCnHbvT1tlNhFB5avC3VkXa7xJxdIsOcVYXgXR012saBEDM 3FU04QUm/8aGwV9czYBGjB2SNKbJC97JnlOjvsmcIK2GiTGVX0P+DnWNCd0q68PH4fWj hofA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TVXrBloFtORkonGCujGmdgK1BPi5/BKdnl6pJMRy7hs=; b=K6/OjqpH1dgn3t6RLYjtoks8RPFuPDEQtfB1thKIIZM13Sp+FVWeCyFsHzao82n0QK JxfPxQZI9k8y02yOUri4JPAkDdRWsSyxw4hlovRhfzdG9TwV0W+4bp4TpBfT6arf7NVh 3GQ26WdiPGwhEd4hvBfsWpwWwqCVeYNQuk6GzzCc2WEjkn88asJee0ZgU7V3Yww3Ay0F +D9uxGYee5xId9s9W4Rnmzdl6S4kj9bQZ0LUD/yP85TVKzcuWxZITW1WiVQDp/CHCwjC v3r5VOR++lyfoZD9zmYYwpqNswt8TCYe29dH1HWqta/YufiDjN+F8daGi6urnItS6Fpw faFw== X-Gm-Message-State: AOAM533o1AjpE0/79YaFQjy0RNipmFU3itSdlCaba7Fn8vYtNOhfdg6r f4+sOJ/s7BqBm6yqHH63fjA= X-Received: by 2002:a05:6a00:1701:b0:505:c49b:d2eb with SMTP id h1-20020a056a00170100b00505c49bd2ebmr3991648pfc.12.1649672540250; Mon, 11 Apr 2022 03:22:20 -0700 (PDT) Received: from makvihas.localhost.com ([2405:201:202b:15:4376:c658:ae1e:1781]) by smtp.gmail.com with ESMTPSA id z14-20020a17090a170e00b001cb7e69ee5csm4886318pjd.54.2022.04.11.03.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 03:22:19 -0700 (PDT) From: Vihas Makwana To: Larry Finger , Phillip Potter , Greg Kroah-Hartman , Michael Straube Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Dan Carpenter , Pavel Skripkin , Vihas Makwana Subject: [PATCH v2 7/7] staging: r8188eu: drop unnecessary wrapper _rtw_dequeue_cmd Date: Mon, 11 Apr 2022 15:51:36 +0530 Message-Id: <20220411102136.14937-8-makvihas@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220411102136.14937-1-makvihas@gmail.com> References: <20220411102136.14937-1-makvihas@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NO_RDNS_DOTCOM_HELO, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop unnecessary wrapper _rtw_dequeue_cmd and move its logic to rtw_dequeue_cmd. Signed-off-by: Vihas Makwana --- drivers/staging/r8188eu/core/rtw_cmd.c | 34 ++++++++++---------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c index 959b69be5..06523d919 100644 --- a/drivers/staging/r8188eu/core/rtw_cmd.c +++ b/drivers/staging/r8188eu/core/rtw_cmd.c @@ -56,24 +56,6 @@ static int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj) return _SUCCESS; } -static struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue) -{ - struct cmd_obj *obj; - unsigned long flags; - - spin_lock_irqsave(&queue->lock, flags); - if (list_empty(&queue->queue)) { - obj = NULL; - } else { - obj = container_of((&queue->queue)->next, struct cmd_obj, list); - list_del_init(&obj->list); - } - - spin_unlock_irqrestore(&queue->lock, flags); - - return obj; -} - u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) { u32 res = _SUCCESS; @@ -180,11 +162,21 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv) { - struct cmd_obj *cmd_obj; + struct cmd_obj *obj; + struct __queue *queue = &pcmdpriv->cmd_queue; + unsigned long flags; + + spin_lock_irqsave(&queue->lock, flags); + if (list_empty(&queue->queue)) { + obj = NULL; + } else { + obj = container_of((&queue->queue)->next, struct cmd_obj, list); + list_del_init(&obj->list); + } - cmd_obj = _rtw_dequeue_cmd(&pcmdpriv->cmd_queue); + spin_unlock_irqrestore(&queue->lock, flags); - return cmd_obj; + return obj; } void rtw_free_cmd_obj(struct cmd_obj *pcmd) -- 2.30.2