Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4687502imm; Mon, 11 Jun 2018 17:25:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLJ9AVW7fknY/42f2am7MyES1i9kYkqkLuNNcJOoeojgqescT7f7zn7JVJYVExtKjCTjOqc X-Received: by 2002:a17:902:b582:: with SMTP id a2-v6mr1393346pls.335.1528763151339; Mon, 11 Jun 2018 17:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528763151; cv=none; d=google.com; s=arc-20160816; b=uewn2ZO+h56dYIFk0EsicqgklI4oZq4LxI3vbq2drwowl6bKLP7hvGySFUNYZFhwXo k3Zr0R0ZViniTldnwJ6CO3799asCm7ZtpBGyQfIY9xUHa5ZeZNb7OtTmZcLQtUKRxyl8 Z/PPxp0n39cBR+4gdQxp0lfgo0uDPDGxeBy7yjUsZ5USVb9qiAFqJt8bW1fs32emWXun Om5TNC10fe2ogWj8oxNVQD+clK/zlTyu/26dnNwQOPMKXfLfCjWXpPExktZwS1QSSD5k NoKn+QJt+q5asb9gCbSgVHjDENLl9XNm7lYopmNw86vct+/rbadiFUPUYq0Hq8yMvgLf lETQ== 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:dkim-signature:arc-authentication-results; bh=ISQzOmoVgCrBYMXYklvRZPzPHIXGQRpBlkn9pl4p0D0=; b=ESaeQ75wH0xsQ/L58lKJfQIV0BmH5zVUhck/6YB3/lgy7vAQjcFJW3DyZT2jyG8d9P E0U1iYqQ4vm/3/gcN3FV4zGG1btYaHGdgH899TBK1FtqA3puJgicbn4Ov3x0gE3Gx+cb 0PtCaSPOBVMM8Kaf1Tp5B4mNKAXPdVTd6hcnutwokF1FD/vH9X0Dox7XfCxTK3Vq8a5e yiBNw6Ki7Sv0YdZasNie3As/KPiDdCgV+H0/Yx1llbMeHa0MAK0y4xaAECD0S9xCQb2d 4vu+fb8OHdn/XsGoWCUzLtNJ8ThMO4vZEAGTmxIBDKH+lZiC0lf6IPY/VDAdRnI1ruvC dzGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q4MlTfRP; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2-v6si14949499pgp.347.2018.06.11.17.25.36; Mon, 11 Jun 2018 17:25:51 -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=@linaro.org header.s=google header.b=Q4MlTfRP; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934726AbeFLAYw (ORCPT + 99 others); Mon, 11 Jun 2018 20:24:52 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:33492 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934597AbeFLAYu (ORCPT ); Mon, 11 Jun 2018 20:24:50 -0400 Received: by mail-pl0-f65.google.com with SMTP id n10-v6so13283765plp.0 for ; Mon, 11 Jun 2018 17:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ISQzOmoVgCrBYMXYklvRZPzPHIXGQRpBlkn9pl4p0D0=; b=Q4MlTfRPbUP3/+FA2OZZhjXIpjAu4zkYKjFAY8n/xxCjXZ+5FRXCbDnJoIodTWSzdj XnbJepk25sesbvWFgHP1meTS2OCkA46aO/Pp0aP88xe1zfMREj1qcLUM6CIJhzANk+j1 p56CEdXwLkV8GnCwyWMtLzNID5ns+5vJBhQhk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ISQzOmoVgCrBYMXYklvRZPzPHIXGQRpBlkn9pl4p0D0=; b=ngDedCS4r2TYT7XQPGkBnhMMBnV2TVy28AyYnAgfLCPK6flx9UKdfiPfLPEUy0yUSJ f6GUvdxlrSfdBarjaU+dhBvd5drYdB+vettJ+e4b9oumGU6SAM1JqSDP59iAxU1tBBJn UyEm7YpAAfaDzI4EBrBfDWkmn6aaMkDZlkKX3XVlnQq9An+wBdKt5gfyF27A/oQY+eeV DEmCIRpgWc3iGDum5oEK1SFkzqbpHrg9kGuW54FWaWgCvoz/aQZRTT2PBeo4IG9x71+C 13QBn42YuRFBbA3ujY/V1yqqsONj10UWw3rnbxaEUQfCqw/+MC3ZX5zYVeZNxM3v1/Bm d0xw== X-Gm-Message-State: APt69E2QncZDQt0TAHcAga6aJge7LzCl65MReHq89N9b1hjSDy5ovV8I i/u5qhWf6U+hhG8EZAn8upLHyA== X-Received: by 2002:a17:902:1002:: with SMTP id b2-v6mr1414166pla.344.1528763089530; Mon, 11 Jun 2018 17:24:49 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id b74-v6sm95368888pfl.138.2018.06.11.17.24.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jun 2018 17:24:48 -0700 (PDT) Date: Mon, 11 Jun 2018 17:24:46 -0700 From: Bjorn Andersson To: Ramon Fried Cc: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] soc: qcom: smem: fix checkpatch warnings Message-ID: <20180612002446.GL14924@minitux> References: <20180611220835.11129-1-ramon.fried@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180611220835.11129-1-ramon.fried@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 11 Jun 15:08 PDT 2018, Ramon Fried wrote: > * Fixed checkpatch.sh warnings in smem.c & smem.h: > - WARNING: Prefer 'unsigned int' to bare use of 'unsigned'. > - WARNING: Block comments should align the * on each line. > - WARNING: line over 80 characters. > - ERROR: do not use assignment in if condition. > > * Fixed grammar in comment. > > Signed-off-by: Ramon Fried Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/soc/qcom/smem.c | 41 +++++++++++++++++++---------------- > include/linux/soc/qcom/smem.h | 6 ++--- > 2 files changed, 25 insertions(+), 22 deletions(-) > > diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c > index 0b94d62fad2b..e5ef6611ed73 100644 > --- a/drivers/soc/qcom/smem.c > +++ b/drivers/soc/qcom/smem.c > @@ -22,7 +22,7 @@ > #include > > /* > - * The Qualcomm shared memory system is a allocate only heap structure that > + * The Qualcomm shared memory system is an allocate only heap structure that > * consists of one of more memory areas that can be accessed by the processors > * in the SoC. > * > @@ -94,11 +94,11 @@ > #define SMEM_HOST_COUNT 10 > > /** > - * struct smem_proc_comm - proc_comm communication struct (legacy) > - * @command: current command to be executed > - * @status: status of the currently requested command > - * @params: parameters to the command > - */ > + * struct smem_proc_comm - proc_comm communication struct (legacy) > + * @command: current command to be executed > + * @status: status of the currently requested command > + * @params: parameters to the command > + */ > struct smem_proc_comm { > __le32 command; > __le32 status; > @@ -276,7 +276,7 @@ struct qcom_smem { > size_t cacheline[SMEM_HOST_COUNT]; > u32 item_count; > > - unsigned num_regions; > + unsigned int num_regions; > struct smem_region regions[0]; > }; > > @@ -350,7 +350,7 @@ static struct qcom_smem *__smem; > > static int qcom_smem_alloc_private(struct qcom_smem *smem, > struct smem_partition_header *phdr, > - unsigned item, > + unsigned int item, > size_t size) > { > struct smem_private_entry *hdr, *end; > @@ -400,7 +400,7 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem, > } > > static int qcom_smem_alloc_global(struct qcom_smem *smem, > - unsigned item, > + unsigned int item, > size_t size) > { > struct smem_global_entry *entry; > @@ -441,7 +441,7 @@ static int qcom_smem_alloc_global(struct qcom_smem *smem, > * Allocate space for a given smem item of size @size, given that the item is > * not yet allocated. > */ > -int qcom_smem_alloc(unsigned host, unsigned item, size_t size) > +int qcom_smem_alloc(unsigned int host, unsigned int item, size_t size) > { > struct smem_partition_header *phdr; > unsigned long flags; > @@ -482,14 +482,14 @@ int qcom_smem_alloc(unsigned host, unsigned item, size_t size) > EXPORT_SYMBOL(qcom_smem_alloc); > > static void *qcom_smem_get_global(struct qcom_smem *smem, > - unsigned item, > + unsigned int item, > size_t *size) > { > struct smem_header *header; > struct smem_region *area; > struct smem_global_entry *entry; > u32 aux_base; > - unsigned i; > + unsigned int i; > > header = smem->regions[0].virt_base; > entry = &header->toc[item]; > @@ -514,7 +514,7 @@ static void *qcom_smem_get_global(struct qcom_smem *smem, > static void *qcom_smem_get_private(struct qcom_smem *smem, > struct smem_partition_header *phdr, > size_t cacheline, > - unsigned item, > + unsigned int item, > size_t *size) > { > struct smem_private_entry *e, *end; > @@ -575,7 +575,7 @@ static void *qcom_smem_get_private(struct qcom_smem *smem, > * Looks up smem item and returns pointer to it. Size of smem > * item is returned in @size. > */ > -void *qcom_smem_get(unsigned host, unsigned item, size_t *size) > +void *qcom_smem_get(unsigned int host, unsigned int item, size_t *size) > { > struct smem_partition_header *phdr; > unsigned long flags; > @@ -621,11 +621,11 @@ EXPORT_SYMBOL(qcom_smem_get); > * To be used by smem clients as a quick way to determine if any new > * allocations has been made. > */ > -int qcom_smem_get_free_space(unsigned host) > +int qcom_smem_get_free_space(unsigned int host) > { > struct smem_partition_header *phdr; > struct smem_header *header; > - unsigned ret; > + unsigned int ret; > > if (!__smem) > return -EPROBE_DEFER; > @@ -902,9 +902,12 @@ static int qcom_smem_probe(struct platform_device *pdev) > if (ret) > return ret; > > - if (num_regions > 1 && (ret = qcom_smem_map_memory(smem, &pdev->dev, > - "qcom,rpm-msg-ram", 1))) > - return ret; > + if (num_regions > 1) { > + ret = qcom_smem_map_memory(smem, &pdev->dev, > + "qcom,rpm-msg-ram", 1); > + if (ret) > + return ret; > + } > > header = smem->regions[0].virt_base; > if (le32_to_cpu(header->initialized) != 1 || > diff --git a/include/linux/soc/qcom/smem.h b/include/linux/soc/qcom/smem.h > index c1657ed27b30..d0e8783bccff 100644 > --- a/include/linux/soc/qcom/smem.h > +++ b/include/linux/soc/qcom/smem.h > @@ -4,9 +4,9 @@ > > #define QCOM_SMEM_HOST_ANY -1 > > -int qcom_smem_alloc(unsigned host, unsigned item, size_t size); > -void *qcom_smem_get(unsigned host, unsigned item, size_t *size); > +int qcom_smem_alloc(unsigned int host, unsigned int item, size_t size); > +void *qcom_smem_get(unsigned int host, unsigned int item, size_t *size); > > -int qcom_smem_get_free_space(unsigned host); > +int qcom_smem_get_free_space(unsigned int host); > > #endif > -- > 2.17.1 >