logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0001-Prevent-unused-but-set-variables.patch (1314B)


  1. From 19375b1476921178f4af5a74708239b3671cd56e Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Fri, 5 Jun 2020 02:10:12 -0700
  4. Subject: [PATCH] Prevent unused-but-set variables
  5. ---
  6. mkfs/f2fs_format_utils.c | 8 +++++---
  7. 1 file changed, 5 insertions(+), 3 deletions(-)
  8. diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c
  9. index f2d55ad..76f5a1e 100644
  10. --- a/mkfs/f2fs_format_utils.c
  11. +++ b/mkfs/f2fs_format_utils.c
  12. @@ -49,11 +49,13 @@
  13. static int trim_device(int i)
  14. {
  15. #ifndef ANDROID_WINDOWS_HOST
  16. - unsigned long long range[2];
  17. struct stat *stat_buf;
  18. struct device_info *dev = c.devices + i;
  19. - u_int64_t bytes = dev->total_sectors * dev->sector_size;
  20. int fd = dev->fd;
  21. +#if defined(WITH_BLKDISCARD) && defined(BLKDISCARD)
  22. + unsigned long long range[2];
  23. + u_int64_t bytes = dev->total_sectors * dev->sector_size;
  24. +#endif
  25. stat_buf = malloc(sizeof(struct stat));
  26. if (stat_buf == NULL) {
  27. @@ -67,10 +69,10 @@ static int trim_device(int i)
  28. return -1;
  29. }
  30. +#if defined(WITH_BLKDISCARD) && defined(BLKDISCARD)
  31. range[0] = 0;
  32. range[1] = bytes;
  33. -#if defined(WITH_BLKDISCARD) && defined(BLKDISCARD)
  34. MSG(0, "Info: [%s] Discarding device\n", dev->path);
  35. if (S_ISREG(stat_buf->st_mode)) {
  36. #if defined(HAVE_FALLOCATE) && defined(FALLOC_FL_PUNCH_HOLE)
  37. --
  38. 2.27.0