Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1581617 > unrolled thread

[PATCH] uapi: fix linux/btrfs.h userspace compilation error

Started by"Dmitry V. Levin" <ldv@altlinux.org>
First post2017-02-15 21:10 +0100
Last post2017-03-01 00:20 +0100
Articles 6 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] uapi: fix linux/btrfs.h userspace compilation error "Dmitry V. Levin" <ldv@altlinux.org> - 2017-02-15 21:10 +0100
    Re: [PATCH] uapi: fix linux/btrfs.h userspace compilation error Joe Perches <joe@perches.com> - 2017-02-15 21:40 +0100
    Re: [PATCH] uapi: fix linux/btrfs.h userspace compilation error Jeff Mahoney <jeffm@suse.com> - 2017-02-15 22:30 +0100
      [PATCH v2] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h "Dmitry V. Levin" <ldv@altlinux.org> - 2017-02-16 00:00 +0100
        Re: [PATCH v2] btrfs: remove btrfs_err_str function from  uapi/linux/btrfs.h David Sterba <dsterba@suse.cz> - 2017-02-16 15:20 +0100
        [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h "Dmitry V. Levin" <ldv@altlinux.org> - 2017-03-01 00:20 +0100

#1581617 — [PATCH] uapi: fix linux/btrfs.h userspace compilation error

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2017-02-15 21:10 +0100
Subject[PATCH] uapi: fix linux/btrfs.h userspace compilation error
Message-ID<tbe3L-4vL-5@gated-at.bofh.it>
Stop using NULL to fix the following linux/btrfs.h userspace compilation
error:

/usr/include/linux/btrfs.h: In function 'btrfs_err_str':
/usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
    return NULL;

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 include/uapi/linux/btrfs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index db4c253..01c612f 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -737,7 +737,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
 			return "add/delete/balance/replace/resize operation "\
 				"in progress";
 		default:
-			return NULL;
+			return 0;
 	}
 }
 
-- 
ldv

[toc] | [next] | [standalone]


#1581646

FromJoe Perches <joe@perches.com>
Date2017-02-15 21:40 +0100
Message-ID<tbewO-4G5-21@gated-at.bofh.it>
In reply to#1581617
On Wed, 2017-02-15 at 23:02 +0300, Dmitry V. Levin wrote:
> Stop using NULL to fix the following linux/btrfs.h userspace compilation
> error:
> 
> /usr/include/linux/btrfs.h: In function 'btrfs_err_str':
> /usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
>     return NULL;
> 
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>  include/uapi/linux/btrfs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
[]
> @@ -737,7 +737,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
>  			return "add/delete/balance/replace/resize operation "\
>  				"in progress";
>  		default:
> -			return NULL;
> +			return 0;

Perhaps to avoid some other warnings this might be better

	return (void *)0;

[toc] | [prev] | [next] | [standalone]


#1581680

FromJeff Mahoney <jeffm@suse.com>
Date2017-02-15 22:30 +0100
Message-ID<tbfjc-5cF-13@gated-at.bofh.it>
In reply to#1581617

[Multipart message — attachments visible in raw view] — view raw

On 2/15/17 3:02 PM, Dmitry V. Levin wrote:
> Stop using NULL to fix the following linux/btrfs.h userspace compilation
> error:
> 
> /usr/include/linux/btrfs.h: In function 'btrfs_err_str':
> /usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
>     return NULL;
> 
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>  include/uapi/linux/btrfs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
> index db4c253..01c612f 100644
> --- a/include/uapi/linux/btrfs.h
> +++ b/include/uapi/linux/btrfs.h
> @@ -737,7 +737,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
>  			return "add/delete/balance/replace/resize operation "\
>  				"in progress";
>  		default:
> -			return NULL;
> +			return 0;
>  	}
>  }
>  
> 

Hi Dmitry -

Just remove the whole routine.  It's not called from anywhere and is
replicated in the userspace headers for btrfsprogs.

-Jeff

-- 
Jeff Mahoney
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1581748 — [PATCH v2] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2017-02-16 00:00 +0100
Subject[PATCH v2] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
Message-ID<tbgIj-5XZ-43@gated-at.bofh.it>
In reply to#1581680
btrfs_err_str function is not called from anywhere and is replicated
in the userspace headers for btrfs-progs.

It's removal also fixes the following linux/btrfs.h userspace
compilation error:

