Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp320581rwe; Thu, 25 Aug 2022 00:23:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR5PZtYesya5EfMwU5m4u14fPraKv5og3Ak+haBoWandVo90mFb4eWP2dnha0lWnhzX9z76q X-Received: by 2002:a17:903:100a:b0:172:c288:2c89 with SMTP id a10-20020a170903100a00b00172c2882c89mr2605680plb.128.1661412193213; Thu, 25 Aug 2022 00:23:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661412193; cv=pass; d=google.com; s=arc-20160816; b=OcW3JaRme0W5dwsLQ03cAsWkJFrsYP28TfV9Uuhn7kJCxe/KbZVEf9M3QwonIpUsJd lXrQP6QqaIJIli/BXQRFX9ZHM9iDvRBbohSsTO43TP6r7kyejvB+qDsutpIUTqu7C2x9 s1WsxVXCWnHrmxV6DWSBPEa29S/BR7lafyXiKfBaloJRPG1FhBBmvhLei2llrAYDzZ33 Mce9p3z1L0CR1MPZAb7W7U1YXydKbjOdT1Z1nU+akapveb0PtdSI0rJdkO2ZLJH440CJ 14IIzwd1A6EXRmr4ycdM7DWzYkSTnQvsqpeJ5Jis5go+6VAUqtp8y5owBsxmRSFHemTv XW2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=CAJCsfFz0LXrV/oEcXxNN1EY5+zjMvFV6rddT952w/A=; b=Ft9hGJlF0JEF1nokN9v2yleVr7ls7FJoyFlaRQEgXvs/rhnuz7Z287BFCCZWq4vQCh uE/haRoL67+Usr3Sg/sOTU0wWAVe29Qit044b4V5T4EG3lKBhX4xzBAM6VHHm5/ZBonS FLIL73m+nGLBWgduXUUAihttjcyoImNiJKUgEkrpjnosOhwCLAQG47DUh4j1fTpRviPm IIFdzloRXGSr18HLWFW1sf07vc2bkRzBVQxQ6gTv8rVvZWyPcpe8Snqe2t8CiDyfki26 Wn9GnppGhLnmqCUWao6Nny5B7q3nWst8zWLi9qvnlg3XqATeKMwFvJ55ZaQUW7GBwtft cUPQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=iPxIunmU; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pTVPi+Ea; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y31-20020a63495f000000b004229dbabe2csi19700195pgk.284.2022.08.25.00.23.02; Thu, 25 Aug 2022 00:23:13 -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=@oracle.com header.s=corp-2022-7-12 header.b=iPxIunmU; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pTVPi+Ea; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232477AbiHYGgu (ORCPT + 99 others); Thu, 25 Aug 2022 02:36:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229834AbiHYGgr (ORCPT ); Thu, 25 Aug 2022 02:36:47 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCDA69E887 for ; Wed, 24 Aug 2022 23:36:46 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27P4RMAX027723; Thu, 25 Aug 2022 06:36:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2022-7-12; bh=CAJCsfFz0LXrV/oEcXxNN1EY5+zjMvFV6rddT952w/A=; b=iPxIunmUIij5JXNkAIAa1x+W5gEoklg5Xrp/mMRsFmPVHAUqFErHWiHzbidKNyu5RArJ C3IINkOBYrWpniU8ROheNYBn5p+8fcHd25a0nCN/0PXZ+qcKnLE1zbyAv6ylGdnAb23w LLiYPMudxayBmDrtqy1C7cHVQKenoSp9gnNtvackI6WXw3POHWlLW99S3f9tD92VhSww h4gcrB7Eq+b3ESBgjsHjiTm2xmQnuQ/5vEqOQtW0HDwDqaIv6igAxOuSqL2h/5JnPcs+ l9suEzG3H9iC68mfxiOs7AbX8UvPgQRPBL40pLjYwqSS43UrUYom8F/8eHhGQ/mJOtc+ QA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j55p23u9q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Aug 2022 06:36:28 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27P4I8jI008977; Thu, 25 Aug 2022 06:36:27 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2108.outbound.protection.outlook.com [104.47.70.108]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3j5n6nwfm4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Aug 2022 06:36:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aseglhf42r+bggdY0dlfHx5B1926Rw5xFFCLlZPUbJXTSptJ3pZ/ooHMztPFx+9B6IGCXrdEuVYtPv/2nT/NGK1wR5Cov4JGl2jbEkm3BNWWYlDaoZAgJ98w4RoU3ze5JK1PxqsDvzEBLmTInlSAnD8799Wjb+/+/U5l1lk9v377eUqK+wPcoflGJyiumkJ4rvrQGD5VOru9aGmNz5CbiKQRfWmaG1QuU60aEZ1/FDpbOj6AsibpLEMf8VRX0ZLCqD3sXg9Mwc3F53Jm4MYNGRZ7IuWuhjss22GMRnsnMROnQIcsmlYXJ4A/B8xqyAfHtAoZ10OeAwhrj8lBFG6i+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CAJCsfFz0LXrV/oEcXxNN1EY5+zjMvFV6rddT952w/A=; b=BIff4EphUmL1/ybZmzAMe87UV2f3UPrPz+EdjGTzagrsNWvmGDOjm6sxi3C8VvDdhIbN8ltwgcDjHviBuDB3BsRKlwsaCUlBIADwfGSm6limOFFT+SDePcP5GnzbyQ4a4MLN4xRWzYGoj0nNcqFKvPMp0T5MCrBnzmRv6RyEOZBzwYstJLASm69HX0BC2WTyqHngdlvvI3q5sX71tcwbPBP+JLmhM/FpI1GbaSwXTvNqC7vJwaM4YMB8dTdW+Yaj/K3+op805EzIYtdpCxs+MkiCrNDMhnt68jkBj5aCmHUYMRJ489CWhCzoAYg/aeZrXZnxVut/s1N1FARnzMGkzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CAJCsfFz0LXrV/oEcXxNN1EY5+zjMvFV6rddT952w/A=; b=pTVPi+Ea4xfH84X8MhFMT7hiMaZ/60OXcXCUPgAdVyXr9qSJpSTOt6Ejn/rc09zVmN2YGNZHVdzUmjh0Nt7RjmkOvISg9/00He4wBGMomOrCJGq73bbSHDYDhJRWNx7PTVFKCczePIvpw4R4I13tZPMZNWmj+AfYkuY5Bo398/I= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by MWHPR1001MB2285.namprd10.prod.outlook.com (2603:10b6:301:2e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14; Thu, 25 Aug 2022 06:36:25 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::209e:de4d:68ea:c026]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::209e:de4d:68ea:c026%3]) with mapi id 15.20.5546.024; Thu, 25 Aug 2022 06:36:25 +0000 Date: Thu, 25 Aug 2022 09:36:02 +0300 From: Dan Carpenter To: cgel.zte@gmail.com Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, paskripkin@gmail.com, gregkh@linuxfoundation.org, straube.linux@gmail.com, martin@kaiser.cx, jhpark1013@gmail.com, makvihas@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Minghao Chi , Zeal Robot Subject: Re: [PATCH] staging: r8188eu: remove unnecessary null check Message-ID: <20220825063602.GA2071@kadam> References: <20220824080350.221614-1-chi.minghao@zte.com.cn> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220824080350.221614-1-chi.minghao@zte.com.cn> User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: JNAP275CA0034.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4d::11) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23af2d9f-ea57-410a-ab79-08da866421c1 X-MS-TrafficTypeDiagnostic: MWHPR1001MB2285:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iq48OzEVmhPP7v8Jg0o07O+zZMfJB+6b9U5GwHUluzk3IH8Ylla71nKKaPGU2lFRiSLeG/gyD8rCONYRe0uPEy9qQRwvuEIiICUgveVE29AWWHi+8eeSYz/2SNdig3Y1spQjsQI1KSRBxTrsaLYJNLXWJd6ysSbtNpvL3MwnMRrl7kmkdeC6r102BPK/DmdSJzAvcnkQSlQSbYzjpG59Mt0C50Ag/8j3qsZy8Fmsb6E35+OHMdTzl6HXNTguokkJ0kT9yk0w7JQcEmld0hbiPBJeoCr6RyqbCY8BPVQyt+KhVbg+CLeBFXvh8clScmkaMsBVEGp32HWo5fh33oyIefmO2hiYl5u+XCHKa0X/c1jJacdCwgViNF9LmHYo7JuXMqUECXYhpefDDgFbisp941Bm0ZlbAFYHRc66B2WRyv2IOKhtGanF91a4DvcBOW6pyc3QM0bpWI23MRGtVZU2A4gLG8LLuLrRLJojQtkZSs3EaWJg3EDtDwpG1yABKnbHoye+9BbEetSGVR1lXkrr1KegHR25Hal8AOw2LBVNpy1So8ghb8f5mWoNJpBYajD7FHjr/9SdXg7WwZJtXpihwt9NWgf6ZeQEw+1dqHUa1PakSWOszxTBtDMEqq9G0dy3ot+LV7GNOg7qkSMHC1qZHEmTM+aPdlFQS2tcL6uLW/NxjpOTyc7+FLudjhzpTBLb7dHGH22Iyk2C+fenk5i19wv9O2DNQrgXxGKnlakMgpP5lj6VwDx2lDRhRZQCxg16kUK/tvwmsmODmFcHf52CvA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(7916004)(366004)(396003)(136003)(376002)(346002)(39860400002)(38350700002)(86362001)(83380400001)(38100700002)(186003)(1076003)(66556008)(66476007)(66946007)(316002)(4326008)(33656002)(6916009)(4744005)(7416002)(8936002)(6486002)(44832011)(5660300002)(8676002)(6666004)(478600001)(41300700001)(54906003)(9686003)(6506007)(26005)(2906002)(33716001)(6512007)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hRfqwVBZeD9CmnNXNYM4HZIqF6D5S4kRFBg4VILAuWvx4YD9t3oGJFDK7kMS?= =?us-ascii?Q?HFvOnIwyheEF7SBJZ5eJ+PMTWrCxkDMjbkuj4caDgVnoWcGOpcFyw09fg4Sd?= =?us-ascii?Q?lVRIDedsv1dW9Q7Yht4KDpsfN3WI+V6hEoVgIGPp8po2ayBcDozcRlaa4QFX?= =?us-ascii?Q?0iaPs/wm6CAEQMLFmXWWLyxr3IwZ+NWhAH8PktP1Ryry7RPgh6/aOMRfsL73?= =?us-ascii?Q?+F78Eqhh4HbASjyR1fpGyL6WTDYFPlIfgaGR/lRhL1nAFs/YJbGJfdV5Jt57?= =?us-ascii?Q?/b3i8F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QGHm2tjM?= =?us-ascii?Q?NB1zn88eGImu4kGWfFvIPLp1ZAOtMess92NY3m3tmv8LXU0yQ8psL/N6XDnd?= =?us-ascii?Q?UzaNF7KUT1UDDTLN6IL6t1EkV3rlX9uxs0f3vKBxXCuJLQarUxH8VvUEaI61?= =?us-ascii?Q?lhhMew6+OqRgrxY4agsJbKDOsGw89ANqeRiLVsrIaK7G94WsAsss2zArE+pm?= =?us-ascii?Q?y/4n4uMbsakbm6996fhKdQWKT54dmTO+9xuVanBgG6MkvkLAaJq/fYMVDw7m?= =?us-ascii?Q?9rTyKsoyQsMWEO17tURc7ziOr4DnTe5cu2cFfY/cLkFGT6d8aP9JJ3EKg1ke?= =?us-ascii?Q?4xXQqJGoG21wmqkOQZjcX0pggT2Jl9RfZf/1V0psCJui8KE9ezMMKofXbXy/?= =?us-ascii?Q?AHqopDiK1kX45tBjsrbVOA7+BUdbWyauplwd9kSm4dgZ/vLjbsudtmyLJ9lW?= =?us-ascii?Q?sQ=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23af2d9f-ea57-410a-ab79-08da866421c1 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 06:36:25.4569 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KzRtspreXprfvXZqOfgykJ2pFv+incYpKRjyCvop0WqDzFXTdtCQIJ+Dby/6TwcGylfwUneE+A/OOQUiMKPxbJ4oqVC6fZh2UCnvce5mmVs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2285 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-25_03,2022-08-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208250022 X-Proofpoint-ORIG-GUID: R24fnYf5498nCWNPALw7-BAiu7Xbb3if X-Proofpoint-GUID: R24fnYf5498nCWNPALw7-BAiu7Xbb3if X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Wed, Aug 24, 2022 at 08:03:50AM +0000, cgel.zte@gmail.com wrote: > From: Minghao Chi > > container_of is never null, so this null check is > unnecessary. > I can't Ack a patch with this commit message because container_of() *CAN* be NULL. Here, it requires two things: 1) That ->list is the first struct member of struct wlan_network which is true. 2) That "pmlmepriv->pscanned" is NULL. Which I have not looked at. It's really ugly to check container_of() for NULL but some people do it deliberately. Some people also will add a build time assert to ensure that ->list is always the first element so that the check always works. regards, dan carpenter