Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp12579pxu; Tue, 1 Dec 2020 05:07:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhCAQmTXZ88zoO+0KS0MVHwst3NGdaiJoqHWrGNxBapHi7O0uedTb15XJLrIcdzAl4gYWd X-Received: by 2002:a05:6402:2208:: with SMTP id cq8mr2954829edb.182.1606828042410; Tue, 01 Dec 2020 05:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606828042; cv=none; d=google.com; s=arc-20160816; b=TKmkcxa3eniRskf/5jG4KKikjoslPzQ4XJ6J7KsVtLrGuy9ZOcrK6p568oUoWQFOpE HFXP/klamtK83+U4QrBtg8l9G1sk9FqbmAlKz3ewokkqCYSq2E62lrG4UXAbUvu6SXDm b4Lr22Iq3iZ7hZ0Ldxleao9w27Db0q2yl2LY6ALHA19YI2FT6bH2jj4e4c7NRGqR6Z3a xKtmt7LgAvEVCezThbVzA+9DIhRGnVG8Zu0VwwwcsljQovv2wFb7hQfek0xXmeu3Mx/h THc6eAPMS0Y/nsvoxnbrx8fAMuyQCm3Iqj3MvivquWQuCNm1iREzd4JA7V1yrAc/5BMe HF2A== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=RILYm7BNO3o8CNhokoZLikg0NEpVdM5gIHqZVFff75Q=; b=Yoa621twNc2BcCybFwE+YtNpKza3JOD9qAUwCcI3hpQx9NVVfATzkDZ3Je6a5L3GR/ kRA40qQJEYRnQmxRebiNFx5U5zhMSngQb2Ud5FpN03TKGf5xCc8cs0tjoA0+9jtVzbdO wS85HPMkkut5CtdDZpm+6xahgq1NaHYGQCYUbl1Ik8dmZh12vad9/N7s/s3wDr+MtRu5 ZG39iZKr9mOAH8nG2G+QK4k24HWspKRk69ly9DWIAVH3IC8ZWAmGDf20HADwAIkweBA9 2KqEGLAC+2AXY2IQF04+Ar5etDqCvGVrx9eBfpC2lV5/Q8BJFx9jiMSVtd0RcLJSAFXI XrJA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si988778edh.221.2020.12.01.05.06.56; Tue, 01 Dec 2020 05:07:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730941AbgLANAz (ORCPT + 99 others); Tue, 1 Dec 2020 08:00:55 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:44966 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730781AbgLANAy (ORCPT ); Tue, 1 Dec 2020 08:00:54 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 1AAAAFB06; Tue, 1 Dec 2020 14:00:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jBBmTbO464kn; Tue, 1 Dec 2020 14:00:12 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 220794068E; Tue, 1 Dec 2020 14:00:12 +0100 (CET) Date: Tue, 1 Dec 2020 14:00:12 +0100 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Andy Shevchenko Cc: Heikki Krogerus , Greg Kroah-Hartman , USB , Linux Kernel Mailing List Subject: Re: [PATCH v3 2/2] usb: typec: tps6598x: Export some power supply properties Message-ID: <20201201130012.GA303449@bogon.m.sigxcpu.org> References: <91c27b323786445f6b33c6a7e89e93755d05e3a2.1606481420.git.agx@sigxcpu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Nov 30, 2020 at 08:35:26PM +0200, Andy Shevchenko wrote: > On Fri, Nov 27, 2020 at 2:57 PM Guido G?nther 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 = 0; > > + } else { > > + val->intval = 1; > > + } > > Can we please use positive conditionals (which usually are easier to > read)? Make sense. Fixed in v4. -- Guido > > if ((pwr_status & TPS_POWER_STATUS_CONNECTION) && > (pwr_status & TPS_POWER_STATUS_SOURCESINK)) { > val->intval = 1; > } else { > val->intval = 0; > } > > -- > With Best Regards, > Andy Shevchenko >