3df40eb3 | 30-Jul-2021 |
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> |
nfc: constify several pointers to u8, char and sk_buff
Several functions receive pointers to u8, char or sk_buff but do not modify the contents so make them const. This allows doing the same for lo
nfc: constify several pointers to u8, char and sk_buff
Several functions receive pointers to u8, char or sk_buff but do not modify the contents so make them const. This allows doing the same for local variables and in total makes the code a little bit safer.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
49545357 | 24-Jul-2021 |
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> |
nfc: constify nfc_llc_ops
Neither the core nor the drivers modify the passed pointer to struct nfc_llc_ops, so make it a pointer to const for correctness and safety.
Signed-off-by: Krzysztof Kozlow
nfc: constify nfc_llc_ops
Neither the core nor the drivers modify the passed pointer to struct nfc_llc_ops, so make it a pointer to const for correctness and safety.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
094c45c8 | 24-Jul-2021 |
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> |
nfc: constify nfc_hci_ops
Neither the core nor the drivers modify the passed pointer to struct nfc_hci_ops, so make it a pointer to const for correctness and safety.
Signed-off-by: Krzysztof Kozlow
nfc: constify nfc_hci_ops
Neither the core nor the drivers modify the passed pointer to struct nfc_hci_ops, so make it a pointer to const for correctness and safety.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
f6c802a7 | 24-Jul-2021 |
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> |
nfc: constify nfc_ops
Neither the core nor the drivers modify the passed pointer to struct nfc_ops, so make it a pointer to const for correctness and safety.
Signed-off-by: Krzysztof Kozlowski <krz
nfc: constify nfc_ops
Neither the core nor the drivers modify the passed pointer to struct nfc_ops, so make it a pointer to const for correctness and safety.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
22d387e1 | 25-Sep-2017 |
Allen Pais <allen.lkml@gmail.com> |
net: nfc: hci: llc_shdlc: use setup_timer() helper.
Use setup_timer function instead of initializing timer with the function and data fields.
Signed-off-by: Allen Pais <allen.lkml@gmail.com> Sig
net: nfc: hci: llc_shdlc: use setup_timer() helper.
Use setup_timer function instead of initializing timer with the function and data fields.
Signed-off-by: Allen Pais <allen.lkml@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
634fef61 | 16-Jun-2017 |
Johannes Berg <johannes.berg@intel.com> |
networking: add and use skb_put_u8()
Joe and Bjørn suggested that it'd be nicer to not have the cast in the fairly common case of doing *(u8 *)skb_put(skb, 1) = c;
Add skb_put_u8() for this case,
networking: add and use skb_put_u8()
Joe and Bjørn suggested that it'd be nicer to not have the cast in the fairly common case of doing *(u8 *)skb_put(skb, 1) = c;
Add skb_put_u8() for this case, and use it across the code, using the following spatch:
@@ expression SKB, C, S; typedef u8; identifier fn = {skb_put}; fresh identifier fn2 = fn ## "_u8"; @@ - *(u8 *)fn(SKB, S) = C; + fn2(SKB, C);
Note that due to the "S", the spatch isn't perfect, it should have checked that S is 1, but there's also places that use a sizeof expression like sizeof(var) or sizeof(u8) etc. Turns out that nobody ever did something like *(u8 *)skb_put(skb, 2) = c;
which would be wrong anyway since the second byte wouldn't be initialized.
Suggested-by: Joe Perches <joe@perches.com> Suggested-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|