Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2716406pxb; Mon, 25 Apr 2022 00:19:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJwwwo2dS4GRNxRudebqF2Zle+sYP665Obw+hLJM4hpyvAzt1Dh2AgJA9cD6noq/wT/WYS X-Received: by 2002:a05:6402:218:b0:419:d804:9483 with SMTP id t24-20020a056402021800b00419d8049483mr17714212edv.396.1650871174021; Mon, 25 Apr 2022 00:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650871174; cv=none; d=google.com; s=arc-20160816; b=hg1qytKgPv45hKGcE0JmKPJTZ8a+SQ98/ian0aS7POo7fbcZOd1BNIPbAb6TvHVcEq xa7LvHdwSIfPTWN23j+DRJ3itasARXwwGcEviPXFobUdIT8pc0GCbY567/0T5TOyMUmo aBAFt8HVBON32QyUh6lscAQLNjDQBMduiEWKuXSkwd07YnrPfZDQU1CARROXBy+73M1Y fEd1L8czw9PKmEZrYbURIUMuaK4YN2/2DKy5ec20kZz6eqUD1YucwryhLysw+tqdYgi8 jCxCctswfRKzPhCFg0C5i4aL0dOg8CG79Mi7NGyNiPs2o4o4067JGiJuJsfyI1xptKmu tCpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=Wn9XNI3yF4K0Jg3K+cdbJVBtY8TF0U2uiXsnIPqrWMY=; b=eFSWYqdD44EqrjkaBb26H/zR1DZy0yNlf/bG9ZmNSdjm8XJZv+3/ZlZSkvOAejsC7x 8a6RhOBQFdp3ZfG1FFYSYB5ZU9gyZhFfLoRFrWQ27ZkE2HWPNJCoaIoNJd5iG8dykvdi 1Cq3hoHb76Q8CFK7qo+vrhWiqrDLTHiykK5aC43moHJ6JRutUqenOmTYg3CXOfyL7F0a mlEHQgdB6mJv6fSTWwzYnzkJEO/ANyafwaQAWWNkFDvihL+19X0xtrQkB+wwTs4rQR9t HOg4fpapxMmOHEjB8ZhNajcHDtthA/uASwgC0K0G74KhwJCNXM6z0JBQ+sq681ikxgaV 8MUQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl16-20020a170906e0d000b006e87a026d42si11320516ejb.261.2022.04.25.00.19.10; Mon, 25 Apr 2022 00:19:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239893AbiDXX3P (ORCPT + 99 others); Sun, 24 Apr 2022 19:29:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233081AbiDXX3O (ORCPT ); Sun, 24 Apr 2022 19:29:14 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA8536A043; Sun, 24 Apr 2022 16:26:11 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 901EF92009C; Mon, 25 Apr 2022 01:26:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 8248092009B; Mon, 25 Apr 2022 00:26:10 +0100 (BST) Date: Mon, 25 Apr 2022 00:26:10 +0100 (BST) From: "Maciej W. Rozycki" To: Andrew Lunn cc: Wan Jiabing , "David S. Miller" , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kael_w@yeah.net Subject: Re: [PATCH] FDDI: defxx: simplify if-if to if-else In-Reply-To: Message-ID: References: <20220424092842.101307-1-wanjiabing@vivo.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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 Mon, 25 Apr 2022, Andrew Lunn wrote: > > NAK. The first conditional optionally sets `bp->mmio = false', which > > changes the value of `dfx_use_mmio' in some configurations: > > > > #if defined(CONFIG_EISA) || defined(CONFIG_PCI) > > #define dfx_use_mmio bp->mmio > > #else > > #define dfx_use_mmio true > > #endif > > Which is just asking for trouble like this. > > Could i suggest dfx_use_mmio is changed to DFX_USE_MMIO to give a hint > something horrible is going on. There's legacy behind it, `dfx_use_mmio' used to be a proper variable and references were retained not to obfuscate the changes that ultimately led to the current arrangement. I guess at this stage it could be changed to a function-like macro or a static inline function taking `bp' as the argument. > It probably won't stop the robots finding this if (x) if (!x), but > there is a chance the robot drivers will wonder why it is upper case. Well, blindly relying on automation is bound to cause trouble. There has to be a piece of intelligence signing the results off at the end. And there's nothing wrong with if (x) if (!x) in the first place; any sane compiler will produce reasonable output from it. Don't fix what ain't broke! And watch out for volatiles! Maciej