From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A6F7C433EF for ; Sun, 24 Apr 2022 22:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239782AbiDXWUe (ORCPT ); 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: 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