From patchwork Tue Jan 19 15:42:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jo=C3=A3o_Paulo_Rechi_Vita?= X-Patchwork-Id: 8063411 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3FE709F859 for ; Tue, 19 Jan 2016 15:45:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51AED2039E for ; Tue, 19 Jan 2016 15:45:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E0CF203A0 for ; Tue, 19 Jan 2016 15:45:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756618AbcASPoT (ORCPT ); Tue, 19 Jan 2016 10:44:19 -0500 Received: from mail-qg0-f68.google.com ([209.85.192.68]:34162 "EHLO mail-qg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754881AbcASPoF (ORCPT ); Tue, 19 Jan 2016 10:44:05 -0500 Received: by mail-qg0-f68.google.com with SMTP id 94so65239741qgt.1; Tue, 19 Jan 2016 07:44:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=wZGzh8/V4kRlxbShu+U2aMhwVFLdnPc3i9eE5G8nHtM=; b=UExIobJb+f/e/h6EmbGZH2Fom/4ALM1PEbcXstwxQYqeFt4606kP75qSoKkksm1P73 8hS6wrJB9e5DhMpOHNs8QxVeY1OTslb1xdisLe1yGcciEC1w0mGwrMofRRElia5FULxR i7OONkF9rteta7IDgB8xE2iz/O0+KHvHAjeH3KuTdsALDgzUKOqMNrQCTThE35w043lA 51pqUFEh32dclsTtJHi1v4/JSc5NQ8mjV5Hp+Xykmdo4pysbsS0GBvZlOxUHZ/3tfced EbCO70qNhterSXPU7y5lbTwGI+dlYmlQxfLMu8YUFrAviTl+POBqPyviSKS5/ZnmoMOI HMng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=wZGzh8/V4kRlxbShu+U2aMhwVFLdnPc3i9eE5G8nHtM=; b=KXXVAGystr1qJ1wH/lfM+JSKz7RkPY06zVnymY0HDzb7nN3qNeuxEM7dW0klyufUmS HYFjY2DAmNxfdeq4dHoPM0fxto386Sc36tcPbQV7HZVafv4+ZFOGckmM9oYc4BlCzI0C 60TPWXrG8xuXQ2iaTetX0ln6B5AriD4ylEdw/t/mUEVtUdh1uPE0NbTATppBue1EyLw7 EveOrogFG8vAgjqP1HNIzaJrs2HiUH9Q4zx4iQ2GrDraGvvmgGPTW+3t3yOQd/H9UFJE 1s19O7ySCQUwPy14Hbrm+S6ALmKbloKxZwO5/76QmfNaIOOVB7IhPMrrhQxVk8L6BSVZ m3Ow== X-Gm-Message-State: ALoCoQk98JivZXwbetE9gFYjsGpAfkFQV4GP505Zpj5u1TQGwFExSyEzWRpftqDsitchyCVAk1gJpattwenHfznFHkJrGXKo9w== X-Received: by 10.140.81.80 with SMTP id e74mr38535492qgd.27.1453218244954; Tue, 19 Jan 2016 07:44:04 -0800 (PST) Received: from localhost.localdomain (c-98-239-150-235.hsd1.wv.comcast.net. [98.239.150.235]) by smtp.gmail.com with ESMTPSA id z10sm12336759qhz.5.2016.01.19.07.44.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jan 2016 07:44:04 -0800 (PST) From: "=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?=" X-Google-Original-From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= To: johannes@sipsolutions.net Cc: marcel@holtmann.org, linux-wireless@vger.kernel.org, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jprvita@endlessm.com, linux@endlessm.com Subject: [PATCH 2/8] rfkill: Improve code readability Date: Tue, 19 Jan 2016 10:42:37 -0500 Message-Id: <1453218163-31998-3-git-send-email-jprvita@endlessm.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453218163-31998-1-git-send-email-jprvita@endlessm.com> References: <1453218163-31998-1-git-send-email-jprvita@endlessm.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP RFKILL_BLOCK_SW value have just been saved to prev, no need to check it again in the if expression. This makes code a little bit easier to read. Signed-off-by: João Paulo Rechi Vita --- net/rfkill/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 4d6d726..838e869 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -285,7 +285,7 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked) spin_lock_irqsave(&rfkill->lock, flags); prev = rfkill->state & RFKILL_BLOCK_SW; - if (rfkill->state & RFKILL_BLOCK_SW) + if (prev) rfkill->state |= RFKILL_BLOCK_SW_PREV; else rfkill->state &= ~RFKILL_BLOCK_SW_PREV;