Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1034933ybb; Wed, 25 Mar 2020 14:24:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsttj23ndA0tMdGjmKbzBEZAuXRLyHOSR9/oIxx9dur3eQqzGLysuTqD+U56BFhkmv6/L0S X-Received: by 2002:a05:6808:6c9:: with SMTP id m9mr3999594oih.157.1585171485772; Wed, 25 Mar 2020 14:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585171485; cv=none; d=google.com; s=arc-20160816; b=sQfuUHmnEX8lQFqu4b+1dnS0wiKBY51McoZaShfVanavt7Fxa+FGFO98LFisLlZI0w qJBujvadEtCJN/mru3s109+PLdcXdCAtJ3IysJP3iPOhUVePfVOoDF6FJlMxpKa999a1 tYnkTUA1bOxbWtXv53zcpGvEVs3lzLlh4M5yW0jzDEuHWzb7QkQ8F3zR4CN6hXau3WsD eA59qQ4qUWnvmzV+88wGtNm5yMVO1tmmGaVJXTW+PYEPNekqP1Is7aqFvES9PLjYD/5h rOh+EtxqPESvBCFHgiWQNxiUYKrwCqX+Mrj6cHhH5bPARhnZYviuGX9lpe+M5e1AAXYi VdfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=D50Ea1KkZKi7MRIpZ2tdbEpQFy9vwTNoscFn6swOS/0=; b=y6sKtaPLf6ru/xEAUyBd4kvOPECQ35kXYkPw8w2NbnEfO6Tx86TNTdEH+wjz8PJ/l4 efV9DTw81dqSW2o+OSJxQRR3WPY1m2g2v33kuQ0Uhc9Difn91Sll6LPQmZqAVrQWsDY9 zbyIMX9vn2jFNWIGJqlQxfdq2fxB7rDLH9JX4kl0HNRLAz+UZkNj1pgBkv1wbWXNMSva zBo0LBYkJSxnCkKd9Q/A1+l04CP12VHB/Az7G9a5HGJy0RxxdbJCIGKHFTdakgZbXnLp C5oMFJzqwB2g3Skw8dYzAiztASATCKMbGcmVAJFZC4Oe0e0MOeoXIwAel+KKGjIBB8/w 8Ukg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EMvoS3tq; 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=QUARANTINE 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 w7si141584otj.223.2020.03.25.14.24.32; Wed, 25 Mar 2020 14:24:45 -0700 (PDT) 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=EMvoS3tq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727395AbgCYVXC (ORCPT + 99 others); Wed, 25 Mar 2020 17:23:02 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38519 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727357AbgCYVXC (ORCPT ); Wed, 25 Mar 2020 17:23:02 -0400 Received: by mail-pl1-f195.google.com with SMTP id w3so1310542plz.5 for ; Wed, 25 Mar 2020 14:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=D50Ea1KkZKi7MRIpZ2tdbEpQFy9vwTNoscFn6swOS/0=; b=EMvoS3tq9nhI2rqp5Wg+ogOhZR97+iLl7eEsa2La3ApbUDZFA/dOSiObyzdlJ2ZPXK 2OPPTjtyXsxvP4+WJXOzeABy4EuHuPtg7ffJfknHfk7CJ4s2GPVTYIiv/7FgypPBNg9L farz9a7IOdydKsycs7pw2emyg7iZ9+bz0rx+JjHp96HcmnElRd/TDAI2CzobHLjl+MeH BsI92ipo15AxcEp2HM/PsMDE8wRpApQfW5lYPVVqTrhHPOMJbMIoPM7muPZxdvrUDnMK c3AX+vGHZe6RcPSJ0IKwA5+oC4JPjL4939SEIbjKj2IDX8h+SDZsfdbw26BRKkmAQu1u jYOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=D50Ea1KkZKi7MRIpZ2tdbEpQFy9vwTNoscFn6swOS/0=; b=GXySKFspXslhWvW9UFAWxhwRJKzhI9/ciEsXn47ORszNpakIObibtkePMfZyzw6IHa vbtL3FlMpEM4cb/lhvke0eDPN+/ZFem84b8q0rOsBBj8fCPYQOO672JaYDO8APY+mORl dECsgjbNz4H2VuDJEXf/NffGiKWAhgKjuVF6WYjNDTAczto4lySTf2sRQxtFqc6sAfqQ Y4dXFLKRRHgwVwp1sdaqDS4C/HssL8sFwaYxwWOdQwxpG+DpOLC85k8Qb26vpa/S8gEr RrAfzYBECqXw7vUS3aTT0ZvRyYQsoayFNYTjX9sEz/8+z6UQM6eAAy7tKrSGpp3icwY0 lNZA== X-Gm-Message-State: ANhLgQ3mNZIjk3lGsn0pkqUJwtr7kbNWKwGwFxRlXgjHrHdnODhfBi2D SDN8cdESe8z6pRSX0ShYVhzXskphw48= X-Received: by 2002:a17:902:7008:: with SMTP id y8mr5096140plk.279.1585171379953; Wed, 25 Mar 2020 14:22:59 -0700 (PDT) Received: from simran-Inspiron-5558 ([2409:4052:78f:bb47:8124:5e4b:ea06:7595]) by smtp.gmail.com with ESMTPSA id s14sm77650pgl.4.2020.03.25.14.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 14:22:58 -0700 (PDT) Date: Thu, 26 Mar 2020 02:52:53 +0530 From: Simran Singhal To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com Subject: [PATCH] staging: rtl8723bs: rtw_cmd: Compress lines for immediate return Message-ID: <20200325212253.GA8175@simran-Inspiron-5558> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Compress two lines into a single line if immediate return statement is found. It also removes variable cmd_obj as it is no longer needed. It is done using script Coccinelle. And coccinelle uses following semantic patch for this compression function: @@ expression ret; identifier f; @@ -ret = +return f(...); -return ret; Signed-off-by: Simran Singhal --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 744b40dd4cf0..42b0ea8abd9c 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -362,11 +362,7 @@ int 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; - - cmd_obj = _rtw_dequeue_cmd(&pcmdpriv->cmd_queue); - - return cmd_obj; + return _rtw_dequeue_cmd(&pcmdpriv->cmd_queue); } void rtw_free_cmd_obj(struct cmd_obj *pcmd) -- 2.17.1