Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3140504rwl; Sun, 9 Apr 2023 08:48:05 -0700 (PDT) X-Google-Smtp-Source: AKy350bbBBCwNdJix8AhZA/arwe3LRh/ZSDl62y9Y8NDej1454B2czdGgIsrAY7ZCx3QpedUtBUQ X-Received: by 2002:a17:907:3201:b0:947:c7f4:2342 with SMTP id xg1-20020a170907320100b00947c7f42342mr5016864ejb.4.1681055285397; Sun, 09 Apr 2023 08:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681055285; cv=none; d=google.com; s=arc-20160816; b=QURHdp76aO5UXXUnn0U9TV0irQnnO0uUUzT0mvGZtj6IXt3C4bu7GpTvE48PbHJulz 2a6AVbu2qRkwMCI9nzB5BnF/ikBHb8BVVs7Xlr1+r8Mo29/CUcCsb2y0WmLkLfvbrJSZ S+yizExLJXe/+TqruAPcZUUBwhrNpPFay/dv6ciY1H21hI9SWIj7HQ6jKikqvysqkQQu VEaSvOAuKQLNHtHNiDSNkL50mrWSo5XR52WYlLIqDkXMZ2PyxZ4HrY0wljHKs0GlC9c1 tCfABDoQYCEEBdyG3BdKgki8U6QKFKmFZgz25uL1mBsNrQYwEs6S4Ou0ROXvuRi3eP9S Ta5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=+F3m/Z1uNGrSrVyh1TkFgL4DP+S57DCP37l7qhIJQgc=; b=uILAfI4mpvoncTkPNRs9ADC5zLUAOGilPa0o74wPEk5/LMMRkcD3gjDJG1WKBv1y2D aLKwLNRk1NM6NKxSTksxTqsluw2U3xa0JMx/C4KQFvFr9jIaqr4EzpKDXH0Div6K1VTt oDpUvqRmOUwNpdGlrzsLYKE39cnbVBSak/937D7funbrNNsIt/9uHWOJx2hRWa+NjuNA QZFxXOi3beZXak2Dm88p2dFBIayLs7VmKkgSpr2BLLZnEBAQiZkwuDT08cpI8J3keDDe aYOBIKDogIxWJVArYlo5sDK48YnOhDSaEjvIzzT/CtrtV7QVNQKRPP/5mIOWrJXsMnJL JBTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M1RAi9Y3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q19-20020a1709066ad300b00930c37d7919si7835270ejs.673.2023.04.09.08.47.28; Sun, 09 Apr 2023 08:48:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M1RAi9Y3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229587AbjDIPMy (ORCPT + 99 others); Sun, 9 Apr 2023 11:12:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjDIPMw (ORCPT ); Sun, 9 Apr 2023 11:12:52 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567BC3A8B for ; Sun, 9 Apr 2023 08:12:49 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-94a34c299d8so15677966b.1 for ; Sun, 09 Apr 2023 08:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681053168; x=1683645168; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=+F3m/Z1uNGrSrVyh1TkFgL4DP+S57DCP37l7qhIJQgc=; b=M1RAi9Y3eZ4oDqaOiEgfRPTe/gFBcbz7h93AcksETsvCtZ04/kx4YmzrlzVm/ifNwu MCw6qFNZE7iA5jmtIVXIcNLwlYMfAi+E63iZ93a7Ytms3b22G4ePknBKZDCe+Q3pVkql VM66Rosv6gKKASVmYOozZKyL7ALolz7ckIviCyEpfJJcHpmBjXQlOJhnvWxONOHzuNq7 scmSYOLPLqzOiUxkLdmhX3OVRXmtY4LC3F4GQqyt245bn44/7xEuG+Q40g6EMBzvI5ZE b10UhGc13YUmGnL/gaddvWvVTW/vT9WxZWfMni2/nzZA6tFS+e030DPw0NAtdCbY0GTD iE1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681053168; x=1683645168; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+F3m/Z1uNGrSrVyh1TkFgL4DP+S57DCP37l7qhIJQgc=; b=Ehg7/N2DAJdxJrTr+3TAnCfKokgblf7eHzbDRHbk1mmgi9uyb67s2NiEG+ewrAjqic B368T92tHPxBw3BgSmhlTOEqhrwbTYHACtjHCzpXOifK2v0ZAKTure325mFW80+dLPJe EECvFWg9HWTMIz5TNXJBC5AQRSa+Tr753qrBFupJ2dsQsT2+c93A4NwWQAHYrDVcZ/qw F2Z+glZyQ/FT+VCSvwGlWc4mU95lMlF+Y199oN1G2eup621JH26rMhATunLHuGhcOniO 3IyWV06WUTDMMkd1hcnerxOYfqt4yHTYdY5P7bMzERuXhr8YzDN5kAteqYWZdsrSJK20 9HAg== X-Gm-Message-State: AAQBX9cjLQ4Q/GuFKROeLBwT80z5q0s79Ssq56Ybim1XbCQE5ijPuIId 16NB9+NzHpBZ6wAKNHovltI= X-Received: by 2002:a17:906:10c7:b0:947:f415:db23 with SMTP id v7-20020a17090610c700b00947f415db23mr4727852ejv.1.1681053167642; Sun, 09 Apr 2023 08:12:47 -0700 (PDT) Received: from [192.168.0.103] (p57935146.dip0.t-ipconnect.de. [87.147.81.70]) by smtp.gmail.com with ESMTPSA id dd20-20020a1709069b9400b009475bf82935sm4177550ejc.31.2023.04.09.08.12.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Apr 2023 08:12:47 -0700 (PDT) Message-ID: <004210bd-0ed1-58d5-0315-47499c850444@gmail.com> Date: Sun, 9 Apr 2023 17:12:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] staging: rtl8192e: Fix comparison to NULL of variable rf_set_sens To: Yogesh Hegde , Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: Content-Language: en-US From: Philipp Hortmann In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/9/23 15:10, Yogesh Hegde wrote: > Fix comparision to NULL of variable rf_set_sens as per Linux kernel > coding-style. These issues were reported by checkpatch.pl. > > CHECK: Comparison to NULL could be written "priv->rf_set_sens" > CHECK: Comparison to NULL could be written "!priv->rf_set_sens" > > Signed-off-by: Yogesh Hegde > --- > drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c > index cb28288a618b..a67edb81a820 100644 > --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c > +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c > @@ -311,7 +311,7 @@ static int _rtl92e_wx_get_range(struct net_device *dev, > /* ~130 Mb/s real (802.11n) */ > range->throughput = 130 * 1000 * 1000; > > - if (priv->rf_set_sens != NULL) > + if (priv->rf_set_sens) > /* signal level threshold range */ > range->sensitivity = priv->max_sens; > > @@ -813,7 +813,7 @@ static int _rtl92e_wx_get_sens(struct net_device *dev, > { > struct r8192_priv *priv = rtllib_priv(dev); > > - if (priv->rf_set_sens == NULL) > + if (!priv->rf_set_sens) > return -1; /* we have not this support for this radio */ > wrqu->sens.value = priv->sens; > return 0; > @@ -831,7 +831,7 @@ static int _rtl92e_wx_set_sens(struct net_device *dev, > return 0; > > mutex_lock(&priv->wx_mutex); > - if (priv->rf_set_sens == NULL) { > + if (!priv->rf_set_sens) { > err = -1; /* we have not this support for this radio */ > goto exit; > } I would like you to do more. I you search for rf_set_sens you will see that it is declared as a function. But there is no definition of the function which will cause an oops when this function is called. Because there is no definition of the function the priv->rf_set_sens will result always NULL Bye Philipp