From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B873C433E0 for ; Wed, 27 Jan 2021 09:58:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9869A2076D for ; Wed, 27 Jan 2021 09:58:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9869A2076D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oPPf7eZgTfUBpF8Qdt+O7+natOsN9YNBVQ6WeZ7K/fs=; b=kY+UhF38s0n9a57uTo0gbHkXy uBV881Lz+pFgcl2NhAAxdHcciUO8acWeAiJZPnJTzV2X1G3DjBoQoEg1oqpGa1huIJ7B4+8isFO02 q1PWP2GHGEUzDg0NXaeBNOxLxNSNIDvpjQ0Z+wwJvFfyLkjHtPTQQPQygI30j+HzJhBps+dnI7/8E fUlEtOPb4zV1yPp5qvz9RVmeikv8JkW45nC3NLCWkENu9hXcYnkSP5ppsZ7Gb+0z0hvdN1IvStrI7 J2jOHtSHigihWtu6tKYsS3YJns+TQwluyM6XGoBvaE9FqezcarcNf9EP4pNfC1exRRtnnF3zWA2ob eg4JehYag==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4hZg-0004Qg-Kb; Wed, 27 Jan 2021 09:57:20 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4hZd-0004Q6-MU for linux-arm-kernel@lists.infradead.org; Wed, 27 Jan 2021 09:57:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1611741438; x=1643277438; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=LqoaiBt2oEgRB1eUsLEn3PuWQU6NTrIIwJA/1kAe2TU=; b=xZxRmrETs9WweItwf98xesQcL8tV4Xkvy3leK2xnm9HlTU2ZLS9tuROw ysdVKY2HlG227kXnOx2TDlUAE2GgzIDr0y4rjUSS9GMPhdW7g4Vznz8Gm Z8nRTDaTW3n7b1nqq9fUFNKMTreAR4S9Recrs7xcrXKc7J8TK8AT5mx4N yzkndOIeRsWOLyEi8+Lwhz0ZGq1Qv1slvs2RsqjuMGb3+fSsizTvP8wP/ gyM2bSangphEMFMEERUhIWXfp+thP1UKJOZb3Wu1gGYRSdZLnBkAVc2yD abBJyNH0GJe9lwhUwvhsGM9ZDfm8tEyqn+zrQq3ym4uXKf8ml+XcsQMQl w==; IronPort-SDR: +TJgHSOR6JCKgYTjsuwc0WzsRs1A0W0l5/FQNapNDbSQQFCa/FsZE7RHzWG245rqi5W0Acg9WZ k8LEPCa/eGMAxLBii3UsiGfnzVdusWBCITkGYwJr9SQTB90ii9CZAVZO47T9C9RJGjQXPDMaBX 9lnk9n0sfq7EcRsSrA1+NxIqv0enzrMAyYJg/0NX4HD7SdOpurAUUHtZtJzdpu+1drxrS8y2kP Q/bhbkY6fBggvc/d1ngbdemVqXXgoqN1qwU//Kp8j2N5lxym4B3uUk+wae11mEeJE6Q40H+6z1 x10= X-IronPort-AV: E=Sophos;i="5.79,378,1602572400"; d="scan'208";a="106953025" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jan 2021 02:57:16 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 27 Jan 2021 02:57:16 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 27 Jan 2021 02:57:15 -0700 Date: Wed, 27 Jan 2021 10:57:14 +0100 From: Ludovic Desroches To: Claudiu Beznea Subject: Re: [PATCH 3/3] pinctrl: at91-pio4: fix "Prefer 'unsigned int' to bare use of 'unsigned'" Message-ID: <20210127095714.ufcmewk76fuzfj4d@sekiro> References: <1611569954-23279-1-git-send-email-claudiu.beznea@microchip.com> <1611569954-23279-4-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1611569954-23279-4-git-send-email-claudiu.beznea@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210127_045717_999976_CBF8107E X-CRM114-Status: GOOD ( 23.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alexandre.belloni@bootlin.com, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 25, 2021 at 12:19:14PM +0200, Claudiu Beznea wrote: > Fix "Prefer 'unsigned int' to bare use of 'unsigned'" checkpatch.pl > warning. > > Signed-off-by: Claudiu Beznea Acked-by: Ludovic Desroches Thanks > --- > drivers/pinctrl/pinctrl-at91-pio4.c | 110 +++++++++++++++++++----------------- > 1 file changed, 57 insertions(+), 53 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c > index c59ab0bfb945..0206cbfcbebb 100644 > --- a/drivers/pinctrl/pinctrl-at91-pio4.c > +++ b/drivers/pinctrl/pinctrl-at91-pio4.c > @@ -80,8 +80,8 @@ > * @sr: slew rate support > */ > struct atmel_pioctrl_data { > - unsigned nbanks; > - unsigned last_bank_count; > + unsigned int nbanks; > + unsigned int last_bank_count; > unsigned int sr; > }; > > @@ -91,11 +91,11 @@ struct atmel_group { > }; > > struct atmel_pin { > - unsigned pin_id; > - unsigned mux; > - unsigned ioset; > - unsigned bank; > - unsigned line; > + unsigned int pin_id; > + unsigned int mux; > + unsigned int ioset; > + unsigned int bank; > + unsigned int line; > const char *device; > }; > > @@ -125,16 +125,16 @@ struct atmel_pin { > struct atmel_pioctrl { > void __iomem *reg_base; > struct clk *clk; > - unsigned nbanks; > + unsigned int nbanks; > struct pinctrl_dev *pinctrl_dev; > struct atmel_group *groups; > const char * const *group_names; > struct atmel_pin **pins; > - unsigned npins; > + unsigned int npins; > struct gpio_chip *gpio_chip; > struct irq_domain *irq_domain; > int *irqs; > - unsigned *pm_wakeup_sources; > + unsigned int *pm_wakeup_sources; > struct { > u32 imr; > u32 odsr; > @@ -177,11 +177,11 @@ static void atmel_gpio_irq_ack(struct irq_data *d) > */ > } > > -static int atmel_gpio_irq_set_type(struct irq_data *d, unsigned type) > +static int atmel_gpio_irq_set_type(struct irq_data *d, unsigned int type) > { > struct atmel_pioctrl *atmel_pioctrl = irq_data_get_irq_chip_data(d); > struct atmel_pin *pin = atmel_pioctrl->pins[d->hwirq]; > - unsigned reg; > + unsigned int reg; > > atmel_gpio_write(atmel_pioctrl, pin->bank, ATMEL_PIO_MSKR, > BIT(pin->line)); > @@ -268,7 +268,7 @@ static struct irq_chip atmel_gpio_irq_chip = { > .irq_set_wake = atmel_gpio_irq_set_wake, > }; > > -static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset) > +static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) > { > struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); > > @@ -316,11 +316,12 @@ static void atmel_gpio_irq_handler(struct irq_desc *desc) > chained_irq_exit(chip, desc); > } > > -static int atmel_gpio_direction_input(struct gpio_chip *chip, unsigned offset) > +static int atmel_gpio_direction_input(struct gpio_chip *chip, > + unsigned int offset) > { > struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); > struct atmel_pin *pin = atmel_pioctrl->pins[offset]; > - unsigned reg; > + unsigned int reg; > > atmel_gpio_write(atmel_pioctrl, pin->bank, ATMEL_PIO_MSKR, > BIT(pin->line)); > @@ -331,11 +332,11 @@ static int atmel_gpio_direction_input(struct gpio_chip *chip, unsigned offset) > return 0; > } > > -static int atmel_gpio_get(struct gpio_chip *chip, unsigned offset) > +static int atmel_gpio_get(struct gpio_chip *chip, unsigned int offset) > { > struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); > struct atmel_pin *pin = atmel_pioctrl->pins[offset]; > - unsigned reg; > + unsigned int reg; > > reg = atmel_gpio_read(atmel_pioctrl, pin->bank, ATMEL_PIO_PDSR); > > @@ -369,12 +370,13 @@ static int atmel_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask, > return 0; > } > > -static int atmel_gpio_direction_output(struct gpio_chip *chip, unsigned offset, > +static int atmel_gpio_direction_output(struct gpio_chip *chip, > + unsigned int offset, > int value) > { > struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); > struct atmel_pin *pin = atmel_pioctrl->pins[offset]; > - unsigned reg; > + unsigned int reg; > > atmel_gpio_write(atmel_pioctrl, pin->bank, > value ? ATMEL_PIO_SODR : ATMEL_PIO_CODR, > @@ -389,7 +391,7 @@ static int atmel_gpio_direction_output(struct gpio_chip *chip, unsigned offset, > return 0; > } > > -static void atmel_gpio_set(struct gpio_chip *chip, unsigned offset, int val) > +static void atmel_gpio_set(struct gpio_chip *chip, unsigned int offset, int val) > { > struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); > struct atmel_pin *pin = atmel_pioctrl->pins[offset]; > @@ -445,11 +447,11 @@ static struct gpio_chip atmel_gpio_chip = { > > /* --- PINCTRL --- */ > static unsigned int atmel_pin_config_read(struct pinctrl_dev *pctldev, > - unsigned pin_id) > + unsigned int pin_id) > { > struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); > - unsigned bank = atmel_pioctrl->pins[pin_id]->bank; > - unsigned line = atmel_pioctrl->pins[pin_id]->line; > + unsigned int bank = atmel_pioctrl->pins[pin_id]->bank; > + unsigned int line = atmel_pioctrl->pins[pin_id]->line; > void __iomem *addr = atmel_pioctrl->reg_base > + bank * ATMEL_PIO_BANK_OFFSET; > > @@ -461,11 +463,11 @@ static unsigned int atmel_pin_config_read(struct pinctrl_dev *pctldev, > } > > static void atmel_pin_config_write(struct pinctrl_dev *pctldev, > - unsigned pin_id, u32 conf) > + unsigned int pin_id, u32 conf) > { > struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); > - unsigned bank = atmel_pioctrl->pins[pin_id]->bank; > - unsigned line = atmel_pioctrl->pins[pin_id]->line; > + unsigned int bank = atmel_pioctrl->pins[pin_id]->bank; > + unsigned int line = atmel_pioctrl->pins[pin_id]->line; > void __iomem *addr = atmel_pioctrl->reg_base > + bank * ATMEL_PIO_BANK_OFFSET; > > @@ -483,7 +485,7 @@ static int atmel_pctl_get_groups_count(struct pinctrl_dev *pctldev) > } > > static const char *atmel_pctl_get_group_name(struct pinctrl_dev *pctldev, > - unsigned selector) > + unsigned int selector) > { > struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); > > @@ -491,19 +493,20 @@ static const char *atmel_pctl_get_group_name(struct pinctrl_dev *pctldev, > } > > static int atmel_pctl_get_group_pins(struct pinctrl_dev *pctldev, > - unsigned selector, const unsigned **pins, > - unsigned *num_pins) > + unsigned int selector, > + const unsigned int **pins, > + unsigned int *num_pins) > { > struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); > > - *pins = (unsigned *)&atmel_pioctrl->groups[selector].pin; > + *pins = (unsigned int *)&atmel_pioctrl->groups[selector].pin; > *num_pins = 1; > > return 0; > } > > static struct atmel_group * > -atmel_pctl_find_group_by_pin(struct pinctrl_dev *pctldev, unsigned pin) > +atmel_pctl_find_group_by_pin(struct pinctrl_dev *pctldev, unsigned int pin) > { > struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); > int i; > @@ -524,7 +527,7 @@ static int atmel_pctl_xlate_pinfunc(struct pinctrl_dev *pctldev, > const char **func_name) > { > struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); > - unsigned pin_id, func_id; > + unsigned int pin_id, func_id; > struct atmel_group *grp; > > pin_id = ATMEL_GET_PIN_NO(pinfunc); > @@ -554,10 +557,10 @@ static int atmel_pctl_xlate_pinfunc(struct pinctrl_dev *pctldev, > static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev, > struct device_node *np, > struct pinctrl_map **map, > - unsigned *reserved_maps, > - unsigned *num_maps) > + unsigned int *reserved_maps, > + unsigned int *num_maps) > { > - unsigned num_pins, num_configs, reserve; > + unsigned int num_pins, num_configs, reserve; > unsigned long *configs; > struct property *pins; > u32 pinfunc; > @@ -628,10 +631,10 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev, > static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, > struct device_node *np_config, > struct pinctrl_map **map, > - unsigned *num_maps) > + unsigned int *num_maps) > { > struct device_node *np; > - unsigned reserved_maps; > + unsigned int reserved_maps; > int ret; > > *map = NULL; > @@ -679,13 +682,13 @@ static int atmel_pmx_get_functions_count(struct pinctrl_dev *pctldev) > } > > static const char *atmel_pmx_get_function_name(struct pinctrl_dev *pctldev, > - unsigned selector) > + unsigned int selector) > { > return atmel_functions[selector]; > } > > static int atmel_pmx_get_function_groups(struct pinctrl_dev *pctldev, > - unsigned selector, > + unsigned int selector, > const char * const **groups, > unsigned * const num_groups) > { > @@ -698,11 +701,11 @@ static int atmel_pmx_get_function_groups(struct pinctrl_dev *pctldev, > } > > static int atmel_pmx_set_mux(struct pinctrl_dev *pctldev, > - unsigned function, > - unsigned group) > + unsigned int function, > + unsigned int group) > { > struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); > - unsigned pin; > + unsigned int pin; > u32 conf; > > dev_dbg(pctldev->dev, "enable function %s group %s\n", > @@ -726,13 +729,13 @@ static const struct pinmux_ops atmel_pmxops = { > }; > > static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev, > - unsigned group, > + unsigned int group, > unsigned long *config) > { > struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); > - unsigned param = pinconf_to_config_param(*config), arg = 0; > + unsigned int param = pinconf_to_config_param(*config), arg = 0; > struct atmel_group *grp = atmel_pioctrl->groups + group; > - unsigned pin_id = grp->pin; > + unsigned int pin_id = grp->pin; > u32 res; > > res = atmel_pin_config_read(pctldev, pin_id); > @@ -786,21 +789,21 @@ static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev, > } > > static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev, > - unsigned group, > + unsigned int group, > unsigned long *configs, > - unsigned num_configs) > + unsigned int num_configs) > { > struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); > struct atmel_group *grp = atmel_pioctrl->groups + group; > - unsigned bank, pin, pin_id = grp->pin; > + unsigned int bank, pin, pin_id = grp->pin; > u32 mask, conf = 0; > int i; > > conf = atmel_pin_config_read(pctldev, pin_id); > > for (i = 0; i < num_configs; i++) { > - unsigned param = pinconf_to_config_param(configs[i]); > - unsigned arg = pinconf_to_config_argument(configs[i]); > + unsigned int param = pinconf_to_config_param(configs[i]); > + unsigned int arg = pinconf_to_config_argument(configs[i]); > > dev_dbg(pctldev->dev, "%s: pin=%u, config=0x%lx\n", > __func__, pin_id, configs[i]); > @@ -900,7 +903,8 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev, > } > > static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev, > - struct seq_file *s, unsigned pin_id) > + struct seq_file *s, > + unsigned int pin_id) > { > struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); > u32 conf; > @@ -1108,8 +1112,8 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) > return -ENOMEM; > for (i = 0 ; i < atmel_pioctrl->npins; i++) { > struct atmel_group *group = atmel_pioctrl->groups + i; > - unsigned bank = ATMEL_PIO_BANK(i); > - unsigned line = ATMEL_PIO_LINE(i); > + unsigned int bank = ATMEL_PIO_BANK(i); > + unsigned int line = ATMEL_PIO_LINE(i); > > atmel_pioctrl->pins[i] = devm_kzalloc(dev, > sizeof(**atmel_pioctrl->pins), GFP_KERNEL); > -- > 2.7.4 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel