Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3807700pxu; Mon, 30 Nov 2020 10:38:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3xiGVQS9phwjNIr7XO8ZoF3xlcEkSGDWw43ioMysRTfV74PPYwlAmT48MnAPmGYRYNrpo X-Received: by 2002:a17:906:12cf:: with SMTP id l15mr14490027ejb.540.1606761480869; Mon, 30 Nov 2020 10:38:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606761480; cv=none; d=google.com; s=arc-20160816; b=XqhePKiS9lSLovohVRaxFvYKV77pInuulGlQmBJdNCazE6LzcPzwkg4muAaQ6lFB1L 7BBIQzrFRgf5y9LjGTZwpiNzvCbvHM96hSQsMMBFpMJqytPvRQJXxXui/VJNIY8N98mj HMbF2EDUQ7A4E+CN/1ME3RQIMlATf+g/8/nTLsvHK0/BPRnodWUEkKhmqjbgOB0YrFJ6 TM0VOypIGEC758lmQ2w9n0qs7i0tAEgLeJvRCQsQvL4NPTziFpWezkZCovkXYkzYv8mT Xy+Q5/G4YdsoaDrMJznySDdCX8x2+dhon9O2KflC6HbPqLttJ471ENw/VxRgoOf4n1fm gzNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=j2KSOF6GgSjfisRweLKXl6J6Qui7lp0yoyE8s99vP+4=; b=hyr14H9mZFn/fbhpaaVCO57aZqvAnVOJnoXy4MBIFK1oVEBKb6W8fnaLA3eeTavBUT Qf7CbDV2QvcNOn0zJmA9YRCDBFXIEAb52YHLeHtvXn6nmKTWVmT8nHYJTDFKdC2rrU8q nUDRHOzO52bE1lRSveUXjJhqhl1lfI8/f0Gu5WJvY3GCp6Efa3KH1ty540rgvIv3RJr7 q32m+bz2CKKibtmsSbwRXocJPAPwFFCT79bl/4CIgRHyYAM3QV7XjAnnFWcdG993f8QT PmdcXwmLeD8O0RCPok1OAnCGPlmiEqoQ64YtukVaK4W3JUDsrQcH/fe1mK1iZ7Uktud+ n7Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QFyiYDuG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id s24si11664938edw.151.2020.11.30.10.37.37; Mon, 30 Nov 2020 10:38:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QFyiYDuG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729743AbgK3SfZ (ORCPT + 99 others); Mon, 30 Nov 2020 13:35:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729735AbgK3SfY (ORCPT ); Mon, 30 Nov 2020 13:35:24 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7756BC0613D3; Mon, 30 Nov 2020 10:34:38 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id l23so114745pjg.1; Mon, 30 Nov 2020 10:34:38 -0800 (PST) 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:content-transfer-encoding; bh=j2KSOF6GgSjfisRweLKXl6J6Qui7lp0yoyE8s99vP+4=; b=QFyiYDuGLfs67t7fG78E+/0luvRO0T1XYzV/ZtG42Z5I01erPpF9V1rYbHtEC6RK/r l4eH9DQzIQPGvymQC2v2+WQ3EnlvaL1Dow+5vW8ns2AOCX3QpNih19JsbxUCyStchlhl 7LsHjaFUd+e9XXh/9H8yIwqwcLrN0WAt1y6Qw2uSxi0Dp44oUrJml5HSuTvifIcAVdKd +4azmGf5b4Hhd2ML0H/f8pyh5/pTBME7jjg/OIGwvTffc2eo13yXe5z/D/8rsAtjIeoW 5Hq9aOvXZT+3gotycaneY7FrX4itU3Drn1gbKlsb0cYm2erxZw0/gj7fqcV4Wxmezp+j ve8g== 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:content-transfer-encoding; bh=j2KSOF6GgSjfisRweLKXl6J6Qui7lp0yoyE8s99vP+4=; b=jDANirQRMax5BTnNOCvKZ+8C7HVSvJhd34u4IzEfGO8XdC2T9N9/jm4byZdRESJz3a qtdSxq6tZ+U1zYqYKSgrIwhCLUHfKgPMO4sEIj2pfHNZV0Kox1Lq+280kvIl7n6nqq5c q1BkNoWcXXgvzCBZOg1f59QfF33JdUXab0z5lqM3plxSnlZS7BA0F1xFrR06XtVMANYY ghWwTpdOJA9A0VX0y58aL8jTX0jofOyWZhphOSwjyJQCXB4OzDx9VxLv4QJw7rwoPLGc KTnD0Hy76yVz3i37GsNMP2ve8y1/Mze0OSOlWgp3y3dX3bm5yjWB1p8G9JUZXb9e6Qq9 BRAA== X-Gm-Message-State: AOAM530sBMHVXBdaADGlaNbLQCDH1Ti5ns6KkyPl5Zbx0i21QZ9qVaQs 0hGKs9BzoOwYrOQR04tHSSAe1Z4MKBeQ65NXDGODfTKEQTbQ5w== X-Received: by 2002:a17:90b:350:: with SMTP id fh16mr157207pjb.228.1606761278036; Mon, 30 Nov 2020 10:34:38 -0800 (PST) MIME-Version: 1.0 References: <91c27b323786445f6b33c6a7e89e93755d05e3a2.1606481420.git.agx@sigxcpu.org> In-Reply-To: <91c27b323786445f6b33c6a7e89e93755d05e3a2.1606481420.git.agx@sigxcpu.org> From: Andy Shevchenko Date: Mon, 30 Nov 2020 20:35:26 +0200 Message-ID: Subject: Re: [PATCH v3 2/2] usb: typec: tps6598x: Export some power supply properties To: =?UTF-8?Q?Guido_G=C3=BCnther?= Cc: Heikki Krogerus , Greg Kroah-Hartman , USB , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 27, 2020 at 2:57 PM Guido G=C3=BCnther wrote: > > This allows downstream supplies and userspace to detect > whether external power is supplied. > + if (!(pwr_status & TPS_POWER_STATUS_CONNECTION) || > + !(pwr_status & TPS_POWER_STATUS_SOURCESINK)) { > + val->intval =3D 0; > + } else { > + val->intval =3D 1; > + } Can we please use positive conditionals (which usually are easier to read)? if ((pwr_status & TPS_POWER_STATUS_CONNECTION) && (pwr_status & TPS_POWER_STATUS_SOURCESINK)) { val->intval =3D 1; } else { val->intval =3D 0; } --=20 With Best Regards, Andy Shevchenko