[OpenWrt-Devel] Patch to uqmi utility

Petr Štetiar ynezz at true.cz
Tue May 14 07:49:35 PDT 2019


Tautvydas Belgeras <tautvydas.b at 8devices.com> [2019-05-14 16:20:05]:

Hi,

> Patch fixes utility returning "Unknown error" when generating a request
> after a wait of a few minutes

quoting from https://openwrt.org/submitting-patches

 * commit subject
   - must have a prefix that depends from what you are doing in the commit
   - must describe what the commit changes and why the commit is necessary.
     (e.g. [PATCH uqmi] uqmi: fix response message handling)

 * 6. No MIME, no links, no compression, no attachments, just plain text
 * 13. The canonical patch format (subject part)

> diff --git a/dev.c b/dev.c
> index c25900b..b0c8262 100644
> --- a/dev.c
> +++ b/dev.c
> @@ -101,6 +101,14 @@ static void qmi_process_msg(struct qmi_dev *qmi, struct qmi_msg *msg)
>  	uint16_t tid;
>
>  	if (msg->qmux.service == QMI_SERVICE_CTL)
> +	{
> +		if (msg->flags != QMI_CTL_FLAG_RESPONSE)
> +			return;
> +	}
> +	else if (msg->flags != QMI_SERVICE_FLAG_RESPONSE)
> +		return;
> +
> +	if (msg->qmux.service == QMI_SERVICE_CTL)
>  		tid = msg->ctl.transaction;
>  	else
>  		tid = le16_to_cpu(msg->svc.transaction);

please try to follow already estabilished coding style in that file, something
like:

 if (something) {
 } else if (other) {
 }

-- ynezz



More information about the openwrt-devel mailing list