Re: [PATCH] pinctrl: tegra: use signed bitfields for optional fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/14/2015 06:05 PM, Stefan Agner wrote:
Optional fields are set to -1 by various preprocessor macros. Make
sure the struct fields can actually store them.

diff --git a/drivers/pinctrl/pinctrl-tegra.h b/drivers/pinctrl/pinctrl-tegra.h

-	u32 mux_bit:6;
-	u32 pupd_bit:6;
-	u32 tri_bit:6;
...
+	s8 mux_bit:6;
+	s8 pupd_bit:6;
+	s8 tri_bit:6;

Could we make these s32s instead? According to the C standard, the type should be a signed or unsigned int, and s32 matches that better than s8 for existing Tegra 32-bit platforms. Equally, for bitfields that don't fit into the remaining space within a container (s8 above), implementations are allowed to either span bitfields across multiple containers, or pad the current container and start the bitfield in the next container. Using the larger s32 as the "container" yields less opportunity for potential padding and thus wasting space.

Do you observe any increase in the sizes reported by "${CROSS_COMPILE}size pinctrl-tegra*.o" with this patch?
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux