lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <540AFCCA.7050104@gmx.de>
Date:	Sat, 06 Sep 2014 14:23:38 +0200
From:	Hartmut Knaack <knaack.h@....de>
To:	Irina Tirdea <irina.tirdea@...el.com>,
	Jonathan Cameron <jic23@...nel.org>, linux-iio@...r.kernel.org
CC:	Lars-Peter Clausen <lars@...afoo.de>,
	Peter Meerwald <pmeerw@...erw.net>,
	Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
	linux-kernel@...r.kernel.org, Beomho Seo <beomho.seo@...sung.com>
Subject: Re: [PATCH] iio: magn: ak8975: fix unnecessary casting between char*
 and const char*

Irina Tirdea schrieb:
> Use const char* instead of casting const char* to char*.
>
> Signed-off-by: Irina Tirdea <irina.tirdea@...el.com>
> ---
>  drivers/iio/magnetometer/ak8975.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
> index a235792..61edc66 100644
> --- a/drivers/iio/magnetometer/ak8975.c
> +++ b/drivers/iio/magnetometer/ak8975.c
> @@ -477,7 +477,7 @@ static const struct acpi_device_id ak_acpi_match[] = {
>  };
>  MODULE_DEVICE_TABLE(acpi, ak_acpi_match);
>  
> -static char *ak8975_match_acpi_device(struct device *dev,
> +static const char *ak8975_match_acpi_device(struct device *dev,
>  				enum asahi_compass_chipset *chipset)
This second line should also be indented properly, it will exactly fit 80 characters.
>  {
>  	const struct acpi_device_id *id;
> @@ -487,7 +487,7 @@ static char *ak8975_match_acpi_device(struct device *dev,
>  		return NULL;
>  	*chipset = (int)id->driver_data;
>  
> -	return (char *)dev_name(dev);
> +	return dev_name(dev);
>  }
>  
>  static int ak8975_probe(struct i2c_client *client,
> @@ -497,7 +497,7 @@ static int ak8975_probe(struct i2c_client *client,
>  	struct iio_dev *indio_dev;
>  	int eoc_gpio;
>  	int err;
> -	char *name = NULL;
> +	const char *name = NULL;
>  
>  	/* Grab and set up the supplied GPIO. */
>  	if (client->dev.platform_data)
> @@ -539,7 +539,7 @@ static int ak8975_probe(struct i2c_client *client,
>  	if (id) {
>  		data->chipset =
>  			(enum asahi_compass_chipset)(id->driver_data);
> -		name = (char *) id->name;
> +		name = id->name;
>  	} else if (ACPI_HANDLE(&client->dev))
>  		name = ak8975_match_acpi_device(&client->dev, &data->chipset);
>  	else

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