On Fri, Jul 22, 2016 at 05:39:27AM +0800, Tom Yan wrote:
> Let me know how I should polish the description for this.
The above is because the signed ones are getting sign-extended making
them different from the unsigned ones which don't get padded in the
high bits. Converting to u8 is the right t
Well, I mean this is happening when ata_mselect_*() calls ata_msense_*():
[tom@localhost ~]$ cat test.c
#include
#include
typedef unsigned char u8;
int main() {
u8 a[2] = { 0xff, 0xff };
char b[2];
memcpy(b, a, 2);
for (int i=0; i<2; i++) {
printf("%d\n", a[i]);
}
for (int i=
Hello,
On Fri, Jul 22, 2016 at 02:41:52AM +0800, tom.t...@gmail.com wrote:
> From: Tom Yan
>
> ata_mselect_*() would initialize a char array for storing a copy of
> the current mode page. However, if char was actually signed char,
> overflow could occur.
Do you mean sign extension?
> For examp
From: Tom Yan
ata_mselect_*() would initialize a char array for storing a copy of
the current mode page. However, if char was actually signed char,
overflow could occur.
For example, `0xff` from def_control_mpage[] would be "truncated"
to `-1`. This prevented ata_mselect_control() from working a
4 matches
Mail list logo