/usr/include/linux/btrfs.h: In function 'btrfs_err_str':
/usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
    return NULL;

Suggested-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
v2: remove btrfs_err_str rather than fix it

 include/uapi/linux/btrfs.h | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index db4c253..dcfc3a5 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -713,33 +713,6 @@ enum btrfs_err_code {
 	BTRFS_ERROR_DEV_ONLY_WRITABLE,
 	BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS
 };
-/* An error code to error string mapping for the kernel
-*  error codes
-*/
-static inline char *btrfs_err_str(enum btrfs_err_code err_code)
-{
-	switch (err_code) {
-		case BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET:
-			return "unable to go below two devices on raid1";
-		case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
-			return "unable to go below four devices on raid10";
-		case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
-			return "unable to go below two devices on raid5";
-		case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
-			return "unable to go below three devices on raid6";
-		case BTRFS_ERROR_DEV_TGT_REPLACE:
-			return "unable to remove the dev_replace target dev";
-		case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
-			return "no missing devices found to remove";
-		case BTRFS_ERROR_DEV_ONLY_WRITABLE:
-			return "unable to remove the only writeable device";
-		case BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS:
-			return "add/delete/balance/replace/resize operation "\
-				"in progress";
-		default:
-			return NULL;
-	}
-}
 
 #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
 				   struct btrfs_ioctl_vol_args)
-- 
ldv

[toc] | [prev] | [next] | [standalone]


#1582604 — Re: [PATCH v2] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

FromDavid Sterba <dsterba@suse.cz>
Date2017-02-16 15:20 +0100
SubjectRe: [PATCH v2] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
Message-ID<tbv4B-7ic-3@gated-at.bofh.it>
In reply to#1581748
On Thu, Feb 16, 2017 at 01:55:03AM +0300, Dmitry V. Levin wrote:
> btrfs_err_str function is not called from anywhere and is replicated
> in the userspace headers for btrfs-progs.
> 
> It's removal also fixes the following linux/btrfs.h userspace
> compilation error:
> 
> /usr/include/linux/btrfs.h: In function 'btrfs_err_str':
> /usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
>     return NULL;
> 
> Suggested-by: Jeff Mahoney <jeffm@suse.com>
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>

Reviewed-by: David Sterba <dsterba@suse.com>

[toc] | [prev] | [next] | [standalone]


#1589861 — [PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h

From"Dmitry V. Levin" <ldv@altlinux.org>
Date2017-03-01 00:20 +0100
Subject[PATCH v3] btrfs: remove btrfs_err_str function from uapi/linux/btrfs.h
Message-ID<tfZdM-2BN-25@gated-at.bofh.it>
In reply to#1581748
btrfs_err_str function is not called from anywhere and is replicated
in the userspace headers for btrfs-progs.

It's removal also fixes the following linux/btrfs.h userspace
compilation error:

/usr/include/linux/btrfs.h: In function 'btrfs_err_str':
/usr/include/linux/btrfs.h:740:11: error: 'NULL' undeclared (first use in this function)
    return NULL;

Suggested-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Reviewed-by: David Sterba <dsterba@suse.com>
---
v3: the patch seems to be lost, resending with updated list of addressees

v2: remove btrfs_err_str rather than fix it

 include/uapi/linux/btrfs.h | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index db4c253..dcfc3a5 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -713,33 +713,6 @@ enum btrfs_err_code {
 	BTRFS_ERROR_DEV_ONLY_WRITABLE,
 	BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS
 };
-/* An error code to error string mapping for the kernel
-*  error codes
-*/
-static inline char *btrfs_err_str(enum btrfs_err_code err_code)
-{
-	switch (err_code) {
-		case BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET:
-			return "unable to go below two devices on raid1";
-		case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
-			return "unable to go below four devices on raid10";
-		case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
-			return "unable to go below two devices on raid5";
-		case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
-			return "unable to go below three devices on raid6";
-		case BTRFS_ERROR_DEV_TGT_REPLACE:
-			return "unable to remove the dev_replace target dev";
-		case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
-			return "no missing devices found to remove";
-		case BTRFS_ERROR_DEV_ONLY_WRITABLE:
-			return "unable to remove the only writeable device";
-		case BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS:
-			return "add/delete/balance/replace/resize operation "\
-				"in progress";
-		default:
-			return NULL;
-	}
-}
 
 #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
 				   struct btrfs_ioctl_vol_args)
-- 
ldv

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web