[tty:tty-next 80/83] drivers/staging/gdm724x/gdm_tty.c:165:24: warning: comparison of distinct pointer types ('typeof (2048UL) *' (aka 'unsigned long *') and 'typeof (remain) *' (aka 'unsigned int *'))

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next
head:   e67d7f60d2382677c25de10b2e4d8d3717ace91f
commit: c3e5c706aefc3ceee941c1e7bd72084d3aeca37b [80/83] tty: gdm724x: convert counts to size_t
config: i386-buildonly-randconfig-r004-20230815 (https://download.01.org/0day-ci/archive/20230815/202308151953.rNNnAR2N-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20230815/202308151953.rNNnAR2N-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308151953.rNNnAR2N-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/staging/gdm724x/gdm_tty.c:165:24: warning: comparison of distinct pointer types ('typeof (2048UL) *' (aka 'unsigned long *') and 'typeof (remain) *' (aka 'unsigned int *')) [-Wcompare-distinct-pointer-types]
                   size_t sending_len = min(MUX_TX_MAX_SIZE, remain);
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:67:19: note: expanded from macro 'min'
   #define min(x, y)       __careful_cmp(x, y, <)
                           ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
           __builtin_choose_expr(__safe_cmp(x, y), \
                                 ^~~~~~~~~~~~~~~~
   include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
                   (__typecheck(x, y) && __no_side_effects(x, y))
                    ^~~~~~~~~~~~~~~~~
   include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
           (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                      ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
   1 warning generated.


vim +165 drivers/staging/gdm724x/gdm_tty.c

   151	
   152	static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len)
   153	{
   154		struct gdm *gdm = tty->driver_data;
   155		size_t remain = len;
   156		size_t sent_len = 0;
   157	
   158		if (!gdm_tty_ready(gdm))
   159			return -ENODEV;
   160	
   161		if (!len)
   162			return 0;
   163	
   164		while (1) {
 > 165			size_t sending_len = min(MUX_TX_MAX_SIZE, remain);
   166			gdm->tty_dev->send_func(gdm->tty_dev->priv_dev,
   167						(void *)(buf + sent_len),
   168						sending_len,
   169						gdm->index,
   170						gdm_tty_send_complete,
   171						gdm);
   172			sent_len += sending_len;
   173			remain -= sending_len;
   174			if (remain <= 0)
   175				break;
   176		}
   177	
   178		return len;
   179	}
   180	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux