linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Sasha Levin <alexander.levin@microsoft.com>
Subject: [PATCH 3.18 53/85] media: siano: get rid of __le32/__le16 cast warnings
Date: Tue,  7 Aug 2018 20:51:55 +0200	[thread overview]
Message-ID: <20180807172359.329225145@linuxfoundation.org> (raw)
In-Reply-To: <20180807172357.357252052@linuxfoundation.org>

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mauro Carvalho Chehab <mchehab@s-opensource.com>

[ Upstream commit e1b7f11b37def5f3021c06e8c2b4953e099357aa ]

Those are all false-positives that appear with smatch when building for
arm:

  drivers/media/common/siano/smsendian.c:38:36: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:38:36: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:38:36: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:38:36: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:38:36: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:38:36: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:47:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:47:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:47:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:47:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:47:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:47:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:67:35: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:67:35: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:67:35: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:67:35: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:84:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:84:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:84:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:84:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:84:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:84:44: warning: cast to restricted __le32
  drivers/media/common/siano/smsendian.c:98:26: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:98:26: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:98:26: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:98:26: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:99:28: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:99:28: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:99:28: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:99:28: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:100:27: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:100:27: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:100:27: warning: cast to restricted __le16
  drivers/media/common/siano/smsendian.c:100:27: warning: cast to restricted __le16

Get rid of them by adding explicit forced casts.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/media/common/siano/smsendian.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/media/common/siano/smsendian.c
+++ b/drivers/media/common/siano/smsendian.c
@@ -35,7 +35,7 @@ void smsendian_handle_tx_message(void *b
 	switch (msg->x_msg_header.msg_type) {
 	case MSG_SMS_DATA_DOWNLOAD_REQ:
 	{
-		msg->msg_data[0] = le32_to_cpu(msg->msg_data[0]);
+		msg->msg_data[0] = le32_to_cpu((__force __le32)(msg->msg_data[0]));
 		break;
 	}
 
@@ -44,7 +44,7 @@ void smsendian_handle_tx_message(void *b
 				sizeof(struct sms_msg_hdr))/4;
 
 		for (i = 0; i < msg_words; i++)
-			msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]);
+			msg->msg_data[i] = le32_to_cpu((__force __le32)msg->msg_data[i]);
 
 		break;
 	}
@@ -64,7 +64,7 @@ void smsendian_handle_rx_message(void *b
 	{
 		struct sms_version_res *ver =
 			(struct sms_version_res *) msg;
-		ver->chip_model = le16_to_cpu(ver->chip_model);
+		ver->chip_model = le16_to_cpu((__force __le16)ver->chip_model);
 		break;
 	}
 
@@ -81,7 +81,7 @@ void smsendian_handle_rx_message(void *b
 				sizeof(struct sms_msg_hdr))/4;
 
 		for (i = 0; i < msg_words; i++)
-			msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]);
+			msg->msg_data[i] = le32_to_cpu((__force __le32)msg->msg_data[i]);
 
 		break;
 	}
@@ -95,9 +95,9 @@ void smsendian_handle_message_header(voi
 #ifdef __BIG_ENDIAN
 	struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)msg;
 
-	phdr->msg_type = le16_to_cpu(phdr->msg_type);
-	phdr->msg_length = le16_to_cpu(phdr->msg_length);
-	phdr->msg_flags = le16_to_cpu(phdr->msg_flags);
+	phdr->msg_type = le16_to_cpu((__force __le16)phdr->msg_type);
+	phdr->msg_length = le16_to_cpu((__force __le16)phdr->msg_length);
+	phdr->msg_flags = le16_to_cpu((__force __le16)phdr->msg_flags);
 #endif /* __BIG_ENDIAN */
 }
 EXPORT_SYMBOL_GPL(smsendian_handle_message_header);



  parent reply	other threads:[~2018-08-07 18:58 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 18:51 [PATCH 3.18 00/85] 3.18.118-stable review Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 01/85] tracing: Fix double free of event_trigger_data Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 02/85] tracing: Fix possible double free in event_enable_trigger_func() Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 03/85] tracing/kprobes: Fix trace_probe flags on enable_trace_kprobe() failure Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 04/85] tracing: Quiet gcc warning about maybe unused link variable Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 05/85] ALSA: emu10k1: add error handling for snd_ctl_add Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 06/85] ALSA: fm801: " Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 07/85] mm: vmalloc: avoid racy handling of debugobjects in vunmap Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 08/85] mm/slub.c: add __printf verification to slab_err() Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 09/85] rtc: ensure rtc_set_alarm fails when alarms are not supported Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 10/85] infiniband: fix a possible use-after-free bug Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 11/85] hvc_opal: dont set tb_ticks_per_usec in udbg_init_opal_common() Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 12/85] RDMA/mad: Convert BUG_ONs to error flows Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 13/85] usbip: usbip_detach: Fix memory, udev context and udev leak Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 14/85] perf/x86/intel/uncore: Correct fixed counter index check in generic code Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 15/85] perf/x86/intel/uncore: Correct fixed counter index check for NHM Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 16/85] ASoC: dpcm: fix BE dai not hw_free and shutdown Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 17/85] mwifiex: handle race during mwifiex_usb_disconnect Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 18/85] wlcore: sdio: check for valid platform device data before suspend Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 19/85] PCI: Prevent sysfs disable of device while driver is attached Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 20/85] ath: Add regulatory mapping for FCC3_ETSIC Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 21/85] ath: Add regulatory mapping for ETSI8_WORLD Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 22/85] ath: Add regulatory mapping for APL13_WORLD Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 23/85] ath: Add regulatory mapping for APL2_FCCA Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 24/85] ath: Add regulatory mapping for Uganda Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 25/85] ath: Add regulatory mapping for Tanzania Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 26/85] ath: Add regulatory mapping for Serbia Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 27/85] ath: Add regulatory mapping for Bermuda Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 28/85] ath: Add regulatory mapping for Bahamas Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 33/85] powerpc/8xx: fix invalid register expression in head_8xx.S Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 34/85] PCI: pciehp: Request control of native hotplug only if supported Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 35/85] scsi: ufs: fix exception event handling Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 36/85] ALSA: emu10k1: Rate-limit error messages about page errors Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 37/85] regulator: pfuze100: add .is_enable() for pfuze100_swb_regulator_ops Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 38/85] md: fix NULL dereference of mddev->pers in remove_and_add_spares() Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 39/85] media: smiapp: fix timeout checking in smiapp_read_nvm Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 40/85] ALSA: usb-audio: Apply rate limit to warning messages in URB complete callback Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 41/85] drm/radeon: fix mode_valids return type Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 43/85] HID: i2c-hid: check if device is there before really probing Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 44/85] tty: Fix data race in tty_insert_flip_string_fixed_flag Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 45/85] libata: Fix command retry decision Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 46/85] media: saa7164: Fix driver name in debug output Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 47/85] s390/cpum_sf: Add data entry sizes to sampling trailer entry Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 48/85] perf: fix invalid bit in diagnostic entry Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 49/85] scsi: 3w-9xxx: fix a missing-check bug Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 50/85] scsi: 3w-xxxx: " Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 51/85] scsi: megaraid: silence a static checker bug Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 52/85] bpf: fix references to free_bpf_prog_info() in comments Greg Kroah-Hartman
2018-08-07 18:51 ` Greg Kroah-Hartman [this message]
2018-08-07 18:51 ` [PATCH 3.18 54/85] ALSA: hda/ca0132: fix build failure when a local macro is defined Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 55/85] drm/gma500: fix psb_intel_lvds_mode_valid()s return type Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 56/85] ipconfig: Correctly initialise ic_nameservers Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 57/85] rsi: Fix invalid vdd warning in mmc Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 58/85] microblaze: Fix simpleImage format generation Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 59/85] usb: hub: Dont wait for connect state at resume for powered-off ports Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 60/85] crypto: authencesn - dont leak pointers to authenc keys Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 61/85] crypto: authenc " Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 62/85] media: omap3isp: fix unbalanced dma_iommu_mapping Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 63/85] media: si470x: fix __be16 annotations Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 64/85] random: mix rdrand with entropy sent in from userspace Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 65/85] squashfs: be more careful about metadata corruption Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 66/85] NET: stmmac: align DMA stuff to largest cache line length Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 67/85] xen-netfront: wait xenbus state change when load module manually Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 68/85] tcp: do not force quickack when receiving out-of-order packets Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 69/85] tcp: add max_quickacks param to tcp_incr_quickack and tcp_enter_quickack_mode Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 70/85] tcp: do not aggressively quick ack after ECN events Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 71/85] tcp: refactor tcp_ecn_check_ce to remove sk type cast Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 72/85] tcp: add one more quick ack after after ECN events Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 73/85] ipv4: remove BUG_ON() from fib_compute_spec_dst Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 74/85] inet: frag: enforce memory limits earlier Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 75/85] net: dsa: Do not suspend/resume closed slave_dev Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 76/85] squashfs: more metadata hardening Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 78/85] can: ems_usb: Fix memory leak on ems_usb_disconnect() Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 79/85] virtio_balloon: fix another race between migration and ballooning Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 80/85] crypto: padlock-aes - Fix Nano workaround data corruption Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 81/85] scsi: sg: fix minor memory leak in error path Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 82/85] scsi: qla2xxx: Fix ISP recovery on unload Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 83/85] scsi: qla2xxx: Return error when TMF returns Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 84/85] ring_buffer: tracing: Inherit the tracing setting to next ring buffer Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 85/85] jfs: Fix inconsistency between memory allocation and ea_buf->max_size Greg Kroah-Hartman
2018-08-07 22:33 ` [PATCH 3.18 00/85] 3.18.118-stable review Nathan Chancellor
2018-08-08  6:35   ` Greg Kroah-Hartman
2018-08-08  2:52 ` Shuah Khan
2018-08-08  5:29   ` Greg Kroah-Hartman
2018-08-08 16:05 ` Guenter Roeck

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=20180807172359.329225145@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.levin@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=stable@vger.kernel.org \
    /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).