Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1399069ybn; Wed, 25 Sep 2019 17:46:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaLkJTWL8M98oiQ3yvK8mS6Vt2F6xteGQSVReLNFylV+mkg+FCfLHlJ5lU3TQX788tvrtZ X-Received: by 2002:a17:906:8406:: with SMTP id n6mr853314ejx.290.1569458795175; Wed, 25 Sep 2019 17:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569458795; cv=none; d=google.com; s=arc-20160816; b=023KoQX6xDEdH0ZKsa+bnUNcnBjUUubN5y0HQ1P2ZjBa0ASTRF6e2WUL+2my25tY2e q+WlmGqYSzmDQm2k1qH/InuSkRZ++bw8MosEx5IM6pzss33IfUOTDloihHxaonkBs879 DbFi4+7PfrugnYxdW8RTVVx2F95Sg/KsMrNeDYsp6x7fD37OcuVct5hqH/S2cik4ZiGf mL745w8PplfFEXpvCUYsHTiWYdNYn5LnB1JtBgzyjTGVWoVVcOg3mNIK7nGy0sZRn8tC H8Pa7PBYuBRSpi3gRiBo/eXCMSlUTPiE/tNoywPLSh6DmRzFfI/eUTrLnPH+5TMojGU2 oOYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature; bh=HVZDBzFnn/+6/eX2i6ZvoSlRuJ3gztniPjuOgTp9/dk=; b=tcPpv2ZfnaBPdYuiamrg3tn48J1O6D1jtLHNMfYzpqlLAr2DcetPSXG4Xbc1R1idP9 LHtxphiv0kzK8RKdW1ZIMn3cBzwdaLzsehif8b8n2QdTVoYAht8aqi2B6xoNShuH3BlZ 8Ck++q+NNpxX+Pqy/pYSz3X3HCEMjvB+zUxY7QC+WOZjsQwbgkOdxNMSE4CFJrVqwmJ3 xZHetqjQG5gf/pFpqw6U4zT02HBJxp9wdV4ywLdq2JiYPeX/7pcoLfbxFiwYEZB0s2aP 9m3hNibFg5+2YoC0Rq2p9YmLJzHZK3Oozf8hsdshlyvEdV4XjrrQyp1Gno6UKqVsnAdw M/Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=n8OfIJ7s; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4si398619edm.183.2019.09.25.17.46.09; Wed, 25 Sep 2019 17:46:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=n8OfIJ7s; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392650AbfIXHtU (ORCPT + 99 others); Tue, 24 Sep 2019 03:49:20 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:34485 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388712AbfIXHtU (ORCPT ); Tue, 24 Sep 2019 03:49:20 -0400 Received: by mail-ot1-f67.google.com with SMTP id m19so667061otp.1 for ; Tue, 24 Sep 2019 00:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=HVZDBzFnn/+6/eX2i6ZvoSlRuJ3gztniPjuOgTp9/dk=; b=n8OfIJ7s4YOK4wUING3b8Y7BfaOB4T6MA+Ys/5+Vbh2+YRQfEdBCIkahUSco88/RwZ FyOGVH6WpTZSbNxkbcHvxipsUuiWoFdjVynUY3RvmoUxW125VAzkh5gH77Dk/yTJgp1S Are2idhLJkDX0y4Y79HUbvOMVA7qB4PpgR0u+xvgnjyMmPUwCPMx81lBfuUjBNommOmk Wn1FARh9Ia/DJ5oppLkdhzaNtB9oafOWqJf6HbPbE9O1Ayz9tLc82f6+r/OYy1N5VNM5 SaqVpDQxR+MyI1Lhcw0qCztqsSUsOyFHKxbMwcKcoiaud82Z9spuqCpcrmGtET2lU6Wk 9H/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=HVZDBzFnn/+6/eX2i6ZvoSlRuJ3gztniPjuOgTp9/dk=; b=Xxz0Mhk1CV2ftIvpcSMUeTMHrqZnbxKzyIYsTNIYbmqSh2KNw4P7vDCvpF0V6ABauT 9wlr1LEy70cm7UzK3DxPbYR/8OkGDaGgTVP77zHZLdTPXET0D7zGyb/6fZIg9BqG7lZV 2eXA8XFlMxKoCqy4Jg7rDCCP7jluWkugw0EERr1WtLAFW2G0zJNXeRzYv9csg2Q59WIM dM4QpBa12ccm5IZLzZ6bjAhB5cl6p1UqjGI00UcHzg4WWTgjcvyNb2OCOC986wCcRwy3 0iumNOAcUULb9bA10n9a15HEATG1hPPtR7/FiOEs6Gbo1YrV/fI5QiJfejsHmFDei8JY bQjQ== X-Gm-Message-State: APjAAAUJ8BTRoY7Ffihov/48aasXKwnzPvu+s/UAWw5sYb2Pv/K+BvkJ gnppZjovDpezaE/ujGmGEvg0PSE2RzLJ6io0Za0= X-Received: by 2002:a9d:5f9a:: with SMTP id g26mr768874oti.27.1569311359420; Tue, 24 Sep 2019 00:49:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:2286:0:0:0:0:0 with HTTP; Tue, 24 Sep 2019 00:49:18 -0700 (PDT) In-Reply-To: <87d0fq5kic.fsf@codeaurora.org> References: <1569268165-1639-1-git-send-email-pozega.tomislav@gmail.com> <1569268165-1639-5-git-send-email-pozega.tomislav@gmail.com> <87d0fq5kic.fsf@codeaurora.org> From: Tom Psyborg Date: Tue, 24 Sep 2019 09:49:18 +0200 Message-ID: Subject: Re: [PATCH 5/5] ath10k: pull_svc_rdy code-style fix To: Kalle Valo Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 24/09/2019, Kalle Valo wrote: > Tomislav Po=C5=BEega writes: > >> Drop unneeded lines by moving skb data in both main and 10x WMI >> pull service ready event operations. >> >> Signed-off-by: Tomislav Po=C5=BEega >> --- >> drivers/net/wireless/ath/ath10k/wmi.c | 6 ++---- >> 1 files changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c >> b/drivers/net/wireless/ath/ath10k/wmi.c >> index 59d2d2a..8ab178c 100644 >> --- a/drivers/net/wireless/ath/ath10k/wmi.c >> +++ b/drivers/net/wireless/ath/ath10k/wmi.c >> @@ -5345,13 +5345,12 @@ static int ath10k_wmi_alloc_host_mem(struct ath1= 0k >> *ar, u32 req_id, >> ath10k_wmi_main_op_pull_svc_rdy_ev(struct ath10k *ar, struct sk_buff >> *skb, >> struct wmi_svc_rdy_ev_arg *arg) >> { >> - struct wmi_service_ready_event *ev; >> + struct wmi_service_ready_event *ev =3D (void *)skb->data; >> size_t i, n; >> >> if (skb->len < sizeof(*ev)) >> return -EPROTO; >> >> - ev =3D (void *)skb->data; > > Actually I prefer the original style, so that we first check the data in > skb is valid and only then assign the data to ev. > > -- > Kalle Valo > It came to my mind that this might be the reason why the current driver did not give me warning about too short service ready event, but there was no warning about event length in either case. I even tested this with compat wireless from 2013. and there the situation was the opposite: in both cases there was warning about service ready length.