Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3331851imc; Wed, 13 Mar 2019 15:12:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqx468Q6RFZVthWUY+ajiuoycw69cTY/cE2Vu7BH3ml0UvMcNHR2+LGWGWXWQkEaap909WCn X-Received: by 2002:a63:5b43:: with SMTP id l3mr41784292pgm.298.1552515172355; Wed, 13 Mar 2019 15:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552515172; cv=none; d=google.com; s=arc-20160816; b=0JQadWwIlAiHe5w7XRXrLkn3t12CpCQPLuwQn0V4LEx57Uq6aGANhhmPhO+hq5/544 7ey9tYNSArVU6ZHxFPqTDC1zDgP+t1OBPhxDmmaCJLzuu9mKR4qvMut4VWQM7bFngNJU y8raaPs95B50gpOLc8qlEg6/UAsXvPq6cgs6gj//afIOkN381x3mz5JCl7vJJQghsx+4 mKkH5q9IXWxRIuUEHJ4Gh0wYyntsXsuMndjte7qYtq/py5HIB8C3Exm5pjC92GGPKGJd im6FFpnmcBQ+LiGGx2RueV8xaDuaSIet25iVJGvhvOLDcEH99dWGASM3taJ8dblMraM8 dAug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+vh8/+QncplqGdol3u1RL+CTiBwxhSRS/z0dc9FHwmw=; b=ezLaPYoXtA/xRW3t3ww9ay9+0zO5wVpsC4LP1shXRDoK5C9Kquw2OgEqa8Qhm8a5Ns KBRdfuy01gYFhD2YqCrV+scl6WX+v2ikvfWYRw3AcBIhpN3q+C0PpRQq6yhygEwxHnYX VeopyNPIzYFkey8mPRa9ARByJyBSTQV2mlodURv1SB+kqCnnlJpYr7ZTO0TdaqkbwtBj DdPpuMvVhIk/qaUgfXrEhCH3zXKJ2BVykiQfhdyqZ2WaEPRxDlE8IYSrENXalX4aZ2pd gXc9KqHFEyPmLC8Pc6O78xJ5YRtcGktlmk1fnKaLD7eD9vSebSlW0xMksztH1QDOvIK2 4y+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t13si10724067pgh.159.2019.03.13.15.12.35; Wed, 13 Mar 2019 15:12:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbfCMWMQ (ORCPT + 99 others); Wed, 13 Mar 2019 18:12:16 -0400 Received: from mga04.intel.com ([192.55.52.120]:52044 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726466AbfCMWMP (ORCPT ); Wed, 13 Mar 2019 18:12:15 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2019 15:12:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,475,1544515200"; d="scan'208";a="140547387" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by FMSMGA003.fm.intel.com with ESMTP; 13 Mar 2019 15:12:14 -0700 Date: Wed, 13 Mar 2019 16:12:58 -0600 From: Keith Busch To: "Elliott, Robert (Persistent Memory)" Cc: Arnd Bergmann , Jiri Kosina , Jens Axboe , Omar Sandoval , Hannes Reinecke , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] floppy: fix harmless clang build warning Message-ID: <20190313221257.GA15153@localhost.localdomain> References: <20190313211433.4178148-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 13, 2019 at 10:01:43PM +0000, Elliott, Robert (Persistent Memory) wrote: > > @@ -3899,7 +3899,7 @@ static void __init config_types(void) > > if (!UDP->cmos) > > UDP->cmos = FLOPPY0_TYPE; > > drive = 1; > > - if (!UDP->cmos && FLOPPY1_TYPE) > > + if (!UDP->cmos) > > UDP->cmos = FLOPPY1_TYPE; > > > > /* FIXME: additional physical CMOS drive detection should go here */ > > -- > > 2.20.0 > > On x86 it expands to a hardware read, so this would change the control flow. > > #define FLOPPY1_TYPE \ > ({ \ > unsigned long flags; \ > unsigned char val; \ > spin_lock_irqsave(&rtc_lock, flags); \ > val = CMOS_READ(0x10) & 15; \ > spin_unlock_irqrestore(&rtc_lock, flags); \ > val; \ > }) The end result is still the same, though. It just doesn't read the hardware twice when FLOPPY1_TYPE is non-zero.