Message ID | 1439374365-20623-3-git-send-email-mpa@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Aug 12, 2015 at 12:12:27PM +0200, Markus Pargmann wrote: > Regmap does not support 64bit. The ival that is used to write the 64bit > data to, is unsigned int and can't hold 64bit. _regmap_write also just > supports unsigend int. What makes you say that unsigned int can't hold 64 bit? An architecture can have 64 bit ints if it likes.
On Wed, Aug 12, 2015 at 11:25:50AM +0100, Mark Brown wrote: > On Wed, Aug 12, 2015 at 12:12:27PM +0200, Markus Pargmann wrote: > > Regmap does not support 64bit. The ival that is used to write the 64bit > > data to, is unsigned int and can't hold 64bit. _regmap_write also just > > supports unsigend int. > > What makes you say that unsigned int can't hold 64 bit? An architecture > can have 64 bit ints if it likes. I wasn't aware that any 64 bit architecture actually has unsigned ints that are 64 bit in size. So wouldn't at least on x86_64 this would lead to a compiler warning as unsigned int is 4 byte and u64 8 bytes? Best Regards, Markus
On Wed, Aug 12, 2015 at 12:44:36PM +0200, Markus Pargmann wrote: > I wasn't aware that any 64 bit architecture actually has unsigned ints > that are 64 bit in size. So wouldn't at least on x86_64 this would lead > to a compiler warning as unsigned int is 4 byte and u64 8 bytes? Nobody complained about warnings yet. The compiler probably shouldn't be complaining given the casts, they're supposed to be an "I know what I'm doing" thing. If you want to change something here it's changing the test to be based on sizeof(unsigned int).
On Wed, Aug 12, 2015 at 11:57:58AM +0100, Mark Brown wrote: > On Wed, Aug 12, 2015 at 12:44:36PM +0200, Markus Pargmann wrote: > > > I wasn't aware that any 64 bit architecture actually has unsigned ints > > that are 64 bit in size. So wouldn't at least on x86_64 this would lead > > to a compiler warning as unsigned int is 4 byte and u64 8 bytes? > > Nobody complained about warnings yet. The compiler probably shouldn't > be complaining given the casts, they're supposed to be an "I know what > I'm doing" thing. If you want to change something here it's changing > the test to be based on sizeof(unsigned int). Ok, would work for me as well although sizeof is not a preprocessor macro so I would probably leave it as it is. The whole regmap framework just didn't seem to support 64bit so I thought this was just not working. Thanks, Markus
On Wed, Aug 12, 2015 at 02:28:56PM +0200, Markus Pargmann wrote: > Ok, would work for me as well although sizeof is not a preprocessor > macro so I would probably leave it as it is. The whole regmap framework > just didn't seem to support 64bit so I thought this was just not > working. I'd expect the framework to cope with things when ints are 64 bit. We don't try to support anything else, though.
On Wed, Aug 12, 2015 at 01:35:37PM +0100, Mark Brown wrote: > On Wed, Aug 12, 2015 at 02:28:56PM +0200, Markus Pargmann wrote: > > > Ok, would work for me as well although sizeof is not a preprocessor > > macro so I would probably leave it as it is. The whole regmap framework > > just didn't seem to support 64bit so I thought this was just not > > working. > > I'd expect the framework to cope with things when ints are 64 bit. We > don't try to support anything else, though. For all non-busses it probably will. All the format functions are not working for 64bit at the moment. But that's something different, also I didn't see a bus device with 64bit yet. Best Regards, Markus
On Wed, Aug 12, 2015 at 03:08:38PM +0200, Markus Pargmann wrote: > On Wed, Aug 12, 2015 at 01:35:37PM +0100, Mark Brown wrote: > > I'd expect the framework to cope with things when ints are 64 bit. We > > don't try to support anything else, though. > For all non-busses it probably will. All the format functions are not > working for 64bit at the moment. But that's something different, also I > didn't see a bus device with 64bit yet. This is expected to be used by memory mapped devices.
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 7111d04f2621..64a106af174f 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1694,11 +1694,6 @@ int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, case 4: ival = *(u32 *)(val + (i * val_bytes)); break; -#ifdef CONFIG_64BIT - case 8: - ival = *(u64 *)(val + (i * val_bytes)); - break; -#endif default: ret = -EINVAL; goto out;
Regmap does not support 64bit. The ival that is used to write the 64bit data to, is unsigned int and can't hold 64bit. _regmap_write also just supports unsigend int. This patch removes the 64bit case as it may lead to compile warnings. Cc: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Markus Pargmann <mpa@pengutronix.de> --- drivers/base/regmap/regmap.c | 5 ----- 1 file changed, 5 deletions(-)