Re: proc_mkdir

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

 



On Thu, 2006-07-06 at 17:01 +0200, Fernando Apesteguía wrote:
[...]
>         ((struct proc_dir_entry *) (*entry))->read_proc =
           ^^^^^^^^^^^^^^^^^^^^^^^^
>             (read_proc_t *) read_func; 
             ^^^^^^^^^^^^^^^
>         ((struct proc_dir_entry *) (*entry))->owner = THIS_MODULE;
           ^^^^^^^^^^^^^^^^^^^^^^^^^
>         ((struct proc_dir_entry *) (*entry))->data =
           ^^^^^^^^^^^^^^^^^^^^^^^^^
>             kmalloc(sizeof (int), GFP_KERNEL);
>         ((struct proc_dir_entry *) (*entry))->data = (void *) constant; 
           ^^^^^^^^^^^^^^^^^^^^^^^^
Kill the underlined casts - either
*) you really need them, then the assignments are wrong anyway, or
*) you don't need them, then there is no reason to put them in.
As long as they are in, they are possibly hiding real bugs detected at
compile time since the casts disable type checking ....

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux