Received: by 2002:a9a:4c47:0:b029:116:c383:538 with SMTP id u7csp7558016lko; Fri, 30 Jul 2021 06:25:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRKIFjrR+onJTw/pQkj45d3nSRHAP1VIZ8y6bIhE2ZbIVGGGw3KmgHiy7lJiVTUw8Rc5e1 X-Received: by 2002:a05:6402:caf:: with SMTP id cn15mr2942067edb.236.1627651514453; Fri, 30 Jul 2021 06:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627651514; cv=none; d=google.com; s=arc-20160816; b=CUMeKhpf0aUoKaxIFaaBeoUUcUWEzdcdfMzdIsNehNEZL9tinhtmwBuyTQP+y74izt vvHnL4iffAeLWNCsH/iwFtB5igG2ZYJdxjLqzzkvl5d9CHipOMHDOtVArQAXGfvTAL0K PBdoskdWqHzziBBvdfA08DT6Ql8Nz/reZW8qS1c0+cW6Nhulq66kKwFsATzcQR0Th7XK 7jZoYS4Rlq/E9Usg9LRxnzKWdA3suXd9R2h0Qgc+VDvgzPpqt3dkZsShgEdjrbPK/9oe lbz4I/W0+Fa3WMuzUqtdq0+FQjG52t1IBN8VAOe3iHLHnY38vEVN+iv+qiwILp8KLKrR 5sig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1MF64PGrmt62Tg3j2Q8W8RIILeBRNoYtBq41HoRE+f8=; b=pEcO4PkgA7mrQrtmpdUfjPzN0tvj/6aJQP0XMKy+38vGhvRqDIoaHCzaRINQgcyVH5 11ZKcXF+bM9FVkppCmwEu9GjgnTnxMZTZ4dyn8hHlIfl4cski5UKfzCbIuH9yS9+iVXP S1DYHUOVrxxw3F4udEvKtm3n3fcEu4g/Ll0Zxn5h1LHxFEH+BT2el9py8RUA5I1arUKG PV/NqUWZc/qHJaxVG9upCqKOB/FGu/p1fXQY/mnNnqdDHqyST4/fnP67aPABfqvad/Gw mh4OChe5T0xNrAxYxeT8f6ay6/3dnyH1nxbUrQ5OkANdAxhKwV5yx0Dnz3dGfMrmzJpP 1JaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Wk4r4UmW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id s15si1539018edq.69.2021.07.30.06.24.50; Fri, 30 Jul 2021 06:25:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@gmail.com header.s=20161025 header.b=Wk4r4UmW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238890AbhG3NVM (ORCPT + 99 others); Fri, 30 Jul 2021 09:21:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230480AbhG3NVL (ORCPT ); Fri, 30 Jul 2021 09:21:11 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76A6DC06175F for ; Fri, 30 Jul 2021 06:21:06 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id p21so13127578edi.9 for ; Fri, 30 Jul 2021 06:21:06 -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:mime-version :content-transfer-encoding; bh=1MF64PGrmt62Tg3j2Q8W8RIILeBRNoYtBq41HoRE+f8=; b=Wk4r4UmWMdTkahOuUTgKY3b/kkLo4kOnU9ruGThHRLnmCjrbxGhF5ByAcM9knzRGB/ ydVnqqok/wpUfdE8PN5Sfu57qiGKeRsx17qopPatENupqKtN0eh3J6qdyCCuEGvX3Iq1 N6FVjC0wQJYzfC9oHKSQf6pvatKt+mc9An6GlaEGuYm5BYs1OfoXsgp+VbTMzPRTAx8T fvp1tOlZbMmC0NNQAYDDNfQp5qHgwQD3ElL5nuOqmxRNBBW/ANjnFPLrpsW7Nh2RmD9U V1h8PGNaiabQvlDPZaBCTYC2hmF12jU0ZmJyLvO3nKuCcsh8ztKFdkvUEZIkv6VYCYyW YUaQ== 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:mime-version :content-transfer-encoding; bh=1MF64PGrmt62Tg3j2Q8W8RIILeBRNoYtBq41HoRE+f8=; b=m+O+km+g7eBUR6/n3ypuFr5VobKtqWJ5fff948Z4HEZ6zUn82Cw9kLpYcNpp0XJBaM wfvK1OALIA16CG//g3gsg4oDBotjk7oyJpEoBIp3LykWnqTqjJbhONyWll/b1UWt3noc OZ6N+pK9fACfxadJ0CQbUsIY/v6bmV1xiKApEc+PAMiid0i0ZZetrZXptvznyy/5cisW vQhsBN7Fmsrah/6v5lwi3V3rjDg29gk1oZJMzqoIPiI8ZCQTd1X9+i+LnLjsTyObLtbV 1rbdNZwulLWYky0Ovw9QFzdzHUUM9z4plYkCzmCmDXS9YEB7+qPVswU7/jZDw+sLlNz8 CXvA== X-Gm-Message-State: AOAM532TCKfSX2dOu8QNqG6vqJSYVwVWPjE3hx4v7IOxtxyrHpPJqUeS /CdwapIA7/PluiEPPa33fapHB/TNqcw= X-Received: by 2002:a05:6402:1c83:: with SMTP id cy3mr3000977edb.231.1627651265147; Fri, 30 Jul 2021 06:21:05 -0700 (PDT) Received: from agape ([5.171.81.215]) by smtp.gmail.com with ESMTPSA id lw22sm560218ejb.74.2021.07.30.06.21.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:21:04 -0700 (PDT) From: Fabio Aiuto To: gregkh@linuxfoundation.org Cc: hdegoede@redhat.com, Larry.Finger@lwfinger.net, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, David Sterba Subject: [PATCH] staging: rtl8723bs: remove unused BIT macros definitions Date: Fri, 30 Jul 2021 15:21:03 +0200 Message-Id: <20210730132103.4996-1-fabioaiuto83@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org BIT(x) macro used all over the driver is defined in include/vsdo/bit.h as - #define BIT(nr) (UL(1) << (nr)) which is safer than the local BIT macros declared. Local macros shift a signed integer which brings unespected results. For example: (unsigned long)(1 << 31) => 0xffffffff80000000 shift.c: int main() { printf("%lx\n", (unsigned long)(1 << 31)); printf("%lx\n", (unsigned long)(1U << 31)); return 0; } --- $ ./shift ffffffff80000000 80000000 --- So just remove redundant, less safe macro declarations. Suggested-by: David Sterba Signed-off-by: Fabio Aiuto --- drivers/staging/rtl8723bs/include/osdep_service.h | 4 ---- drivers/staging/rtl8723bs/include/wifi.h | 8 -------- 2 files changed, 12 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/osdep_service.h b/drivers/staging/rtl8723bs/include/osdep_service.h index b49838c7e457..bde415db4114 100644 --- a/drivers/staging/rtl8723bs/include/osdep_service.h +++ b/drivers/staging/rtl8723bs/include/osdep_service.h @@ -14,10 +14,6 @@ #include -#ifndef BIT - #define BIT(x) (1 << (x)) -#endif - #define BIT0 0x00000001 #define BIT1 0x00000002 #define BIT2 0x00000004 diff --git a/drivers/staging/rtl8723bs/include/wifi.h b/drivers/staging/rtl8723bs/include/wifi.h index 0bd7b662b972..f03e26818d45 100644 --- a/drivers/staging/rtl8723bs/include/wifi.h +++ b/drivers/staging/rtl8723bs/include/wifi.h @@ -7,14 +7,6 @@ #ifndef _WIFI_H_ #define _WIFI_H_ - -#ifdef BIT -/* error "BIT define occurred earlier elsewhere!\n" */ -#undef BIT -#endif -#define BIT(x) (1 << (x)) - - #define WLAN_ETHHDR_LEN 14 #define WLAN_ETHADDR_LEN 6 #define WLAN_IEEE_OUI_LEN 3 -- 2.20.1