Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6916844ybe; Wed, 18 Sep 2019 11:09:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZHpRo4ExmNIp5Kqo7A21L1NRi2zviARFCaQ8QBySG/R4DrSH00MS7xKt8/I6zBvkbiqI+ X-Received: by 2002:a17:906:eb86:: with SMTP id mh6mr9955742ejb.171.1568830172744; Wed, 18 Sep 2019 11:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568830172; cv=none; d=google.com; s=arc-20160816; b=FfZx1Fm6RRVy+ZGEgI0wk+GWQBrxbLTqUEvbIjUAdWAGKKn6RKRqUp3XASAVZ2E8IB 0A3tYlUrETWBugTus0koMyrMhqiEzfLp265+pzxL6OV8+CX558W+9bArOAamVVjbBwqo QMuIBF0mgvnRo0oPXcJCpk5MuNGvXxiS1g71Rky2n6kUkMpRA3916VrPbzcFuf2Vp11A tNxilgCzDBKJfS61QfEaAAeWyQ6w/bhx2QHSF4f2gC/XDGsu6HR0/QJD4pvuALMPseTR DD1PEPLREUeM4Jevoil2J0824KMfzizlaFzLbITpXX8ct4bMJQZCEiuoQpIQtqmstpj+ famg== 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=aMzVEfBLzTZRGLU6jMbXJDHaRlg4pzgyuiqx2AXqThU=; b=bKrQrcgNcUk9jIPJbEWGNjqOH1zCzSa2+dzrxk0EMm7AdgXJ/LuQaAaz79x6cAUcDe 7acV3qoC19nLON8NGkW/am4ljVatydpsDX32l0TXgPjr2kzU1IOiz311WCWdj57Pq5KY M408TgzEv95BnCG7wTp2YQsYgIoahZ3jHlAN7hzOhvJMElI56tTia+9pqS4kfdfUDD93 9H/bUeoXrkalb/0yrxnNwToFCJXRny5VT6kTsAijrVrjwK247BPJJzA+GA1maqXUbVOi YpvaueqDr8OTzbTQijvWGiMJ/twy+TJ8MBR9ttaVC4R69hKjCATzdcUgnRmhY41I/2N4 VY3A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3si3528247edr.20.2019.09.18.11.09.08; Wed, 18 Sep 2019 11:09:32 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730257AbfIRSBR (ORCPT + 99 others); Wed, 18 Sep 2019 14:01:17 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:59747 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726369AbfIRSBR (ORCPT ); Wed, 18 Sep 2019 14:01:17 -0400 Received: from localhost (lfbn-1-1545-137.w90-65.abo.wanadoo.fr [90.65.161.137]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 53E51240002; Wed, 18 Sep 2019 18:01:14 +0000 (UTC) Date: Wed, 18 Sep 2019 20:01:12 +0200 From: Alexandre Belloni To: Saiyam Doshi Cc: ludovic.desroches@microchip.com, ulf.hansson@linaro.org, nicolas.ferre@microchip.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mmc: host: atmel-mci: assign false/true to bool variable Message-ID: <20190918180112.GR21254@piout.net> References: <20190918172823.GA28786@SD> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190918172823.GA28786@SD> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On 18/09/2019 22:58:23+0530, Saiyam Doshi wrote: > Use false/true instead of 0/1 in bool variable assignment. > > This fixes below coccicheck warning. > "WARNING: Assignment of 0/1 to bool variable" > > Generated by: scripts/coccinelle/misc/boolinit.cocci > > More information about semantic patching is available at > http://coccinelle.lip6.fr/ > More useful than information than info on semantic patching, it would be good to have info on why you feel this is necessary. > Signed-off-by: Saiyam Doshi > --- > drivers/mmc/host/atmel-mci.c | 50 ++++++++++++++++++------------------ > 1 file changed, 25 insertions(+), 25 deletions(-) > > diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c > index c26fbe5f2222..91088b1712ae 100644 > --- a/drivers/mmc/host/atmel-mci.c > +++ b/drivers/mmc/host/atmel-mci.c > @@ -706,7 +706,7 @@ static void atmci_timeout_timer(struct timer_list *t) > host->mrq->cmd->error = -ETIMEDOUT; > host->cmd = NULL; > } > - host->need_reset = 1; > + host->need_reset = true; > host->state = STATE_END_REQUEST; > smp_wmb(); > tasklet_schedule(&host->tasklet); > @@ -1610,7 +1610,7 @@ static void atmci_command_complete(struct atmel_mci *host, > else if (host->mrq->data && (host->mrq->data->blksz & 3)) { > if (host->caps.need_blksz_mul_4) { > cmd->error = -EINVAL; > - host->need_reset = 1; > + host->need_reset = true; > } > } else > cmd->error = 0; > @@ -2396,45 +2396,45 @@ static void atmci_get_cap(struct atmel_mci *host) > dev_info(&host->pdev->dev, > "version: 0x%x\n", version); > > - host->caps.has_dma_conf_reg = 0; > - host->caps.has_pdc = 1; > - host->caps.has_cfg_reg = 0; > - host->caps.has_cstor_reg = 0; > - host->caps.has_highspeed = 0; > - host->caps.has_rwproof = 0; > - host->caps.has_odd_clk_div = 0; > - host->caps.has_bad_data_ordering = 1; > - host->caps.need_reset_after_xfer = 1; > - host->caps.need_blksz_mul_4 = 1; > - host->caps.need_notbusy_for_read_ops = 0; > + host->caps.has_dma_conf_reg = false; > + host->caps.has_pdc = true; > + host->caps.has_cfg_reg = false; > + host->caps.has_cstor_reg = false; > + host->caps.has_highspeed = false; > + host->caps.has_rwproof = false; > + host->caps.has_odd_clk_div = false; > + host->caps.has_bad_data_ordering = true; > + host->caps.need_reset_after_xfer = true; > + host->caps.need_blksz_mul_4 = true; > + host->caps.need_notbusy_for_read_ops = false; > > /* keep only major version number */ > switch (version & 0xf00) { > case 0x600: > case 0x500: > - host->caps.has_odd_clk_div = 1; > + host->caps.has_odd_clk_div = true; > /* Fall through */ > case 0x400: > case 0x300: > - host->caps.has_dma_conf_reg = 1; > - host->caps.has_pdc = 0; > - host->caps.has_cfg_reg = 1; > - host->caps.has_cstor_reg = 1; > - host->caps.has_highspeed = 1; > + host->caps.has_dma_conf_reg = true; > + host->caps.has_pdc = false; > + host->caps.has_cfg_reg = true; > + host->caps.has_cstor_reg = true; > + host->caps.has_highspeed = true; > /* Fall through */ > case 0x200: > - host->caps.has_rwproof = 1; > - host->caps.need_blksz_mul_4 = 0; > - host->caps.need_notbusy_for_read_ops = 1; > + host->caps.has_rwproof = true; > + host->caps.need_blksz_mul_4 = false; > + host->caps.need_notbusy_for_read_ops = true; > /* Fall through */ > case 0x100: > - host->caps.has_bad_data_ordering = 0; > - host->caps.need_reset_after_xfer = 0; > + host->caps.has_bad_data_ordering = false; > + host->caps.need_reset_after_xfer = false; > /* Fall through */ > case 0x0: > break; > default: > - host->caps.has_pdc = 0; > + host->caps.has_pdc = false; > dev_warn(&host->pdev->dev, > "Unmanaged mci version, set minimum capabilities\n"); > break; > -- > 2.20.1 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com