From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hsu Subject: Re: [PATCH] ASoC: nau8825: jack connection decision with different insertion logic Date: Mon, 4 Jul 2016 10:43:06 +0800 Message-ID: <5779CD3A.4020909@nuvoton.com> References: <1467170438-5157-1-git-send-email-KCHSU0@nuvoton.com> <5774CF97.4010203@nuvoton.com> <20160701155734.GV6247@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from maillog.nuvoton.com (maillog.nuvoton.com [202.39.227.15]) by alsa0.perex.cz (Postfix) with ESMTP id 26F41265876 for ; Mon, 4 Jul 2016 04:43:12 +0200 (CEST) In-Reply-To: <20160701155734.GV6247@sirena.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: AP MS30 Linux ALSA , Anatol Pomozov , Ben Zhang , Liam Girdwood , AC30 YHChuang , AC30 CTLin0 , Yong Zhi , MS40 MHKuo List-Id: alsa-devel@alsa-project.org On 7/1/2016 11:57 PM, Mark Brown wrote: > On Thu, Jun 30, 2016 at 03:51:51PM +0800, John Hsu wrote: > > >> Yes, it'll be more readable. I have a question. Why to add !! in >> front of bit wise operation? What does it mean? >> > > It's redundant in almost all cases. It translates an integer value > into a 0/1 value (so if you've got a value of 2 it'll end up as 1) by > doing a double not. This very rarely matters unless you're storing the > value in an integer and comparing it to 1 to check for truth, otherwise > C will translate any non-zero value into true in any logic context. > Thank you for the explanation. I get the purpose now and will change the expression of function for clear intent.