linux-4.4-rc8/arch/mips/include/asm/netlogic/xlr/fmn.h:304: bad test ?

From: David Binderman <hidden>
Date: 2016-01-10 21:53:58

Hello there,

[linux-4.4-rc8/arch/mips/include/asm/netlogic/xlr/fmn.h:304]: (style) Expression '(X & 0x2) == 0x1' is always false.

Source code is

    if ((status & 0x2) == 1)
            pr_info("Send pending fail!\n");

Maybe better code

    if ((status & 0x2) != 0)
            pr_info("Send pending fail!\n");

Regards

David Binderman

 		 	   		  
From julian.calaby@gmail.com Sun Jan 10 23:14:04 2016
Received: with ECARTIS (v1.0.0; list linux-mips); Sun, 10 Jan 2016 23:14:06 +0100 (CET)
Received: from mail-io0-f193.google.com ([209.85.223.193]:36378 "EHLO
        mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK)
        by eddie.linux-mips.org with ESMTP id S27006823AbcAJWOE2pseG (ORCPT
        <rfc822;linux-mips@linux-mips.org>); Sun, 10 Jan 2016 23:14:04 +0100
Received: by mail-io0-f193.google.com with SMTP id q21so24678174iod.3
        for [off-list ref]; Sun, 10 Jan 2016 14:14:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :cc:content-type;
        bh=OH8bez7XmCnem729IgSvT5jpoWsMQTomdnpVes7+j2E=;
        b=x6gIXXE0Hh2kMuui2Sd/Jd5KZCRQCQhmNPZfkD+CtB23yOcNbIBQm5Gp9RQuSjYVJk
         yw4y/6PjYVgntsuPKXKdiU1sOyQ4O9Xc1axGg5ajcSAuzVXWkn4x6yDZRQLvRzUfnCeh
         xxD3sgl2RaAruY1945Taw+/Bvfkm5802aVfiYWu2cfSU/KvGQ+MHpfJDAcOYky9Q82Tf
         UzuU2HjgrYAEHaI+yvjnLPDz8TIJu0OVlyfC5piuY5hmLpJZZuIlZIfn44VMDOM1MqD9
         nGbPz+IpDyidTnf0dv4F5UAWlbiZvS/1SeTwqi0Cj3OyzOag3FTJdmBKtsuWthpfcIu7
         A25w==
X-Received: by 10.107.159.7 with SMTP id i7mr86780578ioe.29.1452464038417;
 Sun, 10 Jan 2016 14:13:58 -0800 (PST)
MIME-Version: 1.0
Received: by 10.79.111.1 with HTTP; Sun, 10 Jan 2016 14:13:39 -0800 (PST)
In-Reply-To: [ref]
References: [ref] [ref]
From:   Julian Calaby <redacted>
Date:   Mon, 11 Jan 2016 09:13:39 +1100
Message-ID: [ref]
Subject: Re: [PATCH v3 3/3] checkpatch: add virt barriers
To:     "Michael S. Tsirkin" <mst@redhat.com>
Cc:     "linux-kernel@vger.kernel.org" <redacted>,
        Andy Whitcroft [off-list ref],
        Joe Perches [off-list ref],
        Peter Zijlstra [off-list ref],
        Arnd Bergmann [off-list ref], linux-arch@vger.kernel.org,
        Andrew Cooper [off-list ref],
        virtualization@lists.linux-foundation.org,
        Stefano Stabellini [off-list ref],
        Thomas Gleixner [off-list ref],
        Ingo Molnar [off-list ref], "H. Peter Anvin" [off-list ref],
        David Miller [off-list ref], linux-ia64@vger.kernel.org,
        linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
        sparclinux [off-list ref],
        "Mailing List, Arm" [off-list ref],
        linux-metag@vger.kernel.org, linux-mips@linux-mips.org,
        x86@kernel.org, user-mode-linux-devel@lists.sourceforge.net,
        adi-buildroot-devel@lists.sourceforge.net,
        linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org,
        xen-devel@lists.xenproject.org, Ingo Molnar [off-list ref],
        Tony Lindgren [off-list ref],
        Andrey Konovalov [off-list ref],
        Russell King - ARM Linux [off-list ref]
Content-Type: text/plain; charset=UTF-8
Return-Path: [off-list ref]
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 51049
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: julian.calaby@gmail.com
Precedence: bulk
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
List-software: Ecartis version 1.0.0
List-Id: linux-mips <linux-mips.eddie.linux-mips.org>
X-List-ID: linux-mips <linux-mips.eddie.linux-mips.org>
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
X-list: linux-mips

Hi Michael,

On Mon, Jan 11, 2016 at 6:31 AM, Michael S. Tsirkin [off-list ref] wrote:
quoted hunk
Add virt_ barriers to list of barriers to check for
presence of a comment.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 15cfca4..4466579 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5133,7 +5133,8 @@ sub process {
                }x;
                my $all_barriers = qr{
                        $barriers|
-                       smp_(?:$smp_barrier_stems)
+                       smp_(?:$smp_barrier_stems)|
+                       virt_(?:$smp_barrier_stems)
Sorry I'm late to the party here, but would it make sense to write this as:

(?:smp|virt)_(?:$smp_barrier_stems)

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help