Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2605495pxb; Sun, 24 Apr 2022 20:41:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRq8dTFupJJ7URYOAxS9Fwz+t7ZBiXP5Dn6aYJUfK+LFA3qkQ2+wooO5fRiJbzLxw42AcX X-Received: by 2002:a05:6402:1d90:b0:425:dd36:447c with SMTP id dk16-20020a0564021d9000b00425dd36447cmr5999109edb.347.1650858115699; Sun, 24 Apr 2022 20:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650858115; cv=none; d=google.com; s=arc-20160816; b=jPD6oDZF34ojz/waIvR9bfw8yMU4IBK+h+a3PkPz61BzNyp9hhoWsKXAWybGkHfbD2 KSg8htDETyj062+I24aL28olHVrXJiOE+gWaMBaZseftdFX5rPPRWAMDcbfQC3l48iD/ +hO1MzTtfpKoMh6fY31w8PXS4Ki4hmLXNbLbnreRLSFPx0T9GyVhbwkT6yVAZCuPY9Za WJOT2fa4HZKvaLr5D3SozcoMrMDUL4k3D4xel2LgUMHpvP1DZqr8b5wyvFSkxE9JhC1t 6EpMm4JouwAKjOqnZiepYRiJqahHRGdSqkAzyiGDa97iM7Ao4v5BZvNMuKOMp6NU1gRQ 6A0Q== 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=4KJhNI7dzi5fLHGxffpbeO6uNcV4HJTh/uEWY/YLuRI=; b=ykx+Nc/uto/1aBIqgZAE06yNAdDRlXvKD3CVT3U43ZmuT8mXx2QE1TJNc1Y+ZMIDfc rVStt4Ave0qka6w1bgvWaiuC3DiHw8tTmUlePrZZwDAm5el02F6v/q4oLBrdRWFoWzOY ZPr7oV8b0ENqi5UfUxxEDL6poetUnZ0Xo/Q/vphFs5eE2WlTfiobTP9Y6zBh52LETXjB W6t7p8ysPMTUoTHuI5qwQyTShTTFDuqmejxP1GmTVhQLKwJecjs2NZepgwPOR11coK+7 PHClPqKrCs+hI0GAa+ZUHxdC9Vn1Cv/nwGvF7JYf6Ka3H1199cR6oeMRPBCQ0lXzOm1h 7WAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=XihePaqf; 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 p26-20020a17090653da00b006f393afb98esi1570780ejo.509.2022.04.24.20.41.30; Sun, 24 Apr 2022 20:41:55 -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=@lunn.ch header.s=20171124 header.b=XihePaqf; 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 S239768AbiDXWUe (ORCPT + 99 others); Sun, 24 Apr 2022 18:20:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbiDXWUc (ORCPT ); Sun, 24 Apr 2022 18:20:32 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C48E68F8A; Sun, 24 Apr 2022 15:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=4KJhNI7dzi5fLHGxffpbeO6uNcV4HJTh/uEWY/YLuRI=; b=XihePaqfCifBFs/qq8nvPD42yQ HqcV3RCwV8yRJaVIFD8aRofLAgbVYuuOluce0aKidGzus8BeAlbkutDV8Fd77Zyg6dq405Rt63yhH Qua6PLWb3qmFh61VhYpF8IezAeI95051bWrDTe9+fv2nCbGmutAifpBTA+8D9XpzSzNs=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nikXh-00HJW0-2S; Mon, 25 Apr 2022 00:17:21 +0200 Date: Mon, 25 Apr 2022 00:17:21 +0200 From: Andrew Lunn To: "Maciej W. Rozycki" 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 Message-ID: References: <20220424092842.101307-1-wanjiabing@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, URIBL_BLOCKED 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 Sun, Apr 24, 2022 at 11:39:50AM +0100, Maciej W. Rozycki wrote: > On Sun, 24 Apr 2022, Wan Jiabing wrote: > > > diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c > > index b584ffe38ad6..3edb2e96f763 100644 > > --- a/drivers/net/fddi/defxx.c > > +++ b/drivers/net/fddi/defxx.c > > @@ -585,10 +585,10 @@ static int dfx_register(struct device *bdev) > > bp->mmio = false; > > dfx_get_bars(bp, bar_start, bar_len); > > } > > - } > > - if (!dfx_use_mmio) > > + } else { > > region = request_region(bar_start[0], bar_len[0], > > bdev->driver->name); > > + } > > 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. 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. Andrew