netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Sudarsana Kalluru <skalluru@marvell.com>,
	GR-Linux-NIC-Dev@marvell.com, Rasesh Mody <rmody@marvell.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3 6/7] bna: Avoid clashing function prototypes
Date: Thu, 10 Nov 2022 07:43:35 +0200	[thread overview]
Message-ID: <87v8nns6t4.fsf@kernel.org> (raw)
In-Reply-To: <f813f239cd75c341e26909f59f153cb9b72b1267.1667934775.git.gustavoars@kernel.org> (Gustavo A. R. Silva's message of "Tue, 8 Nov 2022 14:31:36 -0600")

"Gustavo A. R. Silva" <gustavoars@kernel.org> writes:

> When built with Control Flow Integrity, function prototypes between
> caller and function declaration must match. These mismatches are visible
> at compile time with the new -Wcast-function-type-strict in Clang[1].
>
> Fix a total of 227 warnings like these:
>
> drivers/net/ethernet/brocade/bna/bna_enet.c:519:3: warning: cast from 'void (*)(struct bna_ethport *, enum bna_ethport_event)' to 'bfa_fsm_t' (aka 'void (*)(void *, int)') converts to incompatible function type [-Wcast-function-type-strict]
>                 bfa_fsm_set_state(ethport, bna_ethport_sm_down);
>                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> The bna state machine code heavily overloads its state machine functions,
> so these have been separated into their own sets of structs, enums,
> typedefs, and helper functions. There are almost zero binary code changes,
> all seem to be related to header file line numbers changing, or the
> addition of the new stats helper.
>
> Important to mention is that while I was manually implementing this changes
> I was staring at this[2] patch from Kees Cook. Thanks, Kees. :)
>
> [1] https://reviews.llvm.org/D134831
> [2] https://lore.kernel.org/linux-hardening/20220929230334.2109344-1-keescook@chromium.org/
> Reviewed-by: Kees Cook <keescook@chromium.org>
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
> Changes in v3:
>  - Add RB tag from Kees.
>  - Update changelog text.
>
> Changes in v2:
>  - None. This patch is new in the series.
>  - Link: https://lore.kernel.org/linux-hardening/2812afc0de278b97413a142d39d939a08ac74025.1666894751.git.gustavoars@kernel.org/
>
>  drivers/net/ethernet/brocade/bna/bfa_cs.h    | 60 +++++++++++++-------
>  drivers/net/ethernet/brocade/bna/bfa_ioc.c   | 10 ++--
>  drivers/net/ethernet/brocade/bna/bfa_ioc.h   |  8 ++-
>  drivers/net/ethernet/brocade/bna/bfa_msgq.h  |  8 ++-
>  drivers/net/ethernet/brocade/bna/bna_enet.c  |  6 +-
>  drivers/net/ethernet/brocade/bna/bna_tx_rx.c |  6 +-
>  drivers/net/ethernet/brocade/bna/bna_types.h | 27 +++++++--

Mixing wifi and ethernet patches in the same patch is not a good idea,
the network maintainers might miss this patch. I recommend submitting
patch 6 separately.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2022-11-10  5:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08 20:18 [PATCH v3 0/7] Avoid clashing function prototypes Gustavo A. R. Silva
2022-11-08 20:21 ` [PATCH v3 1/7] wifi: orinoco: " Gustavo A. R. Silva
2022-11-10  0:06   ` Kees Cook
2022-11-16  9:32   ` Kalle Valo
2022-11-08 20:23 ` [PATCH v3 2/7] cfg80211: " Gustavo A. R. Silva
2022-11-10  0:06   ` Kees Cook
2022-11-08 20:25 ` [PATCH v3 3/7] wifi: hostap: " Gustavo A. R. Silva
2022-11-10  0:07   ` Kees Cook
2022-11-08 20:26 ` [PATCH v3 4/7] wifi: zd1201: " Gustavo A. R. Silva
2022-11-08 20:27 ` [PATCH v3 5/7] wifi: airo: " Gustavo A. R. Silva
2022-11-08 20:31 ` [PATCH v3 6/7] bna: " Gustavo A. R. Silva
2022-11-10  5:43   ` Kalle Valo [this message]
2022-11-11 16:46     ` Gustavo A. R. Silva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8nns6t4.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmody@marvell.com \
    --cc=skalluru@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).