Message ID | 20220426100605.36019-1-ulf.hansson@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mmc-utils: Fix build error MMC_BLOCK_MAJOR undeclared | expand |
> The reported build error: > In function read_extcsd: mmc_cmds.c:72:18: error: MMC_BLOCK_MAJOR > undeclared (first use in this function) > > In commit 118dc4a0909f ("mmc-utils: Remove unused MMC_BLOCK_MAJOR") > the > define for MMC_BLOCK_MAJOR was dropped. In a way this commit is still > correct, but unfortunately it also introduced a dependency to a commit for > the Linux kernel (83fc5dd57f86 mmc: fix compilation of user API), which > fixes the mmc uapi header file (mmc: fix compilation of user API). > > Rather than relying on the commit in the kernel, let's include the missing > header for MMC_BLOCK_MAJOR. > > Reported-by: Ming Liu <liu.ming50@gmail.com> > Fixes: 118dc4a0909f ("mmc-utils: Remove unused MMC_BLOCK_MAJOR") > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Avri Altman <avri.altman@wdc.com>
On Tue, 26 Apr 2022 at 12:06, Ulf Hansson <ulf.hansson@linaro.org> wrote: > > The reported build error: > In function read_extcsd: mmc_cmds.c:72:18: error: MMC_BLOCK_MAJOR > undeclared (first use in this function) > > In commit 118dc4a0909f ("mmc-utils: Remove unused MMC_BLOCK_MAJOR") the > define for MMC_BLOCK_MAJOR was dropped. In a way this commit is still > correct, but unfortunately it also introduced a dependency to a commit for > the Linux kernel (83fc5dd57f86 mmc: fix compilation of user API), which > fixes the mmc uapi header file (mmc: fix compilation of user API). > > Rather than relying on the commit in the kernel, let's include the missing > header for MMC_BLOCK_MAJOR. > > Reported-by: Ming Liu <liu.ming50@gmail.com> > Fixes: 118dc4a0909f ("mmc-utils: Remove unused MMC_BLOCK_MAJOR") > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Applied to mmc-utils.git master. Kind regards Uffe > --- > mmc.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mmc.h b/mmc.h > index 25d6864..0796532 100644 > --- a/mmc.h > +++ b/mmc.h > @@ -17,6 +17,7 @@ > * those modifications are Copyright (c) 2016 SanDisk Corp. > */ > > +#include <linux/major.h> > #include <linux/mmc/ioctl.h> > > /* From kernel linux/mmc/mmc.h */ > -- > 2.25.1 >
diff --git a/mmc.h b/mmc.h index 25d6864..0796532 100644 --- a/mmc.h +++ b/mmc.h @@ -17,6 +17,7 @@ * those modifications are Copyright (c) 2016 SanDisk Corp. */ +#include <linux/major.h> #include <linux/mmc/ioctl.h> /* From kernel linux/mmc/mmc.h */
The reported build error: In function read_extcsd: mmc_cmds.c:72:18: error: MMC_BLOCK_MAJOR undeclared (first use in this function) In commit 118dc4a0909f ("mmc-utils: Remove unused MMC_BLOCK_MAJOR") the define for MMC_BLOCK_MAJOR was dropped. In a way this commit is still correct, but unfortunately it also introduced a dependency to a commit for the Linux kernel (83fc5dd57f86 mmc: fix compilation of user API), which fixes the mmc uapi header file (mmc: fix compilation of user API). Rather than relying on the commit in the kernel, let's include the missing header for MMC_BLOCK_MAJOR. Reported-by: Ming Liu <liu.ming50@gmail.com> Fixes: 118dc4a0909f ("mmc-utils: Remove unused MMC_BLOCK_MAJOR") Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- mmc.h | 1 + 1 file changed, 1 insertion(+)