From patchwork Mon Sep 12 18:57:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9327619 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7F11F6077F for ; Mon, 12 Sep 2016 19:01:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 699A228E8F for ; Mon, 12 Sep 2016 19:01:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D2CA28E91; Mon, 12 Sep 2016 19:01:14 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable 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 AC07328E8F for ; Mon, 12 Sep 2016 19:01:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756913AbcILTBM (ORCPT ); Mon, 12 Sep 2016 15:01:12 -0400 Received: from condef009-v.nifty.com ([210.131.4.246]:51510 "EHLO condef009-v.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755817AbcILTBL (ORCPT ); Mon, 12 Sep 2016 15:01:11 -0400 Received: from conuserg-12.nifty.com ([10.26.8.75])by condef009-v.nifty.com with ESMTP id u8CIwtOc030531; Tue, 13 Sep 2016 03:59:02 +0900 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-12.nifty.com with ESMTP id u8CIvrVv005573; Tue, 13 Sep 2016 03:57:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com u8CIvrVv005573 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1473706678; bh=avxwIgswL0UfzoS/NEdfuJ5jH+kn8DAwZ9V5wn8wGHw=; h=From:To:Cc:Subject:Date:From; b=vpDAldb6NKywVtzT76CbMheFSVoMMABNGv7ipgBaZtxWNs1hGN7V8OghBRXsg1ena RQbczpKqUslTJvokz2gTnwD6on0QJtkfFPvV94fgvmvizOzOWJ+Ub7PlpDtCUBbwRr pX///aemRPdbowrbREiIvnAoaZCG5e9X66Dvwud1Gseq+8ljZx96EiVK0aHz2TBdH5 4UwJy9O2+ZQjiIkiRqnBM0w9SGLwOv/W43oseEtfDY6lCPWeMt/Rld3SqyvCuaBedF tYbKJe5vVLye9nM6MhB+CzKdn6diSLgsDziOWNo1uSr8iBfS93d2LGlG/AK5UMDidR zdN2s9//TEZDg== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: Greg KH , devel@driverdev.osuosl.org Cc: Masahiro Yamada , linux-fbdev@vger.kernel.org, Andreas Dilger , Sumit Semwal , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Larry Finger , Teddy Wang , Sudip Mukherjee , Laura Abbott , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Jes Sorensen , Riley Andrews , Oleg Drokin , lustre-devel@lists.lustre.org Subject: [PATCH] staging: squash lines for simple wrapper functions Date: Tue, 13 Sep 2016 03:57:48 +0900 Message-Id: <1473706668-24216-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove unneeded variables and assignments. While we are here, clean up the following as well: - refactor rtl8723a_get_bcn_valid() a bit - remove unneeded casts in sii164Get{Vendor,Device}ID() Signed-off-by: Masahiro Yamada --- drivers/staging/android/ion/ion.c | 6 +----- .../staging/lustre/lustre/obdclass/linux/linux-module.c | 5 +---- drivers/staging/lustre/lustre/ptlrpc/client.c | 5 +---- drivers/staging/lustre/lustre/ptlrpc/events.c | 5 +---- drivers/staging/rtl8723au/core/rtw_wlan_util.c | 7 +------ drivers/staging/rtl8723au/hal/hal_com.c | 6 +----- drivers/staging/sm750fb/ddk750_sii164.c | 16 ++++------------ 7 files changed, 10 insertions(+), 40 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index a2cf93b..a07fc03 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -389,11 +389,7 @@ static void ion_handle_get(struct ion_handle *handle) static int ion_handle_put_nolock(struct ion_handle *handle) { - int ret; - - ret = kref_put(&handle->ref, ion_handle_destroy); - - return ret; + return kref_put(&handle->ref, ion_handle_destroy); } static int ion_handle_put(struct ion_handle *handle) diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 33342bf..3f2dd95 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -152,10 +152,7 @@ EXPORT_SYMBOL(obd_ioctl_getdata); int obd_ioctl_popdata(void __user *arg, void *data, int len) { - int err; - - err = copy_to_user(arg, data, len) ? -EFAULT : 0; - return err; + return copy_to_user(arg, data, len) ? -EFAULT : 0; } EXPORT_SYMBOL(obd_ioctl_popdata); diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index d4463d7..38cbf4a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -417,10 +417,7 @@ void ptlrpc_request_cache_fini(void) struct ptlrpc_request *ptlrpc_request_cache_alloc(gfp_t flags) { - struct ptlrpc_request *req; - - req = kmem_cache_zalloc(request_cache, flags); - return req; + return kmem_cache_zalloc(request_cache, flags); } void ptlrpc_request_cache_free(struct ptlrpc_request *req) diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c b/drivers/staging/lustre/lustre/ptlrpc/events.c index b1ce725..8821f4d 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/events.c +++ b/drivers/staging/lustre/lustre/ptlrpc/events.c @@ -525,10 +525,7 @@ static void ptlrpc_ni_fini(void) static lnet_pid_t ptl_get_pid(void) { - lnet_pid_t pid; - - pid = LNET_PID_LUSTRE; - return pid; + return LNET_PID_LUSTRE; } static int ptlrpc_ni_init(void) diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c index 694cf17..7ab47f0 100644 --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c @@ -1202,12 +1202,7 @@ unsigned int update_supported_rate23a(unsigned char *ptn, unsigned int ptn_sz) unsigned int update_MSC_rate23a(struct ieee80211_ht_cap *pHT_caps) { - unsigned int mask; - - mask = pHT_caps->mcs.rx_mask[0] << 12 | - pHT_caps->mcs.rx_mask[1] << 20; - - return mask; + return pHT_caps->mcs.rx_mask[0] << 12 | pHT_caps->mcs.rx_mask[1] << 20; } int support_short_GI23a(struct rtw_adapter *padapter, diff --git a/drivers/staging/rtl8723au/hal/hal_com.c b/drivers/staging/rtl8723au/hal/hal_com.c index 9d7b11b..dfbeebe 100644 --- a/drivers/staging/rtl8723au/hal/hal_com.c +++ b/drivers/staging/rtl8723au/hal/hal_com.c @@ -708,11 +708,7 @@ void rtl8723a_bcn_valid(struct rtw_adapter *padapter) bool rtl8723a_get_bcn_valid(struct rtw_adapter *padapter) { - bool retval; - - retval = (rtl8723au_read8(padapter, REG_TDECTRL + 2) & BIT(0)) ? true : false; - - return retval; + return !!(rtl8723au_read8(padapter, REG_TDECTRL + 2) & BIT(0)); } void rtl8723a_set_beacon_interval(struct rtw_adapter *padapter, u16 interval) diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 67f36e7..28818e1 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -36,12 +36,8 @@ static char *gDviCtrlChipName = "Silicon Image SiI 164"; */ unsigned short sii164GetVendorID(void) { - unsigned short vendorID; - - vendorID = ((unsigned short) i2cReadReg(SII164_I2C_ADDRESS, SII164_VENDOR_ID_HIGH) << 8) | - (unsigned short) i2cReadReg(SII164_I2C_ADDRESS, SII164_VENDOR_ID_LOW); - - return vendorID; + return (i2cReadReg(SII164_I2C_ADDRESS, SII164_VENDOR_ID_HIGH) << 8) | + i2cReadReg(SII164_I2C_ADDRESS, SII164_VENDOR_ID_LOW); } /* @@ -53,12 +49,8 @@ unsigned short sii164GetVendorID(void) */ unsigned short sii164GetDeviceID(void) { - unsigned short deviceID; - - deviceID = ((unsigned short) i2cReadReg(SII164_I2C_ADDRESS, SII164_DEVICE_ID_HIGH) << 8) | - (unsigned short) i2cReadReg(SII164_I2C_ADDRESS, SII164_DEVICE_ID_LOW); - - return deviceID; + return (i2cReadReg(SII164_I2C_ADDRESS, SII164_DEVICE_ID_HIGH) << 8) | + i2cReadReg(SII164_I2C_ADDRESS, SII164_DEVICE_ID_LOW); }