Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp92094ybl; Tue, 27 Aug 2019 16:26:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqYWTy8lkfCcun7kBXM6NooIjPMQ+D+vqTte+dj5lh8eKXs1T9JISV3UQdXqohofQcBN6x X-Received: by 2002:a17:90a:fa95:: with SMTP id cu21mr1264916pjb.43.1566948380372; Tue, 27 Aug 2019 16:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566948380; cv=none; d=google.com; s=arc-20160816; b=B7Am6Vb6kx181q0KCQozvjWx7RaoWl/Fs60tPCottimMBcfPhftce+7uc3eaK04SkU vsNQxZaTSXn2mUttIxURBSW5U5WeU7C+LNQ3pWje9gpx24AufJjYTOoF0Klxk2/r3MDE X+r/0qWtXyBFt53iYgPFwSyTzzlxV0LD1tw1ffCFCYhWZ7TZJf+TQhGhuZblEdinjPtA ZEGbGSzDPvoRZ7iXf+9NJQdDsWl4WHpGE78B5S2DtIjURCQ0dLKXwqn1WdhOR+Yu19Ze s2bBjjciaq75Mgeib9fC4xd7ZH5LB8fcrkeLOOguxuuLMqEiFuiHtrpNrM+uCdRPjAJW Y4GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AZp/zzBtS0EBiyMSUURJW6iNqR0pfIGhZlkgvULPVEo=; b=t58dzlYEFS8TKuWZcuHBwFtGgSoXGm7tek7FndcsOGeCKGfQ/4JJpBGD8lTZ8nkf4H Q74pEg81SG2nJfmgW34m0MkOMIbie99w43Un3eVMiz0WfVYAHb6A40NC4lc/RduDgGmb JbsIA2WdbMv7zDsbFtzrxwKBTAywfoVxW0t1D4GSsHyqq+HmnIPfTfXSumMk+YzvJPcC Q3oxRATUptHFSLgiplkG/EQFqdhYx0dKbeLUMwArdtrJxMWEQL58s+TrMoIDBRbTurZg 0/k4TLnykj0d/qaa/6AGDmKhkdM/0anUhd0eJ+yQulFzwr7x+Y9ce7KcvD+cwhHOmCWe 5HIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BFSqj6OU; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k72si661563pge.95.2019.08.27.16.26.05; Tue, 27 Aug 2019 16:26:20 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BFSqj6OU; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726394AbfH0XZE (ORCPT + 99 others); Tue, 27 Aug 2019 19:25:04 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:37875 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbfH0XZD (ORCPT ); Tue, 27 Aug 2019 19:25:03 -0400 Received: by mail-io1-f66.google.com with SMTP id q12so1487372iog.4; Tue, 27 Aug 2019 16:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AZp/zzBtS0EBiyMSUURJW6iNqR0pfIGhZlkgvULPVEo=; b=BFSqj6OUgdwftYzzYXGPwUNHC8vNVsa9r2ChznpC7RkSDp2KTGdC7fe9DguD1V+tVQ K8cBTkp5rHqDqGdxqDjclgASr4iyEILJq6x3Ke3xuU2apjbZ8fOLTtx5sl1GHS/8Syj9 pbjqo0PJE1BJaEOmruxYMsyErKfh0xuWO6kS/8smjDMKCiC1lQPC2Q44cBw5HBlau/3p 34bbDWG/ezWukZfefTBGNZ0qbiHF75LLsmHOiT/44ZTZ/aVNHXUAYlrmhThjmq98uqJo Y/gEb7LzkZ9gOLIDhtDLPjAGApXtQrYV+df0XvyjjDp3Sj/jZUKO6RbpORLBDdMICg9d lkxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AZp/zzBtS0EBiyMSUURJW6iNqR0pfIGhZlkgvULPVEo=; b=o8Kg8cGM9SEyCDkNeNPhjf0dmXUrbFlCxvdCtUvdEoxdvBiJ+ypadx4bCvojbhjeYh CNuJS2dhQoUCBgp4xs0ptu7JiWb9bHhZ2em7tqNW7c9c/LIZIyzsosG7yu93AL51bMmy OLqhk69ThwbtQ5O2M/ULL/EwmkJnae5opPoLvEP55MUEIMxIUwjcxH/SNbWvs1jizO68 6EYuhmRVH9WxwFwsrfV2L9+cnGeqLCkxu0RC2cUNz6kuLesUypThW2Xb853XkLbA9Qax pcZly/+Oqm8GnC5gUcgU1rmEAGMwo/gPpqHDQGeFWfaBDzWdvGhwBw1lq96TxDrO/KnI Iy9A== X-Gm-Message-State: APjAAAXE0f/0lw7ywwLtwyusQ64Rdqj0s8fNu4sPWmdLgetA5vCE87wk Z/i7edZFIwCb/PeI6tjwTpqZK0EMTUX1wu++BVA= X-Received: by 2002:a5d:9b02:: with SMTP id y2mr1072981ion.146.1566948302443; Tue, 27 Aug 2019 16:25:02 -0700 (PDT) MIME-Version: 1.0 References: <20190819160643.27998-1-efremov@linux.com> <20190819160643.27998-2-efremov@linux.com> <9cbb34b0-d6be-fbba-9992-9b6939018e5d@linux.com> In-Reply-To: <9cbb34b0-d6be-fbba-9992-9b6939018e5d@linux.com> From: "Oliver O'Halloran" Date: Wed, 28 Aug 2019 09:24:51 +1000 Message-ID: Subject: Re: [PATCH v3 1/4] PCI: pciehp: Add pciehp_set_indicators() to jointly set LED indicators To: efremov@linux.com Cc: sathyanarayanan kuppuswamy , Bjorn Helgaas , Lukas Wunner , linux-pci@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 20, 2019 at 2:17 AM Denis Efremov wrote: > > Hi, > > On 8/19/19 7:06 PM, Denis Efremov wrote: > On 8/12/19 11:25 AM, sathyanarayanan kuppuswamy wrote: > > Do we need to switch case here ? if (pwr > 0) {} should work right ? > > I saved the switch here from v2. I think switch makes the inputs check more > precise and filters-out all non-valid values. Maybe this check is too strict? Sounds like you're overthinking it tbh. If want to catch programming errors then a WARN_ON_ONCE() in the default case would be better than silently ignoring invalid values, but it's pretty hard to care. > We could use mask here ON|OFF|BLINK for the check, but I don't know how hardware > will handle a case, for example, pwr == ON|BLINK. ON|BLINK is the same as OFF