Re: [PATCH] staging: speakup: replace simple_strtoul() with kstrtoint()

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

 



Probably once you start writing a patch you will figure it out.  :)

keymap_store() is a crap function.  We have the cp1 pointer that points
to the end of two back to back 3 char arrays.  The name cp1 is because
it is the second copy of the cp buffer which is a copy of the buf
buffer.  Since it is a backwards array we use cp1[-3] where normally we
would say array[0] and cp1[-1] to mean the last element in the array.

We need around 6 characters in cp1, but we are only garaunteed to have
2.  There is no checking.

Lots of checkpatch.pl warnings.

Just focus on cleaning up keymap_store() and hopefully at the end you
can just delete spk_s2uchar().

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux