Marek Lindner wrote:
char *buff, size_t count)
char *buff, size_t count)
Why was the space removed?
Should I move this into a separate patch ?
Sry, my fault. just forget it :)
if ((strnicmp(tmp_ptr, "kbit", 4) == 0) ||
(multi > 1))
Why this indentation? And This should be on a single line (or I count wrong).
No, you are right. Will be fixed.
if ((gw_mode_tmp == GW_MODE_CLIENT) &&
(atomic_read(&bat_priv->gw_sel_class) == 0))
atomic_set(&bat_priv->gw_sel_class, 20);
if ((gw_mode_tmp == GW_MODE_SERVER) &&
(atomic_read(&bat_priv->gw_bandwidth) == 0))
atomic_set(&bat_priv->gw_bandwidth, 41);
Why setting that here? And why do you set gw_sel_class here to 20 (if it is 0 before) and in softif_create to 0? Shouldn't it be set to 20 in softif_create instead?
The general idea was that if somebody activated client or gateway mode without setting gw_sel_class or gw_bandwidth to any value, it would use some default values. Moving these checks into softif_create() would only solve half of the problem because a user could set these variables to 0 and then start the client or server. At least the client mode requires the gw_sel_class variable value to be greater than 0.
Isn't it limited to 1 by BAT_ATTR_UINT? And if not (which I doubt) wouldn't be the user still be able to set it to 0 after he changed it to client mode?
Best regards, Sven