From patchwork Tue Apr 20 19:09:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 424589 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp647783jao; Tue, 20 Apr 2021 12:00:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdahQDTc9C9sgzdpZRYFNlrcI+Rh8sgzlBO4qw/RbHJ06FetPApCBEKRiys5p5rkU04hOh X-Received: by 2002:a17:906:6703:: with SMTP id a3mr28756490ejp.240.1618945250934; Tue, 20 Apr 2021 12:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618945250; cv=none; d=google.com; s=arc-20160816; b=qLN4Yullg2dFnTB+/jn/yPam7pX4fj7p2bzyJ5ZRQXO121Tjz83acXv11fWlbHBJt7 pOwQwEEbnlqjYJMb/LPGA4KJmSLWqPymq9QuzF1nEg+RFXoJk1oaN0GCokXN8Ov/r9TA JFbNQ6oYN1p3KOvPXlAzz65OGOGvkp40Trjb/3Y4KgsZl9zmetsq1sgKC25xIgNi0Cg1 tlC3clp2V5gOKGABsWQjmZEZRKu3J8caiJCgepQn57QvpkjZHXhrTs0GUpR/LYEoBsLx 7lF7rxJloMgaVIPC8dwhR3IZMEYW9IMt7cKHBQ0e8pplfk/1xuMdZwgIXU78ce5jcd3A WEBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=JAvXww5KpPllCzIfU9TOhaX3UQasePrevleotlPtQ6g=; b=ESK8lDxzGr7Jp7d8yBMH5ps5DfO5gVLi67hgrrWDL519mwf6k8xVTRtsVLkDi9Spvb 4PvPtNbHC78lP90vI+VYoZY/wXa0146U5905FEfBPJvYPJ2wkN3vv/qSXT+31BupKAFO +aKXv1U3w4Jvxc8JlzslU7JkBTVGvI3FgXWU81FSHCfvAA/fcdXZ2wmsfFBKCJ59cRJ2 Pfl5YBBRl5eOLlhdb1X3V0iVzhm/0F61/b3jlvjD9YjXza/4x7K0WTHl1zeF9+Py9UBn 9x0zK5P2ryDcxlFrVl0sTTpdIKcvBD19sK4kcEFMjWS72IkjN1Y5J5DJMbNqbStjVaqL 7tQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ruJhKboe; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 24si1555195edv.509.2021.04.20.12.00.50; Tue, 20 Apr 2021 12:00:50 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ruJhKboe; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233702AbhDTTBS (ORCPT + 8 others); Tue, 20 Apr 2021 15:01:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233624AbhDTTBR (ORCPT ); Tue, 20 Apr 2021 15:01:17 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4580DC06174A for ; Tue, 20 Apr 2021 12:00:45 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id n127so9035264wmb.5 for ; Tue, 20 Apr 2021 12:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=JAvXww5KpPllCzIfU9TOhaX3UQasePrevleotlPtQ6g=; b=ruJhKboeBg2f03bDwwN0vJBvcFBmmu2w59bdryD2vsmfptH6UCjuQmLpVGsiyrVeSh CFET9LChxniLW5JiQ9M1idMINVQniuWtyI3I4NEvA99Qq+lX+SX6wbq3kptj6DSPVb4k +w6ujtAEPZkakJAK69pmu7kILsjncgMF+mjCYCt1dhRFygPUTgHdPexCmA8XGbILD59A 1Lsl3rgNvA61f5r5UtrfZYMYtKHg9FPSh2Z2mxDEIDoL7T+NKu7o1Gv1cX4DguV7tTsz Tu2T1vFoVl9yMiORGQzi/7+i7U1CdXPtpSEn2zkryUbJO0mdhZO9KV10aGsuW8oPAGmb XBEw== 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=JAvXww5KpPllCzIfU9TOhaX3UQasePrevleotlPtQ6g=; b=clQORlM67epxs3IRGcQcFptRvd1ntSB6o/UwCvvTk/J+Tsy8bk+0DGHSk1JaS0t/Da hnX8iQDFAUHY8FaCtipwqB4pl351+SecO3vuRFFDPuPwDwZYuZUDIOEnEAW1rmU1B1BO kyCGiQ5AMHkeERC4v47si1EqgKmNIKUs5nmfsblybx5jzZAMuMKMTRS7ZjBLhjgB0lkw /WMyZ/gtKBsNv4UqMr4YIyLc3lQTr5knvCzvHXzfm9k+l9IOI7WSgiFJ4kviTFAn9qQk qtVi5u09ZN0MBZIRE9mhjwDTUoTxmmtUZz86UU7Vc1AfeEux6AYgk/reYCzatN2dtE+N E3zQ== X-Gm-Message-State: AOAM532oUVrG4qA/fl3oMnSAD0zydzlLb20lOfOx1gCUMsbfH/v+M1wB qS/8cVV/XUEjQM3pOGIQjJi86w== X-Received: by 2002:a1c:e006:: with SMTP id x6mr5962928wmg.40.1618945243918; Tue, 20 Apr 2021 12:00:43 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:c0c4:7b2:36d2:4bec]) by smtp.gmail.com with ESMTPSA id h5sm3942491wmq.23.2021.04.20.12.00.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Apr 2021 12:00:43 -0700 (PDT) From: Loic Poulain To: kuba@kernel.org, davem@davemloft.net Cc: netdev@vger.kernel.org, Loic Poulain Subject: [PATCH net-next] net: wwan: Fix bit ops double shift Date: Tue, 20 Apr 2021 21:09:57 +0200 Message-Id: <1618945797-11091-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org bit operation helpers such as test_bit, clear_bit, etc take bit position as parameter and not value. Current usage causes double shift => BIT(BIT(0)). Fix that in wwan_core and mhi_wwan_ctrl. Fixes: 9a44c1cc6388 ("net: Add a WWAN subsystem") Reported-by: Dan Carpenter Signed-off-by: Loic Poulain --- drivers/net/wwan/mhi_wwan_ctrl.c | 8 +++++--- drivers/net/wwan/wwan_core.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/net/wwan/mhi_wwan_ctrl.c b/drivers/net/wwan/mhi_wwan_ctrl.c index 1fc2376..1bc6b69 100644 --- a/drivers/net/wwan/mhi_wwan_ctrl.c +++ b/drivers/net/wwan/mhi_wwan_ctrl.c @@ -7,9 +7,11 @@ #include /* MHI wwan flags */ -#define MHI_WWAN_DL_CAP BIT(0) -#define MHI_WWAN_UL_CAP BIT(1) -#define MHI_WWAN_RX_REFILL BIT(2) +enum mhi_wwan_flags { + MHI_WWAN_DL_CAP, + MHI_WWAN_UL_CAP, + MHI_WWAN_RX_REFILL, +}; #define MHI_WWAN_MAX_MTU 0x8000 diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c index b618b79..5be5e1e 100644 --- a/drivers/net/wwan/wwan_core.c +++ b/drivers/net/wwan/wwan_core.c @@ -26,7 +26,7 @@ static int wwan_major; #define to_wwan_port(d) container_of(d, struct wwan_port, dev) /* WWAN port flags */ -#define WWAN_PORT_TX_OFF BIT(0) +#define WWAN_PORT_TX_OFF 0 /** * struct wwan_device - The structure that defines a WWAN device