unsigned hp->count and hvcsd->open_count cannot be negative
Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
---
Both members of respectively struct hvcs_struct, see
vi drivers/char/hvcs.c +262
and struct hvcs_struct, see
vi drivers/char/hvsi.c +70
diff --git a/drivers/char/hvcs.c b/drivers/char/hv
i2c_smbus_read_word_data() returns a s32, which may be negative
but unsigned len cannot be negative.
Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
---
for i2c_smbus_read_word_data(), see
vi drivers/i2c/i2c-core.c +1663
diff --git a/drivers/macintosh/windfarm_smu_sat.c
b/drivers/macintosh/windfar
unsigned hp->count cannot be negative
Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
---
Similar to the previous patch but with lock. For hvc_struct, see
vi drivers/char/hvc_console.h +47
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 5b819b1..337f6c6 100644
--- a/drive
roel kluin <[EMAIL PROTECTED]> writes:
> - if (--hvcsd->open_count == 0) {
> + if (hvcsd->open_count == 1) {
> + hvcsd->open_count--;
This is not the same.
> - if (--hp->count == 0) {
> + if (hp->count == 1) {
> + hp->count--;
Likewise.
Andreas.
--
And
Andreas Schwab wrote:
> roel kluin <[EMAIL PROTECTED]> writes:
>
>> -if (--hvcsd->open_count == 0) {
>> +if (hvcsd->open_count == 1) {
>> +hvcsd->open_count--;
>
> This is not the same.
I think you're missing that I also decrement if (hvcsd->open_count > 1)
If not, please ela
roel kluin <[EMAIL PROTECTED]> writes:
> Andreas Schwab wrote:
>> roel kluin <[EMAIL PROTECTED]> writes:
>>
>>> - if (--hvcsd->open_count == 0) {
>>> + if (hvcsd->open_count == 1) {
>>> + hvcsd->open_count--;
>>
>> This is not the same.
>
> I think you're missing that I also decrem
roel kluin writes:
> unsigned hp->count and hvcsd->open_count cannot be negative
...
> - if (--hvcsd->open_count == 0) {
> + if (hvcsd->open_count == 1) {
> + hvcsd->open_count--;
Why are we no longer decrementing hvcsd->open_count in the cases where
it is greater than 1?
> -