From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 54B8542DEC; Thu, 6 Jul 2023 20:02:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 46A1342FE4; Thu, 6 Jul 2023 20:02:49 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 12F2342FD0 for ; Thu, 6 Jul 2023 20:02:48 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1b8a8154f9cso7066695ad.1 for ; Thu, 06 Jul 2023 11:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688666567; x=1691258567; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ld3dXN135WpPlXnndiB3SUrSP+NvPhZSTdU8obNiOHo=; b=kp7Z0WzKo/t0s4MxmvQCYCK1PA+Gc9H5ltuZcDPavViuz9IFs0yMM5lIWc7u9g1z/x B4gGrxNZOByaPotaYwvyt+GA+VqwhcQXy9GTx4yUmzOP3hBmmAGS6SZnQ1OpnwxgnP1R sNB/8Jk18NuSzX55LsS9Zm49bc1ryPl4hB5zgcVIwa76dVkfYBWRRpGhbydd9fRyuh9h p7Wv31Oj5dGj7KoIeFNxwHy6JoJFD4eAq7MokBzGlReanAtIui66LcH71Yd/sQOgkDX5 mhdfWJSbcC8y+YIDi1vTNfPm0pmAOC9dxJJVNUuBbJhyMzVglgwr6wfi1d/kE/hAtOLF B5oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688666567; x=1691258567; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ld3dXN135WpPlXnndiB3SUrSP+NvPhZSTdU8obNiOHo=; b=GVHTL8EnMrYXaqnizz+jDtWKqfRbzSClJB6dYxiue+TXo/BxN9GaUC4r4nozQv4VOO wU4EYXnFRlnnnD0WFmah2tjkI4ZMtjt78vN5IBy7dmDdnUQ5tWnshsdAOByWOOpgM4sw PN6ktkAKkJVHCZXJFD38FHfZjOkGcJA9kaK5kj7hXiTDxqTeekMepFMbSurO6xTOcgqX g20007of3Dr+H3mq0L8msvnRGPDSfzrW9DWT9ySZQt731Q64dUY/y212Lsp7I6nSCsxo 12hlubEgGqASqBsh79qseNpV9wfQQdPY3RWbH1ZqnW5KBXnzjrdZBl+iNvJiTMzh8CXE /m1A== X-Gm-Message-State: ABy/qLbDExplNbzZ6HFLnyxSOYYSb6pgh3yIATzsxT1MRHfQNPNc16bx Rfqf40O2CThDZcdjV0cI33SS0w== X-Google-Smtp-Source: APBJJlG2vYn71yQvCRsLsYtYBWNW3CsFcTEfUR1tq9YIDU6SP/k8ltEr2vQVNsgY5o/yCCBzfHoaKw== X-Received: by 2002:a17:902:d512:b0:1b8:1d4b:f5f9 with SMTP id b18-20020a170902d51200b001b81d4bf5f9mr9635015plg.18.1688666567220; Thu, 06 Jul 2023 11:02:47 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a18-20020a170902ecd200b001b89891bfc4sm1709345plh.199.2023.07.06.11.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 11:02:46 -0700 (PDT) Date: Thu, 6 Jul 2023 11:02:45 -0700 From: Stephen Hemminger To: Weiguo Li Cc: dev@dpdk.org, ferruh.yigit@intel.com Subject: Re: [PATCH] devtools/cocci: change boolean negation to bitwise negation Message-ID: <20230706110245.330260fb@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 4 Mar 2022 23:31:53 +0800 Weiguo Li wrote: > Combining boolean operator with bitwise operator is suspicious. When > this happens, it has a chance that the bitwise negation operation is > mistakenly written as a boolean negation operation. This script is > used to find this kind of problems. > > example: > if (x & !BITS_MASK) > changed to: > if (x & ~BITS_MASK) > > The idea came from a demo script in coccinelle website: > https://coccinelle.gitlabpages.inria.fr/website/rules/notand.html > > Signed-off-by: Weiguo Li This never got merged probably because it address something that is not happening in DPDK. Ran the script and it found nothing. Also, script adds empty blank line at EOF which cause a warning when merging in git. Dropping this patch as not needed.