Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2920502rdg; Mon, 16 Oct 2023 21:21:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZsF4p+2mbR9VenGDd76PjtdbVLENMpLg/ZKrGU91JYmyqTataxN+51LFKW2I/bVBU1LxL X-Received: by 2002:a17:902:ea02:b0:1c5:6f43:9502 with SMTP id s2-20020a170902ea0200b001c56f439502mr1225595plg.14.1697516492027; Mon, 16 Oct 2023 21:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697516492; cv=none; d=google.com; s=arc-20160816; b=kzVC22w0eF9xEHr4nzHwOm83oVDqJfWpvU4W9vz5gkfzVum8FXCuUB3trr7iDaeoKj p7YpAQv9uNdr1tK4ysToXPp5MWegbPcDWm6vfNafMT6p1GXkv5d5vnv1wzWjPEZb1q3W WVvA+PqacyQkoyUz8a1kUoaAcObHhBlDpmNq8lOK0hKNEwrsguqdp+mbXbgmpyxX8kvu mF9xrzdYjuEKwZLJgq0y7uDExiTYTA/X2ONf8dc7a13b9P8lJkYeNWsZDP+Is5IHJi3+ quUkdnzKSMVGZQRWbBdrkLSBOI5wFvP07CDBxkMMf82EpdfNiAiMPpPKd9mCvUT/EIZO eeJg== 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=mSCcyJKKhe9oQwQDqf1wV5AdygiSe6A+VMWBZelRBOg=; fh=xeGfxZVLzaSxFBvsoko3ELe7ca+I0CEIEoEGjX8iMUw=; b=zPLlm/eGb4AGehmJT76fVBX3RYaViIKDjV1PKASxr82pAIouEXewyNqt/Wnels2R0E qpn//h2YchPEdZO/hJnlxDll3vCByesOwAi5qAL1dqDx6xEW/NxoJyHIFhJvCn6Pa93+ z5r79K3cUti5efGFu5er94bfVll+nN6Dsa8h40I6RHGS10okGvSrYcy3BMBigoYgHErL z1NDTASFJATakkWLm/FTTLqS4FfNulTcIBxb4proBvtp/7dZ01kgPmLZBjkneWXmz/Uj TDM7rkJFJO1ujRYxMA6VpV/N9qE7Q62xrPHaN7BCDos4rrRCDwM/EBxgNxKoe9JMzUtO VgaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YJ8AHRFT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id c4-20020a170902c1c400b001ca85b996a7si893943plc.192.2023.10.16.21.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 21:21:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YJ8AHRFT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C53F580BC111; Mon, 16 Oct 2023 21:21:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234097AbjJQEVW (ORCPT + 99 others); Tue, 17 Oct 2023 00:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234276AbjJQEVU (ORCPT ); Tue, 17 Oct 2023 00:21:20 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC4309F for ; Mon, 16 Oct 2023 21:21:18 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40776b1ff73so29542075e9.2 for ; Mon, 16 Oct 2023 21:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697516477; x=1698121277; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mSCcyJKKhe9oQwQDqf1wV5AdygiSe6A+VMWBZelRBOg=; b=YJ8AHRFTCYB/cJuxDZZuLSMHm/C4yD8PzX9WGV1FWQoS67mkZ84DC4d69VIYNyHjMh UnMe4OwlfS82kz9s3jpqQIDmN/+u+JfjLjd/TczbN5VzyUfCtZaafXpHcYqVsSz3RQHu f4lnonVwQ1+q2kfMKx1Qz0z7pU6RkBroQWF25v8/gKHY7z0r3KX4H88nqERn9TebRwOJ CHHzqq8O4O2xyuwJcGbuPazTJ6vd18AQQ8IYU1Y/7tKGQdOoAn/Ju2ZGuY2RwtODw2Rl orpVVG5P/l732H5YLM/uKkNLQlBvrxdUxziEiu6jS79BUi6pWSTr8MkDeTZrsrWAxxie Euvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697516477; x=1698121277; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mSCcyJKKhe9oQwQDqf1wV5AdygiSe6A+VMWBZelRBOg=; b=S0YYyAEJLXSxU7u27DwiG/p3ypQBKh0ZSnI2YWQiK2lZtw1izFTTZHOMhxsQQHx1ln aqad3TpfCBJr3oD6hfyNYcxGUWRJF75ihNqu/zXqY3B2yzWnI8MzHw27yjPKrBaPCXjm S375wHL4WlvzwJf458Ql94TXhhD6qwOjQHaQVzeDXSU2hq8Pcmh6AqEbDq870Rwn7A+U 683KX0ES6P0Yq+xYp2iTKWfLB5qob7pZ8YNlW1uyu79eljwhmnWhloX06YapTiMxw8FO CxllC+a3Yaqskh9BP0ua+b2zgGsDWXurUdx5wVYjjtLBE6PzTVDZ4EO32bANzeE4VP44 I/Yw== X-Gm-Message-State: AOJu0Yye8NCV/LsRD/hRn/vi3NVqYEom6Z3CDZbgdgbPHGMqFf2MzXrw 0CBPdIIsIllZGzAbvf049vD6sg== X-Received: by 2002:a05:600c:4744:b0:403:9b7:a720 with SMTP id w4-20020a05600c474400b0040309b7a720mr886510wmo.1.1697516477154; Mon, 16 Oct 2023 21:21:17 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id o11-20020a05600c510b00b00407752f5ab6sm758943wms.6.2023.10.16.21.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 21:21:16 -0700 (PDT) Date: Tue, 17 Oct 2023 07:21:13 +0300 From: Dan Carpenter To: Przemek Kitszel Cc: Gilbert Adikankwu , Nam Cao , outreachy@lists.linux.dev, manishc@marvell.com, GR-Linux-NIC-Dev@marvell.com, coiby.xu@gmail.com, gregkh@linuxfoundation.org, netdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: qlge: Add bool type to qlge_idc_wait() Message-ID: <32b0e468-6943-431c-9f71-68fc41727914@kadam.mountain> References: <20231014065813.mQvFyjWb@linutronix.de> <20231014071423.UgDor1v0@linutronix.de> <78f321db-bc09-06e8-b4ef-ac56ab91e187@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78f321db-bc09-06e8-b4ef-ac56ab91e187@intel.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 16 Oct 2023 21:21:29 -0700 (PDT) On Mon, Oct 16, 2023 at 04:19:09PM +0200, Przemek Kitszel wrote: > On 10/14/23 09:50, Gilbert Adikankwu wrote: > > On Sat, Oct 14, 2023 at 09:14:23AM +0200, Nam Cao wrote: > > > On Sat, Oct 14, 2023 at 08:58:13AM +0200, Nam Cao wrote: > > > > On Sat, Oct 14, 2023 at 07:11:59AM +0100, Gilbert Adikankwu wrote: > > > > > Reported by checkpatch: > > > > > > > > > > WARNING: else is not generally useful after a break or return > > > > > > > > > > > > > What checkpatch is telling you here is that the "else" is redundant and > > > > can be removed. Although your patch suppresses the warning, it makes the > > > > code messier :( > > > > > > Ah wait, after reading Julia's comment, I realize that the "else" is not > > > redundant at all. Seems like checkpatch.pl is lying. So ignore what I > > > said. > > > > Thanks > > > > > > Could you consider fixing checkpatch instead? Parsing C is quite hard and checkpatch is never going to do it well. It might be fun to start this project but it's kind of doomed. Doomed projects can be an educational experience as well. The way to do it might be to add a new in_else_if variable which tracks if you are in an else if block. You would look at the indent level and try the curly braces. Then if the previous thing was an else_if silence the warning. But also it's fine that checkpatch prints the occasional incorrect warning because it teaches people to be more careful. Another thing is that when you introduce a bug, you should always consider if other people have done that before as well. Perhaps do a `git log -p --grep "else is not generally useful"` and see if everyone else did it correctly and if reviewers caught the mistakes. regards, dan carpenter