diff mbox

[02/20] regmap: Remove regmap_bulk_write 64bit support

Message ID 1439374365-20623-3-git-send-email-mpa@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Markus Pargmann Aug. 12, 2015, 10:12 a.m. UTC
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(-)

Comments

Mark Brown Aug. 12, 2015, 10:25 a.m. UTC | #1
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.
Markus Pargmann Aug. 12, 2015, 10:44 a.m. UTC | #2
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
Mark Brown Aug. 12, 2015, 10:57 a.m. UTC | #3
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).
Markus Pargmann Aug. 12, 2015, 12:28 p.m. UTC | #4
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
Mark Brown Aug. 12, 2015, 12:35 p.m. UTC | #5
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.
Markus Pargmann Aug. 12, 2015, 1:08 p.m. UTC | #6
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
Mark Brown Aug. 12, 2015, 2:56 p.m. UTC | #7
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 mbox

Patch

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;