Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp610802yba; Wed, 3 Apr 2019 15:41:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuc2E8wiTKkl2JyX0K7t7JaspySX5ac352P56K+Xj3s09wK0gt1gFgGNsriPZRavi1ptvt X-Received: by 2002:a17:902:e508:: with SMTP id ck8mr2634089plb.96.1554331287898; Wed, 03 Apr 2019 15:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554331287; cv=none; d=google.com; s=arc-20160816; b=AVxd3MwpyCXfQWhOJ6WIb1cUvuuVC5/H0i5TSi09kT2Vc4E48KFnEA+ynoGv0eExT5 nK+DO8+TaOly9cDC2NOdxNelIEjbaZh6U+UgU6U4Iqp13A29ITo4xdqbQHTTAg8hSahQ sUL0LzsrG/TgiG2WXF9Wfy/rct7IEzeVASJT1g5ZK7iB1vfKLWAnDlsEj0moIz9feM2I V5Mf8ONgXuRA0dyxmHr1qvf2Z76K8KzD4h7A0p24vZdUWLCltkCPhX6PcQAGzweL6B9e 49uJe+BUaobvgjuC5gsEE5ryB8jsqoZsAVEjZMWYj1YgX1B6ghkpZ/gXSTHN9Mr1IQkr bj+A== 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; bh=0YxX/DUB5kIbMUGhk9cYcrzc+Fvg0YYmoL5PkOL4j2Q=; b=KEIg7YLkYLVWeOuZWTeh82eTz0iVknFp6Ykb0o/Kjyf38FExWSvJqXoZE7S7Lnl7rv OjGEvouj1RLcOV55QmFMRZ1xGvnUFs5dFjQwycRH45N029Zow4KBDWJMiRgwjiGEFEHP mxBMC1NMQU/zNxUgX97vFwE5fUbDcoHLoy2heTeHHITUHvfKgByw4nLjFxPBmsZ8M9oF yn0J8tXPq1/Rb2cBTqP7IT9hopSYblhHn669chsA0YYTQDdBUOtGwAI25GZgJfrGwdGh udM3mczwK7uNa5HS0/BjOmeRakHHurg+nQOycAnwcqY1VqcXn6JtWx62KAdsR7Xtv5C+ 7tLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dkgZrTL3; 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 z6si14431986plo.372.2019.04.03.15.41.12; Wed, 03 Apr 2019 15:41:27 -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=dkgZrTL3; 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 S1726427AbfDCWi4 (ORCPT + 99 others); Wed, 3 Apr 2019 18:38:56 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:42902 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbfDCWi4 (ORCPT ); Wed, 3 Apr 2019 18:38:56 -0400 Received: by mail-ot1-f67.google.com with SMTP id 103so510251otd.9 for ; Wed, 03 Apr 2019 15:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=0YxX/DUB5kIbMUGhk9cYcrzc+Fvg0YYmoL5PkOL4j2Q=; b=dkgZrTL3wA4iHdfktXMmSml01jZGmg9FcVBo2hKFtmimju1vZGc59fjqot+URhG6m+ 4bI9Bs/Q3ij/Gd/bhFu63Hk7H31bsGCCX9lZd96XpJLNxub+SppHU4Y8IQh4y5DrYt48 PgOFsszjaN7XhMwkMICPWnh9AD97mdLOoGA6XtUy2AN431ipR6jpvoflkGJrOpvCLr2G YKp+oCe5rBwsUkUDY3cLgAQyateGsCi+3OtHsp1cW6Cri9BmUxVIF++y/ZWccaXDN696 6NuE7pi8E+F4vz/epjxDKn0zE/eZoRFLhkj+JB4fWy7xTqhx7/SfLOrN9QBqq173ULvp 762g== 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=0YxX/DUB5kIbMUGhk9cYcrzc+Fvg0YYmoL5PkOL4j2Q=; b=nEWWDgSgTv2GXkvNWUIO1uR4z9ondXj61E7S+hnmH6lrjZWRJ+SJHIK6GKxVgnJTrq 75E9XMoO0lyVRIxS8rBhSLw8mIS/DyhfY8j+ZTHwB8cZkibSZRd+/5oh2+vQnHe1hd04 DPI+bmlpj443EhY/3VwS7OTACDkMmC1OLIIXBonh+BxngjYhenKLjXJN8DCFp0X4z+cy UpQdXrl2ZqIFD90MPdBfbJs36/1YMrIobY1uOBOAe71drf3iOGU1TzpojxICtZ9Dqbsm bZ4+vnrWomV/B344frR5kB180NsipdC6hHbko9cGphXeSEfHf1bl4NkwQq1Lk0a9C3jz 75Tw== X-Gm-Message-State: APjAAAWsQZ8v7otojg0oh7EM0sTOxrP/s+uFX4CUqOdGzt6Kc4bKr/Km dN12aJDOHlmdP4accDfypZs= X-Received: by 2002:a9d:68c7:: with SMTP id i7mr1544393oto.275.1554331135583; Wed, 03 Apr 2019 15:38:55 -0700 (PDT) Received: from madhuleo ([2605:6000:1023:606d:1876:bc0b:8981:17be]) by smtp.gmail.com with ESMTPSA id c145sm7289396oig.0.2019.04.03.15.38.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Apr 2019 15:38:54 -0700 (PDT) From: Madhumitha Prabakaran To: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Madhumitha Prabakaran Subject: [PATCH v2] Staging: rtlwifi: Remove unwanted parentheses Date: Wed, 3 Apr 2019 17:38:51 -0500 Message-Id: <20190403223851.22524-1-madhumithabiw@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove unwanted parentheses and use !! idiom in place of ternary operator to make code simple and more understandable. Signed-off-by: Madhumitha Prabakaran --- Changes in v2: - Changed commit log - Replaced ternary operator with !! idiom - Modified a BIT operator --- drivers/staging/rtlwifi/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtlwifi/core.c b/drivers/staging/rtlwifi/core.c index a9902818ae7e..c70f062cf4b9 100644 --- a/drivers/staging/rtlwifi/core.c +++ b/drivers/staging/rtlwifi/core.c @@ -341,8 +341,8 @@ static u16 crc16_ccitt(u8 data, u16 crc) u16 result; for (i = 0; i < 8; i++) { - crc_bit15 = ((crc & BIT(15)) ? 1 : 0); - data_bit = (data & (BIT(0) << i) ? 1 : 0); + crc_bit15 = !!(crc & BIT(15)); + data_bit = !!(data & BIT(i)); shift_in = crc_bit15 ^ data_bit; result = crc << 1; @@ -351,13 +351,13 @@ static u16 crc16_ccitt(u8 data, u16 crc) else result |= BIT(0); - crc_bit11 = ((crc & BIT(11)) ? 1 : 0) ^ shift_in; + crc_bit11 = !!(crc & BIT(11)) ^ shift_in; if (crc_bit11 == 0) result &= (~BIT(12)); else result |= BIT(12); - crc_bit4 = ((crc & BIT(4)) ? 1 : 0) ^ shift_in; + crc_bit4 = !!(crc & BIT(4)) ^ shift_in; if (crc_bit4 == 0) result &= (~BIT(5)); else -- 2.17.1