compat_ioctl cmd does not match even if it shows same value

Manomugdha Biswas via Valgrind-users <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <MWHPR17MB16166925CB936989F65E01B58F410@MWHPR17MB1616.namprd17.prod.outlook.com>
Hi,
I have a 32 bit application (user space) which communicate with a kernel module through compat_ioctl(). My system is
# uname -a
Linux chassis1-board1-port5 3.10 #1 SMP Fri Apr 24 02:31:48 PDT 2020 mips64 GNU/Linux

Ioctl function is following:
long mgr_compat_ioctl(struct file *pFile, unsigned int cmd, unsigned long arg)

inside this function definition, I am getting correct cmd value e.g. 0xc018786f. the variable to which this cmd is to be matched has exactly same value of 0xc018786f (printk shows same value). But still if check fails.

Sample code is like this:
int mgr_ioctl_common (struct inode *pInode, struct file *pFile,
                             unsigned int cmd, unsigned long arg)
{
    int err = -EFAULT;
    int minor;
    void  *pUserStruct = (void *)arg;
    SkixpppMgrDevDesc *pDev = NULL;
    tKHandle retHandle;

    unsigned int openLink = 3222829167;
   if (openLink == cmd) { //printk shows value of cmd is 3222829167
              printk("matches\n");
   } else {
              printk("no matche\n");
  }
}
Why this if check fails here?

Regards,
Mano

_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.