Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp639822pxj; Wed, 2 Jun 2021 07:52:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeH/w7WuTZQ5rRC/Xdv7GVRfrVT9UQwRAGEGQvgswzMG/XkSllTu8k9z595Tg7ugOBNnCj X-Received: by 2002:a17:906:1e15:: with SMTP id g21mr34432421ejj.241.1622645563451; Wed, 02 Jun 2021 07:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622645563; cv=none; d=google.com; s=arc-20160816; b=qcTH1TQn5/8M4JpatUlGxFLZLOKXvjvHcLNM6mAHTR7UHZTCueyiisyqODcxUVcIp8 A1pJ3B0NePAlqDvKRecAFteVWVQ5C6yh2l68cQaYFqGIaA/hfBo9oc11WgpQiOk4zTLL +JM7RmoRqjrSOpp2XgrPbpWNH8GbHVzQLzXgPcdIiMVOsd/Z7YG4+ltepa6MS+Vp3zbt 7TjI+ILdkUBfpQdv7gyi59IZUQ90dHkIjACIIbx5IwoPAv8/y5xRyh54wKW+hlC25uUn 5ZCFP1TIiOt78YgK+/PeouQ+z4qk0AiaTVAcq/m+hy1CbDcmraRbNEEiHz1l7iYcEgQx 1nTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=i9rBUFdn0o45VyNYIoUSPAP6TWQNEYGbweMgl8R3j2k=; b=x+9yqGK8ZVdZ30aB4c04MBe74ZUZUbYXNiX5davB1gG5SKFBbVKTBs6FWxqPgzUVO1 rex50MZxoAzXi+Ah+nV0yNGgRjX7rktx2+wUVLz9PGGlMnOQADJUl7D5U8bh+feLblSb tgV2nxe/klFnolzDgO9OyaSTrjIJMH0x1WC+8hGuZBdYYbAPIgoZIDDGsWEpBImfwaOF TR1LcacBFhX0EVAAdDyfqWFDNxUImppGLnc1le/ukHyt4l6kr6nyge5mLDDi+mRKIBLz NhxWbqwBv73laVNndmU6XZZr+0dT+hSw+yb7RBTDNxxS53iFDjdVqAWbCUAqc2pf4lB5 7YoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ewELyXn1; 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 j16si105812edj.401.2021.06.02.07.52.19; Wed, 02 Jun 2021 07:52:43 -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=ewELyXn1; 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 S230300AbhFBOw5 (ORCPT + 99 others); Wed, 2 Jun 2021 10:52:57 -0400 Received: from mail-pg1-f171.google.com ([209.85.215.171]:41639 "EHLO mail-pg1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbhFBOw4 (ORCPT ); Wed, 2 Jun 2021 10:52:56 -0400 Received: by mail-pg1-f171.google.com with SMTP id r1so2423501pgk.8 for ; Wed, 02 Jun 2021 07:51:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=i9rBUFdn0o45VyNYIoUSPAP6TWQNEYGbweMgl8R3j2k=; b=ewELyXn1oVOkpjmFF9isG0jWeHDotlUmFjk677kzmx9NkvN6CJODmk4ABhKGE7SShm BmAkoAF5sNQCdyCX2QtuQqzBJhtO/wNKe13dCXLpIEG8QSMgIVMRofZO3APfD/HBwkpx jVboz7cyuf/sGTDv5pP8T6awFTi2Xv/udo8MkgGZ1LstSJ4b+tL3awBU5A7pqkMK/o/C HTrPZWpf+5ivS1nBpJZJurCwSoi9bY+9wfMNZLj2ysaIfdETm63bmkQuGLntKR6XGNNK xPFzjbRqxGCroRFZnCauLtKIdBUma0hvO0afqBTpGidL9vVfsQQaStyQS2tcWyjAJC5v mgiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=i9rBUFdn0o45VyNYIoUSPAP6TWQNEYGbweMgl8R3j2k=; b=uL1WXSIRwr1+imOOrTx5rk6bmd0G89N2aXQKorSvAhnH2G52281p707KpoEfBrx7P0 OzeT0sLnW8aDpGmlLWniut6RhEelNy+SjjgvSfl5LfqDtU3zgDzCCubomFX+5AOk+ak4 Mie+VDRZ2lTUcWHoddpsjguAge2ljJzSpBl46PKhNnRFLgckTyJ2nTKXTO1PAw1zwBOt 5O5bHK/UBoxXEYgNgZbDskVI9vIxQ3vm4IIKmjJhtokCd2RbR3vMkYuMjimlQ6Ox/KvR iHp525jXD+Op+ItFkffL6H2CZuv5zBAcZ4/tqdYst/SyrLYu3Zc7080wD95tYabAO9kV dozw== X-Gm-Message-State: AOAM532HwBVLee/33bmnGGT9X9cTObA37bju5kW9qK53Nuku3I5DFEtU HCRbdDwPCPIKIEu5uZPm5qI= X-Received: by 2002:a05:6a00:16cd:b029:2d0:d876:4707 with SMTP id l13-20020a056a0016cdb02902d0d8764707mr28187601pfc.64.1622645413401; Wed, 02 Jun 2021 07:50:13 -0700 (PDT) Received: from ojas ([122.177.142.129]) by smtp.gmail.com with ESMTPSA id u8sm65892pgg.51.2021.06.02.07.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 07:50:13 -0700 (PDT) Date: Wed, 2 Jun 2021 20:20:00 +0530 From: Ojaswin Mujoo To: Dan Carpenter Cc: nsaenz@kernel.org, gregkh@linuxfoundation.org, arnd@arndb.de, phil@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: staging: vc04_services: Need suggestions on trying to fix sparse warning in vchiq_arm.c Message-ID: <20210602145000.GA3999@ojas> References: <20210601200513.GA10204@ojas> <20210601202307.GC1955@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210601202307.GC1955@kadam> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 01, 2021 at 11:23:07PM +0300, Dan Carpenter wrote: > The problem is not the Sparse warning, the problem is that this code is > a mess. It used to very clearly buggy and I reported the bug. I think > Arnd found the bug again independently and fixed it. > > A couple weeks ago Al Viro looked at this code. Here is his write up: > > https://www.spinics.net/lists/kernel/msg3952745.html > > It shouldn't take Al Viro dozens of pages of detailed analysis to try > figure out if the code is safe or not. Your idea silences the warning > but would make the code even more subtle and complicated. > > The right thing to do is to re-write the code to be simpler. > > regards, > dan carpenter > Thank you for the prompt reply and the link, it was very insightful. You are right, I was definitely going about this the wrong way and missing the larger picture. I'll spend some time trying to understand this codebase as I think that'd be a good start to understand how stuff works in the kernel (even though some of the things in this driver are anti patterns) and hopefully get some ideas on ways to clean this up. Anyways, thanks again for the help, cheers! Ojaswin