All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] iio: magn: ak8975: fix unnecessary casting between char* and const char*
@ 2014-09-08 14:18 Irina Tirdea
  2014-09-14 17:31 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Irina Tirdea @ 2014-09-08 14:18 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald,
	Srinivas Pandruvada, linux-kernel, Beomho Seo, Irina Tirdea

Use const char* instead of casting const char* to char*.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
---

Changes in v2:
 - fixed identation as Hartmut Knaack suggested

 drivers/iio/magnetometer/ak8975.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index a235792..bf5ef07 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -477,8 +477,8 @@ 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,
-				enum asahi_compass_chipset *chipset)
+static const char *ak8975_match_acpi_device(struct device *dev,
+					    enum asahi_compass_chipset *chipset)
 {
 	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
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] iio: magn: ak8975: fix unnecessary casting between char* and const char*
  2014-09-08 14:18 [PATCH v2] iio: magn: ak8975: fix unnecessary casting between char* and const char* Irina Tirdea
@ 2014-09-14 17:31 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2014-09-14 17:31 UTC (permalink / raw)
  To: Irina Tirdea, linux-iio
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald,
	Srinivas Pandruvada, linux-kernel, Beomho Seo

On 08/09/14 15:18, Irina Tirdea wrote:
> Use const char* instead of casting const char* to char*.
> 
> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Applied to the togreg branch of iio.git - initially pushed out as testing.

Thanks,

Jonathan
> ---
> 
> Changes in v2:
>  - fixed identation as Hartmut Knaack suggested
> 
>  drivers/iio/magnetometer/ak8975.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
> index a235792..bf5ef07 100644
> --- a/drivers/iio/magnetometer/ak8975.c
> +++ b/drivers/iio/magnetometer/ak8975.c
> @@ -477,8 +477,8 @@ 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,
> -				enum asahi_compass_chipset *chipset)
> +static const char *ak8975_match_acpi_device(struct device *dev,
> +					    enum asahi_compass_chipset *chipset)
>  {
>  	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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-14 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-08 14:18 [PATCH v2] iio: magn: ak8975: fix unnecessary casting between char* and const char* Irina Tirdea
2014-09-14 17:31 ` Jonathan Cameron

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.