X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fhvsi.c;fp=drivers%2Fchar%2Fhvsi.c;h=a9522189fc9efeaa82dab6d3b479df11d89a8412;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=f1f1192ba2b50ce00706f2dbb1ee9c850f338329;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c index f1f1192ba..a9522189f 100644 --- a/drivers/char/hvsi.c +++ b/drivers/char/hvsi.c @@ -197,7 +197,7 @@ static inline void print_state(struct hvsi_struct *hp) }; const char *name = state_names[hp->state]; - if (hp->state > (sizeof(state_names)/sizeof(char*))) + if (hp->state > ARRAY_SIZE(state_names)) name = "UNKNOWN"; pr_debug("hvsi%i: state = %s\n", hp->index, name); @@ -291,15 +291,13 @@ static void dump_packet(uint8_t *packet) dump_hex(packet, header->len); } -/* can't use hvc_get_chars because that strips CRs */ static int hvsi_read(struct hvsi_struct *hp, char *buf, int count) { unsigned long got; - if (plpar_hcall(H_GET_TERM_CHAR, hp->vtermno, 0, 0, 0, &got, - (unsigned long *)buf, (unsigned long *)buf+1) == H_Success) - return got; - return 0; + got = hvc_get_chars(hp->vtermno, buf, count); + + return got; } static void hvsi_recv_control(struct hvsi_struct *hp, uint8_t *packet,