All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Ramon Fried <ramon.fried@gmail.com>
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
Date: Mon, 11 Jun 2018 17:24:46 -0700	[thread overview]
Message-ID: <20180612002446.GL14924@minitux> (raw)
In-Reply-To: <20180611220835.11129-1-ramon.fried@gmail.com>

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 <ramon.fried@gmail.com>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

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 <linux/soc/qcom/smem.h>
>  
>  /*
> - * 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
> 

      reply	other threads:[~2018-06-12  0:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11 22:08 [PATCH] soc: qcom: smem: fix checkpatch warnings Ramon Fried
2018-06-12  0:24 ` Bjorn Andersson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180612002446.GL14924@minitux \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=ramon.fried@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.