Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1348147ioo; Fri, 27 May 2022 07:00:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqzlhB9HYcxpFxjYIdMLsWQxtiWqQEvg6KoR0n1vptgCH5gfzlTIxq+805748TRN/U64uE X-Received: by 2002:a17:90a:de15:b0:1df:63dd:9cfc with SMTP id m21-20020a17090ade1500b001df63dd9cfcmr8719354pjv.200.1653660002599; Fri, 27 May 2022 07:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653660002; cv=none; d=google.com; s=arc-20160816; b=GiS5lxcCThJWeYbqGQ2CmbkXzDjWA41NuyHQbtdEvD7WCIRVk3xBmQ7LWa7vnyRavs KBFZJqcZ0weHl4r2DSHPo9/4ih3DCrExDaL8fDsPhrAj3RQTSiv2W4pxTEPMjUkvm3oF Nf+P8pTMHKMY9SPyATYYs7dgDHom0wztqfHJnWxmp7ggzxGqpuHWODMw2o2AvpZ0BObP ERDuUyW6SOi8R2V6mqUd8cidCCBf2NSsPcO9ybTZ1KzWp0qb0pvUUweONDgxZwnky2N5 cJ8OG2qxxKF4iyImINzyFShubPVCzJqW9wo4bdHT0tNtVCMC6EUehPG2MJE/RFlJ25ma oUkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=KwscvJb+e3wCc50yy7+Oyvg5tXhryYMBM/Mq6KPfxIo=; b=D9sOg8vf90gGRHxpQt1dLOOv2AXA2mTccSs++dH1ykB8yJ9NG43XVudzHOCTgwZ9/v XyiqUjxWLFDbdimxnCoDdKraLxgYDQ9K/BYOx0DhbFbn4cbgpcODklt0BcNjuhyYY1WJ JWwPNM0OqLL3KxsG47nbxZwpqlNp/sMEU9nUsOjbX0Fwp/Oej1m3VskEn8mR6car4pVU gDH8gdjXC+p7Pu5DN9hMafQSrQuU+ExofM9RTHsZMKHRafH0AKl+4wuJb6h8qohuGTMt t2dNrUfPJxGTiGfeLwHEP41vYI1OJf1he9K8rDbUAG3DpanRBird/CvbtpaIoMJy52+P sqPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WXgVfsqZ; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc22-20020a656d96000000b003c6c6dfc3e3si6934248pgb.143.2022.05.27.06.59.49; Fri, 27 May 2022 07:00:02 -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=@redhat.com header.s=mimecast20190719 header.b=WXgVfsqZ; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344495AbiE0GvA (ORCPT + 99 others); Fri, 27 May 2022 02:51:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344512AbiE0Gu4 (ORCPT ); Fri, 27 May 2022 02:50:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 279A6ED8EE for ; Thu, 26 May 2022 23:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653634254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KwscvJb+e3wCc50yy7+Oyvg5tXhryYMBM/Mq6KPfxIo=; b=WXgVfsqZOiY6hqWMKT+sS9hWI+1UBMDCMb31Y7xgmCSMqtkGrMN44tslRukkxmokpkhfep gm8O0CNGaGVSD2Nw3kYRdYSH5M5kQ+tJze6V7/3X2okAcx5ayXgi5LglW97pmhfJc44dJz qB2Os1gxewTCs7vkNcYJlDHZSpDeoeE= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-85-eRBC6XXuPPGIPJNOkl-BCg-1; Fri, 27 May 2022 02:50:52 -0400 X-MC-Unique: eRBC6XXuPPGIPJNOkl-BCg-1 Received: by mail-qt1-f200.google.com with SMTP id d13-20020ac85acd000000b002f3be21793dso3672227qtd.12 for ; Thu, 26 May 2022 23:50:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KwscvJb+e3wCc50yy7+Oyvg5tXhryYMBM/Mq6KPfxIo=; b=QmmrJdGIGZyek+1fCBr2UPUzshhqUCzmVEqWefNCaHwVlfhIfEvuGt0Woog54uNWo+ Rn+x+9mY7Rp+suPaBJ/dPiUSgkJJbxSG7jv124cqBJPk5KKWM9hI/9gHKdZ7kCH2g5Cq e+laTdVmcG1ikKT0RO4r9rEX8SyYxPl0hf4NlPSFRTKOxBQlkjK+nLPQ0vT6QqyXGmdj v3+yAI1jG9c/gaNrI5DNLtK05zvnKqnpOLEcROSafgYOPpA0P5KjkHfbDSqnOlOVeJEs CEKBbtGfjB1h/P/uNZ/SU0Thqjpy8egR4lGuxsMPOD+5IAYzA/4NUS4vjSNMh6RlLgcw 6IfA== X-Gm-Message-State: AOAM531x0/ToIRrD9vQJNFEescLVicM/l5AAQW/uUXQCZpQCr4L7atDD Fjf2E0Ap7pcTKATcsevbk/2M0/EvCd6hnjJVkhtQP59kYlBLnZTM8+Y+h7VK4LDevrMCt4DysqW Jx2P2+KjK8lxOE9NNJ4CPAKY5K5jrVmtPw8Rmjb4n X-Received: by 2002:ac8:4e81:0:b0:2f9:34e4:8955 with SMTP id 1-20020ac84e81000000b002f934e48955mr19432019qtp.459.1653634252363; Thu, 26 May 2022 23:50:52 -0700 (PDT) X-Received: by 2002:ac8:4e81:0:b0:2f9:34e4:8955 with SMTP id 1-20020ac84e81000000b002f934e48955mr19432002qtp.459.1653634252144; Thu, 26 May 2022 23:50:52 -0700 (PDT) MIME-Version: 1.0 References: <20220525105922.2413991-1-eperezma@redhat.com> <20220525105922.2413991-3-eperezma@redhat.com> <20220526090706.maf645wayelb7mcp@sgarzare-redhat> <20220526132038.GF2168@kadam> <20220526190630.GJ2168@kadam> In-Reply-To: <20220526190630.GJ2168@kadam> From: Eugenio Perez Martin Date: Fri, 27 May 2022 08:50:16 +0200 Message-ID: Subject: Re: [PATCH v3 2/4] vhost-vdpa: introduce STOP backend feature bit To: Dan Carpenter Cc: Stefano Garzarella , "Dawar, Gautam" , "Michael S. Tsirkin" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , Jason Wang , Zhu Lingshan , "martinh@xilinx.com" , "ecree.xilinx@gmail.com" , Eli Cohen , Parav Pandit , Wu Zongyong , "dinang@xilinx.com" , Christophe JAILLET , Xie Yongji , "lulu@redhat.com" , "martinpo@xilinx.com" , "pabloc@xilinx.com" , Longpeng , "Piotr.Uminski@intel.com" , "Kamde, Tanuj" , Si-Wei Liu , "habetsm.xilinx@gmail.com" , "lvivier@redhat.com" , Zhang Min , "hanand@xilinx.com" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 Thu, May 26, 2022 at 9:07 PM Dan Carpenter wrote: > > On Thu, May 26, 2022 at 07:00:06PM +0200, Eugenio Perez Martin wrote: > > > It feels like returning any literal that isn't 1 or 0 should trigger a > > > warning... I've written that and will check it out tonight. > > > > > > > I'm not sure this should be so strict, or "literal" does not include pointers? > > > > What I mean in exact terms, is that if you're returning a known value > and the function returns bool then the known value should be 0 or 1. > Don't "return 3;". This new warning will complain if you return a known > pointer as in "return &a;". It won't complain if you return an > unknown pointer "return p;". > Ok, thanks for the clarification. > > As an experiment, can Smatch be used to count how many times a > > returned pointer is converted to int / bool before returning vs not > > converted? > > I'm not super excited to write that code... :/ > Sure, I understand. I meant if it was possible or if that is too far beyond its scope. > > > > I find Smatch interesting, especially when switching between projects > > frequently. Does it support changing the code like clang-format? To > > offload cognitive load to tools is usually good :). > > No. Coccinelle does that really well though. > Understood. Thanks! > regards, > dan carpenter >