[Nut-upsdev] [RFC apcsmart V3 11/18] drivers/apcsmart.c: add upsdrv_shutdown_advanced() and upsdrv_shutdown_simple()

Michal Soltys soltys at ziu.info
Wed Mar 9 23:05:51 UTC 2011


On 11-03-05 11:38, Michal Soltys wrote:
> +
> +	for (i = 0; i<  strlen(strval); i++) {
> +		if (strval[i] - 48 == SDIDX_CS) {
> +			n = status;
> +		} else if (strval[i] - 48 == SDIDX_AT3N) {
> +			n = 3;
> +		} else if (strval[i] - 48 == SDIDX_AT2N) {
> +			n = 2;
> +		}
> +		if (sdlist[strval[i] - 48](n))
> +			break;	/* finish if command succeeded */
> +	}

The patch that was applied, had 'continue' if 'n' wasn't set. But 
ignoring 'n' was intended - in other cases, 'n' simply doesn't matter. 
It's still present though, to keep functions in table. Code with 
'continue' will skip S, K and Z completely (if they are present in 
'advorder').

To quiet compiler, I'll just set n = 0 in next patches.



More information about the Nut-upsdev mailing list