All of lore.kernel.org
 help / color / mirror / Atom feed
* 3.19rc1, extent_io.c:2193:13: warning: cast to pointer from integer of different size
@ 2014-12-23 21:46 Chris Murphy
  2014-12-25  9:21 ` [PATCH] btrfs: suppress a build warning on building 32bit kernel Satoru Takeuchi
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Murphy @ 2014-12-23 21:46 UTC (permalink / raw)
  To: Btrfs BTRFS

I get this when building on i686:

  CC [M]  fs/btrfs/extent_io.o
fs/btrfs/extent_io.c: In function ‘btrfs_free_io_failure_record’:
fs/btrfs/extent_io.c:2193:13: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
   failrec = (struct io_failure_record *)state->private;


.config contains the following
CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS_POSIX_ACL=y
# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
CONFIG_BTRFS_DEBUG=y
CONFIG_BTRFS_ASSERT=y

-- 
Chris Murphy

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

* [PATCH] btrfs: suppress a build warning on building 32bit kernel
  2014-12-23 21:46 3.19rc1, extent_io.c:2193:13: warning: cast to pointer from integer of different size Chris Murphy
@ 2014-12-25  9:21 ` Satoru Takeuchi
  2014-12-29 15:09   ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Satoru Takeuchi @ 2014-12-25  9:21 UTC (permalink / raw)
  To: Btrfs BTRFS; +Cc: Chris Murphy

From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

Suppress the following warning displayed on building 32bit (i686) kernel.

===============================================================================
...
   CC [M]  fs/btrfs/extent_io.o
fs/btrfs/extent_io.c: In function ‘btrfs_free_io_failure_record’:
fs/btrfs/extent_io.c:2193:13: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
    failrec = (struct io_failure_record *)state->private;
...
===============================================================================

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Reported-by: Chris Murphy <chris@colorremedies.com>

---
  fs/btrfs/extent_io.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 4ebabd2..790dbae 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2190,7 +2190,7 @@ void btrfs_free_io_failure_record(struct inode *inode, u64 start, u64 end)
  
  		next = next_state(state);
  
-		failrec = (struct io_failure_record *)state->private;
+		failrec = (struct io_failure_record *)(unsigned long)state->private;
  		free_extent_state(state);
  		kfree(failrec);
  
-- 
1.8.3.1


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

* Re: [PATCH] btrfs: suppress a build warning on building 32bit kernel
  2014-12-25  9:21 ` [PATCH] btrfs: suppress a build warning on building 32bit kernel Satoru Takeuchi
@ 2014-12-29 15:09   ` David Sterba
  2015-01-05  8:03     ` Satoru Takeuchi
  0 siblings, 1 reply; 5+ messages in thread
From: David Sterba @ 2014-12-29 15:09 UTC (permalink / raw)
  To: Satoru Takeuchi; +Cc: Btrfs BTRFS, Chris Murphy

On Thu, Dec 25, 2014 at 06:21:41PM +0900, Satoru Takeuchi wrote:
> From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -2190,7 +2190,7 @@ void btrfs_free_io_failure_record(struct inode *inode, u64 start, u64 end)
>   
>   		next = next_state(state);
>   
> -		failrec = (struct io_failure_record *)state->private;
> +		failrec = (struct io_failure_record *)(unsigned long)state->private;

We're always using the 'private' data to store a pointer to
'struct io_failure_record *', please change the defintion in
'struct extent_state' instead of the typecasting.

>   		free_extent_state(state);
>   		kfree(failrec);

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

* Re: [PATCH] btrfs: suppress a build warning on building 32bit kernel
  2014-12-29 15:09   ` David Sterba
@ 2015-01-05  8:03     ` Satoru Takeuchi
  2015-01-06 14:07       ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Satoru Takeuchi @ 2015-01-05  8:03 UTC (permalink / raw)
  To: dsterba, Btrfs BTRFS, Chris Murphy

Hi David,

On 2014/12/30 0:09, David Sterba wrote:
> On Thu, Dec 25, 2014 at 06:21:41PM +0900, Satoru Takeuchi wrote:
>> From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
>> --- a/fs/btrfs/extent_io.c
>> +++ b/fs/btrfs/extent_io.c
>> @@ -2190,7 +2190,7 @@ void btrfs_free_io_failure_record(struct inode *inode, u64 start, u64 end)
>>
>>    		next = next_state(state);
>>
>> -		failrec = (struct io_failure_record *)state->private;
>> +		failrec = (struct io_failure_record *)(unsigned long)state->private;
>
> We're always using the 'private' data to store a pointer to
> 'struct io_failure_record *', please change the defintion in
> 'struct extent_state' instead of the typecasting.

Current definition is as follow.

===============================================================================
struct extent_state {
...
         /* for use by the FS */
         u64 private;
};
===============================================================================

It it OK to changing "u64 private" to "struct io_failure_record *failrec"
and change "{set,get}_state_private()" to "{set,get}_state_failrec()?
Or is it better to keep the name "private" as is and just change its type
to "unsigned long" or "(void *)"?

Thanks,
Satoru

>
>>    		free_extent_state(state);
>>    		kfree(failrec);


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

* Re: [PATCH] btrfs: suppress a build warning on building 32bit kernel
  2015-01-05  8:03     ` Satoru Takeuchi
@ 2015-01-06 14:07       ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2015-01-06 14:07 UTC (permalink / raw)
  To: Satoru Takeuchi; +Cc: Btrfs BTRFS, Chris Murphy

On Mon, Jan 05, 2015 at 05:03:29PM +0900, Satoru Takeuchi wrote:
> >> -		failrec = (struct io_failure_record *)state->private;
> >> +		failrec = (struct io_failure_record *)(unsigned long)state->private;
> >
> > We're always using the 'private' data to store a pointer to
> > 'struct io_failure_record *', please change the defintion in
> > 'struct extent_state' instead of the typecasting.
> 
> Current definition is as follow.
> 
> ===============================================================================
> struct extent_state {
> ...
>          /* for use by the FS */
>          u64 private;
> };
> ===============================================================================
> 
> It it OK to changing "u64 private" to "struct io_failure_record *failrec"
> and change "{set,get}_state_private()" to "{set,get}_state_failrec()?
> Or is it better to keep the name "private" as is and just change its type
> to "unsigned long" or "(void *)"?

I've looked at the implied changes that set/get functions renaming would
need, also to keep the code sane. It does not seem to be small enough to
fold in this patch so please go on with adding the typecasts. The code
could use some cleanups but bugfixes first.

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

end of thread, other threads:[~2015-01-06 14:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-23 21:46 3.19rc1, extent_io.c:2193:13: warning: cast to pointer from integer of different size Chris Murphy
2014-12-25  9:21 ` [PATCH] btrfs: suppress a build warning on building 32bit kernel Satoru Takeuchi
2014-12-29 15:09   ` David Sterba
2015-01-05  8:03     ` Satoru Takeuchi
2015-01-06 14:07       ` David Sterba

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.